IIS deployment issue - iis

I am running IIS in a standalone Windows Server 2012, and getting a mysterious issue:
I have a webapi (developed with .NET 4.6) which impelement SCEP protocol under the HTTP GET, and the app folder is in C:\inetpub\wwwroot\app\mywebapi.
If I create a virtual directory under Default Web Site,then it works (for instance, http://localhost/app/mywebapi).
Test procedures:
using browsers to surf: http://localhost/app/mywebapi?operation=GetCACert
using sscep (an command line test tool) sscep getca -u http://localhost/app/mywebapi -c ca.crt
Results: Both cases work
if I create a new website, then it does not work in some case (for instance: http://mywebapi) (hosts file has been edited, so it understand mywebapi as a hostname already)
using browsers to surf: http://mywebapi?operation=GetCACert
using sscep (an command line test tool) sscep getca -u
http://mywebapi -c ca.crt
Results:
OK
does not work, IIS returns 404
Does anybody know about this issue?

Related

unexpected eof when using openssl

I am unable to get a basic react app to work using a self signed certificate on a local development server (Linux Mint 21, Linux 5.15.0-46-generic).
I installed node version 18.10. This has npm/npx v 8.19.2
I created a basic react app using
npx create-react-app myapp
I generated certificate and key using openssl. The certificate has been generated with the CN=sandbox.local, so that I'm not using an IP address.
I then start the app, using
HTTPS=true \
HOST=sandbox.local BROWSER=none \
SSL_CRT_FILE=certification/sandbox.local.pem \
SSL_KEY_FILE=certification/sandbox.local.pem \
npm start
This successfully starts the application, informing me that I can browse the application on https://localhost:3000 (or via the IP address on the network).
Attempting to browse from my local machine (also running Linux Mint 21), in firefox I get:
Secure Connection Failed
An error occurred during a connection to sandbox.local:3000. PR_END_OF_FILE_ERROR
In Chromium:
This page isn’t working
sandbox.local didn’t send any data.
ERR_EMPTY_RESPONSE
And using curl,
curl: (35) error:0A000126:SSL routines::unexpected eof while reading
There's a plethora of pages out there telling me that this is something to do with openssl version 3 expecting a response and not getting one. There's nothing that I've been able to find that tells me how to fix that in the context of a react application.
On the same machine I have a dash/plotly application, running with self signed certificates that were generated in exactly the same way. That application is accessible and works, which leads me to wonder if there it's something in the react/node interaction with openssl. I can resolve sandbox.local both with http and https for other types of applications.
The created app is literally the output of create-react-app. If I install and run it on the same machine, it works fine.
Is there some configuration option I'm missing? I haven't been able to generate an error log file from node, so apart from the SSL error from curl, I'm flying blind. Will update if/when I figure out how to log errors.

MarkLogic rest service returns 405 Method Not Allowed from selected servers

MarkLogic 8, Linux (Centos & RH6). I've set-up the same REST service, User, and Roles on each of three MarkLogic instances (2x Centos,1x RH6). I've separately checked the settings for these entries are identical for each host. The Centos boxes are VMs (VirtualBox on my local machine) where one is the original and the other a clone of this original VM). The RH6 machine is a networked development server. I'm using 'curl', via windows 7 command line, to 'PUT' a single test file into the Documents database. The Curl command I use is :
curl --basic --user <user>:<pwd> --upload-file "<file path>" -H "Content-type: text/plain" -X PUT "http://<host name>:<port number>/v1/documents?database=<database name>&uri=<test uri>"
I get a "405 Method not allowed", as a simple XML document [source = MarkLogic?] from ML on the RH6 and the cloned Centos machine but not from my original Centos VM where ML shows the file has loaded correctly. MarkLogic error logs show no errors on any of the hosts.
Any ideas on where should I start looking to resolve this issue?
Missed the fact I hadn't entered the default error handler and url rewriter settings of "/MarkLogic/rest-api/error-handler.xqy" and "/MarkLogic/rest-api/rewriter.xml" on the appserver on the two ML hosts that were reporting the issue.

Web2Py on AWS EC2 Linux

I have an instance running Linux at Amazon AWS EC2 after carefully following the instructions provided by Amazon here: Setting Up to Host a Web App on AWS.
I have set-up the security groups as mentioned in the documentation provided by Amazon.
The default security group has all traffic, all protocols, on all ports open.
In addition to the above security rule, I have setup SSH on port 22 and then, using CyberDuck (a great FTP app), I have uploaded the Web2Py source code into a folder named web2py at AWS.
After successfully FTP the source code into this web2py folder, I have SSH'ed into the AWS machine using the Terminal (on Mac locally) having the my-keys-file.pem on hand:
ssh -i my-keys-file.pem ec2-user#ec2-xx-xx-xx-xx.compute-1.amazonaws.com
(where the xx are the numbers in the Public DNS as they appear on my instance on EC2 page)
Then I have checked whether my AWS instance has python installed and it does have it.
Thus, I have proceeded to install Web2Py.
python2.6 web2py.py
password = pwd
it warns that GUI not available since Tlk library is not installed, but Massimo says here (http://comments.gmane.org/gmane.comp.python.web2py/129181) that it's not critical.
Running the Web2Py ....
If I try:
python web2py.py -a pwd -i 0.0.0.0 -p 80
It says:
there is an error with the Rocket Server with that specific port (used by another process that is not willing to share...)
If I try:
python web2py.py -a pwd
it says nothing (which begs the question: is web2py running ?) and when I try to access the web2py server
http://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com/
or
https://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com/admin
in both cases it says page is not available since it takes too long to access it (nothing about security cause).
If I try:
python web2py.py -a pwd -i 0.0.0.0 -p 8000
again - it says nothing (is web2py running ?)
trying to access the Web2Py server at
http://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com/
or
https://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com/admin
in both cases it says page is not available, same as above.
I have tried to use the IP address instead, but it is immediately translated to the amazon format of ec2-xx-xx-xx-xxx.etc...
I have tried to access web2py by explicitly mentioning the port (8000) in the address - still it doesn't work while giving no reason except page is not available
My questions:
Is there any DETAILED recipe on how to install AND run Web2Py on AWS EC2 ?
Is the web2py server running ? How can I know if it is running ? If it is not - what am I doing incorrectly ?
If the web2py server is running how can I access it ?
Any help would be much appreciated.
Thanks
I have deployed my Web2py to an EC2 instance running Ubuntu, but I guess you can adapt the same approach to your system.
The simplest way to deploy Web2py is following the 'One step production deployment' script introduced in the official Web2py book.
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
sudo ./setup-web2py-ubuntu.sh
Running this will install and configure everything you need.
When finished, simply type your IP or domain name into a web browser and you will see the default web2py website.

aspnet_compiler Failed to map the path '/'

.NET 4.5.2, IIS 8.5 on Windows 8.1 x64. I have a single ASP.NET web site at /localhost/. The DEFAULT website is disabled, a new site with was created with the right bindings. I am trying to pre-compile it in place:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_compiler -c -v /
error ASPRUNTIME: Failed to map the path '/'.
I tried the metabase-path route:
aspnet_compiler -c -m lm/w3svc/2/root
error ASPRUNTIME: Failed to map the path '/'.
I Can get it to compile by specifying the physical path but I don't want to do that because this same application exists on different servers with different physical paths (devs, QA, production). Not even the metabase paths are all the same. "/" is the same everywhere.
For grins I added this to a page in the site to make sure i wasn't losing my mind:
Response.Write(Server.MapPath("/"));
and got what I expected.
What am I doing wrong?
This is a rights issue; apparently you need to be administrator to access the IIS metabase.
I see two possible solutions:
Use -p to specify the physical path; that way aspnet_compiler does not need to access the IIS metabase. (OP already explained this may not be a practical solution in a server cluster.)
Run aspnet_compiler from an elevated command prompt (i.e. "Run As Administrator"), as suggested here.

Mono on Linux plus MVC3: Root directory shows file/folder list on web browser

I'm struggling getting my MVC3 site I developed on Windows to correctly run on Linux (Ubuntu) and Apache using Mono 2.10.5.
When I browse to the site root via my web browser, I see my file/folder structure instead of the home page of the site, which appears to me as though routing is not working. Everything works fine on my development environment on Windows.
When in this view, if I click on Global.asax, for instance, I see the standard ASP.NET "yellow screen of death" (YSOD) with a 500 error stating "Could not load type 'System.ComponentModel.DataAnnotations.KeyAttribute' from assembly 'MyWebSite'.".
On the bottom of the YSOD, I see the following: Version information: Mono Runtime Version: 2.10.5 (Debian 2.10.5-1); ASP.NET Version: 4.0.30319.1
I've followed the instructions for configuring Mono for MVC3 here: http://www.integratedwebsystems.com/2011/06/get-mvc3-razor-running-on-mono/
Does anyone have any clues as to why the file/folder structure is being listed when I visit the site root from my browser?
It turns out that mono was running under port 8080, and I couldn't configure it to run on port 80 due to a conflict with another module. I am able to run things fine on port 8080 now.

Resources