"No AspNetMount URI for request" error in Apache - asp.net

I've installed mod_aspdotnet-2.2.0.2006.msi, and modified the httpd.conf to support dot net:
LoadModule aspdotnet_module "modules/mod_aspdotnet.so"
AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo
<IfModule mod_aspdotnet.cpp>
AspNetMount /active "E:/TestWeb"
Alias /active "E:/TestWeb"
# Allow asp.net scripts to be executed in the active example
<Directory "E:/TestWeb">
Options FollowSymlinks ExecCGI
Order allow,deny
Allow from all
DirectoryIndex default.htm default.aspx index.html index.aspx
</Directory>
# For all virtual ASP.NET webs, we need the aspnet_client files
# to serve the client-side helper scripts.
AliasMatch /aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*) "C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4"
<Directory "C:/Windows/Microsoft.NET/Framework/v*/ASP.NETClientFiles">
Options FollowSymlinks
Order allow,deny
Allow from all
</Directory>
</IfModule>
It works fine when I launch normal HTML files(xxx.xxx.xxx.xxx:801/test.html), but when I launch any asp.net file(xxx.xxx.xxx.xxx:801/apps.aspx), there comes 500 error:
Internal Server
Error The server encountered an internal error or
misconfiguration and was unable to complete your request.
Please contact the server administrator, xxx#gmail.com and inform them
of the time the error occurred, and anything you might have done that
may have caused the error.
More information about this error may be available in the server error
log.
[Mon Aug 11 11:20:41 2014] [notice] Apache/2.2.25 (Win32) mod_aspdotnet/2.2 configured -- resuming normal operations
[Mon Aug 11 11:20:41 2014] [notice] Server built: Jul 10 2013 01:52:12
[Mon Aug 11 11:20:41 2014] [notice] Parent: Created child process 4952
httpd.exe: Could not reliably determine the server's fully qualified domain name, using xxx.xxx.xxx.xxx for ServerName
[Mon Aug 11 11:20:41 2014] [notice] mod_aspdotnet: CorBindToRuntimeEx has loaded version v2.0.50727 of the .NET CLR engine.
httpd.exe: Could not reliably determine the server's fully qualified domain name, using xxx.xxx.xxx.xxx for ServerName
[Mon Aug 11 11:20:42 2014] [notice] Child 4952: Child process is running
[Mon Aug 11 11:20:42 2014] [notice] Child 4952: Acquired the start mutex.
[Mon Aug 11 11:20:42 2014] [notice] Child 4952: Starting 64 worker threads.
[Mon Aug 11 11:20:43 2014] [notice] Child 4952: Starting thread to listen on port 801.
[Mon Aug 11 11:20:56 2014] [error] [client xxx.xxx.xxx.xxx] mod_aspdotnet: No AspNetMount URI for request: /Apps.aspx
This is the first time I use Apache to run my asp.net site. Maybe the error is stupid but please tell me.

I figured it out:
In my config, I used alias
Alias /active "E:/TestWeb". So I should input url http//172.0.0.1/active instead of http//172.0.0.1.

Related

Unable to configure proxy for ASP.NET application to be viewed on Apache website

I am doing a project where a running ASP.NET application (ran by dotnet core) is to be portrayed on a website via apache. I am having trouble with the proxy and get some interesting log errors I can't understand.
[Fri Jan 06 10:54:01.049808 2023] [proxy_http:error] [pid 17756:tid 3045061632] (20014)Internal error (specific information not available): [client 5.150.205.190:61781] AH01102: error reading status line from remote server localhost:7199, referer: http://www.website.me/
[Fri Jan 06 10:54:01.050039 2023] [proxy:error] [pid 17756:tid 3045061632] [client 5.150.205.190:61781] AH00898: Error reading from remote server returned by /favicon.ico, referer: http://www.website.me/
The VirtualHost is kept simple
<VirtualHost *:80>
ServerName www.website.me
ServerAlias www.website.me
ProxyPreserveHost On
ProxyRequests On
ProxyPass "/" "http://localhost:7199/"
ProxyPassReverse "/" "http://localhost:7199/"
</VirtualHost>
I've consulted with ChatGPT, referring me vaguely to possible network issues between the application and apache. But since both are running I don't see the issue with simply pointing to the localhost view. I can view it locally in browser. Why can't I point to it?

How to fix Invalid request (Unsupported SSL request)

I'm setting up my laravel application and every time I run php artisan serve, it starts a laravel development serve at localhost:8000. Bu when i open the locahost link on the browser, it forces the http to https and logs invalid request (unsupported SSl request). What do you advise me to do to resolve this?
I have tried forcing the HTTPS mod rewrite rule to http:// on the .htaccess file and it still persists.
This is the command line
C:\Users\topaz\cashurban>php artisan serve
Laravel development server started: <http://127.0.0.1:8000>
[Thu Aug 22 23:06:07 2019] 127.0.0.1:60410 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60418 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60419 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60420 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60421 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60423 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60409 [200]: /assets/img/slider-1.jpg
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60425 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60426 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60427 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60411 [200]: /assets/img/slider-2.jpg
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60435 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60437 [200]: /assets/img/slider-3.jpg
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60439 [200]: /assets/img/icon-1-1.png
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60438 [200]: /assets/img/images/index-Recovereddashboard_03.png
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60440 [200]: /assets/img/icon-2-1.png
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60442 [200]: /assets/img/icon-3-1.png
[Thu Aug 22 23:06:08 2019] 127.0.0.1:60447 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60448 [200]: /assets/img/tor1.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60450 [200]: /assets/img/tor2.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60452 [200]: /assets/img/tor3.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60455 [200]: /assets/img/images/visa.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60453 [200]: /assets/img/images/remita.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60454 [200]: /assets/img/images/master-card.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60460 [200]: /assets/img/images/verve.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60461 [200]: /assets/img/images/indexpartners_11.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60462 [200]: /assets/img/images/bank-branches.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60463 [200]: /assets/img/images/indexpower_03.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60464 [200]: /assets/img/images/paystack.png
[Thu Aug 22 23:06:09 2019] 127.0.0.1:60465 [200]: /assets/img/images/chams.png
[Thu Aug 22 23:06:10 2019] 127.0.0.1:60468 Invalid request (Unsupported SSL request)
[Thu Aug 22 23:06:10 2019] 127.0.0.1:60469 Invalid request (Unsupported SSL request)
this is the .htaccess file
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
#Force Https
#RewriteCond %{HTTPS} !=on
#RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
#Api Redirect
RewriteCond %{REQUEST_URI} (.+)/$
#RewriteRule ^/api$ api.%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#GZip Compression
<ifModule mod_gzip.c>
#mod_gzip_on Yes
#mod_gzip_dechunk Yes
#mod_gzip_item_include file .(html?|txt|css|js|php|xml|json|pl)$
#mod_gzip_item_include handler ^cgi-script$
#mod_gzip_item_include mime ^text/.*
#mod_gzip_item_include mime ^application/x-javascript.*
#mod_gzip_item_exclude mime ^image/.*
#mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
#php_value auto_prepend_file /home/example_project/public_html/error_handler_slack.php
php_value auto_prepend_file error_handler_slack.php
</IfModule>
I expect that it serves on http://localhost and not https://localhost as it is currently redirecting
I solved this later, just in case anyone has a similar problem in the future, I discovered the AppServiceProvider class had a register method where a security interception middleware was registered to force every HTTP request to HTTPS. So I wrote an if-else logic to allow this only on production since my localhost had no SSL certificate.
in app/providers/AppServiceProvider.php
look for the register() method, then implement the logic by checking whether the app is local or not. The isLocal() method checks your .env file for APP_ENV variable and returns true if it is local, so you reconfirm again that, that is set to local and be sure to clear any previous configuration cache.
//check that app is local
if ($this->app->isLocal()) {
//if local register your services you require for development
$this->app->register('Barryvdh\Debugbar\ServiceProvider');
} else {
//else register your services you require for production
$this->app['request']->server->set('HTTPS', true);
}
First make sure the APP_URL in the .env file is something like
this: APP_URL=http://localhost or http://127.0.0.1:8000
Change APP_ENV=production to APP_ENV=development
Then run php artisan serve again
if above method doesn't work
Edit the /app/Providers/AppServiceProvider.php file:
URL::forceScheme('https'); to URL::forceScheme('http');
and run the application again
This is how I fixed my Invalid request (Unsupported SSL request)
NB: All these changes must be worked on from your project root directory
Delete all files inside the bootstrap\cache folder (except the .gitignore file, that is if you have one)
Delete the vendor folder
Type composer install or composer update in command line terminal to install or update the necessary files and configurations back
I resolved this by disabling cache:
Step 1:
config\cache.php
'stores' => [
'none' => [
'driver' => 'null',
],
],
Step 2:
app\Providers\AppServiceProvider.php
Add at the top
use Illuminate\Cache\NullStore;
use Cache;
Add in boot() method
Cache::extend('none', function ($app) {
return Cache::repository(new NullStore);
});
Go to .env file,
change APP_ENV=production to APP_ENV=development
Then run php artisan serve again
I resolve it by changing the APP_URL=http://localhost to APP_URL=http://127.0.0.1 in the .env file
In Laravel Framework 7+ you need to edit the /app/Providers/AppServiceProvider.php file: Update
URL::forceScheme('https');
to
URL::forceScheme('`http`');
Then clean cache using
php artisan config:cache
and run application.
Wanted to share my experience just in case it helps someone. Even I got the same error. This is how I solved it.
I added the following in .env file.
APP_SSL=false
I have solved by changing APP_URL=http://localhost to APP_URL=http://127.0.0.1:8000/ in '.env' file.
Based on the response of #zaghadon.
best solution is just to use one condition :
Change must be done on file : app/Providers/AppServiceProvider.php
public function register()
{
//check that app is local
if (!$this->app->isLocal()) {
//else register your services you require for production
$this->app['request']->server->set('HTTPS', true);
}
}
I have to change the
URL::forceScheme('https');
to
URL::forceScheme('http');
AND
serve --port and my issue is resolved.
php artisan serve --port=8002
I solved it by changing http://localhost:8000 to localhost:8000
Invalid request (Unsupported SSL request)
I tried everything recommended above and nothing worked. Here is how I got past the problem:
My browser is trying to access https://localhost:8000. Simply changing to http://localhost:800 on my browser address bar solved the problem. Spent days tinkering on this problem and I believe leaving this answer here would help someone someday
This is an old question, but my answer may solve someone's problem.
On the local development server, if you don't need to send an HTTPS request,
Try changing your URL from
https://127.0.0.1:8000/
to this
http://127.0.0.1:8000/
Make sure your APP_URL in .env is set to http://127.0.0.1:8000.
Because you are try to change URL from http to https on the localhost to fix this problem undo changes that it will change http to https and writing the URL by this way
http://127.0.0.1:8000/
Find out that you are not working on the same project on another browser/tab.
I had a similar issue. I was already working on my Laravel project before I opened another window to work on something else. I was working on a Nodejs project but in the same VScode and the terminal was for it and the port number was 8080. I closed the browser tab of the node project to return to the Laravel project to start php artisan serve again (e.g two different browser windows but one terminal) and I started having that problem.
I just closed the second browser tab and that was it.
I solved mine using #zaghadon solution using Laravel 9, and put little modification,
On AppServiceProvider.php located at app\Providers\ inside boot function:
if ($this->app->isLocal())
{
$this->app['request']->server->set('http', true);
}

wordpress wp-plugin as referrer in non wordpress server

I have recently found some strange logs on my webserver (something about wordpress):
[Wed Nov 15 19:44:28 2017] [error] [client 209.90.225.243] File does not exist: /path/to/vhosts/docroot/wp-content, referer: http://my.domain/wp-content/plugins/revslider/temp/
[Mon Nov 13 19:05:51 2017] [error] [client 209.90.225.243] File does not exist: /path/to/vhosts/docroot/wp-content, referer: http://my.domain/wp-content/themes/famous/style.css
[Sat Nov 11 22:21:38 2017] [error] [client 209.90.225.243] File does not exist: /path/to/vhosts/docroot/wp-content, referer: http://my.domain/wp-content/plugins/complete-gallery-manager/frames/upload-images.php
The main problem is that I don't have a wordpress installed in the virtual-host where I found the these errors. On the same server, there are other intallations of word-press that I don't have access to.
Does anybody know why I'm seeing these logs messages? The referer page doesn't exist on my server, but it's easy to change in a http request made from scratch.
Could it be a random attack?

serf failing, sending https request to port 80 instead of 443, why?

When requesting via https it looks like serf is funnelling the request via port 80 instead of 443?
[Mon Jan 16 10:25:48.007386 2017] [error] [pid 350] [mod_pagespeed 1.11.33.4-0 #350] Serf status 120171(APR does not understand this error code) polling for 1 threaded fetches for 0.05 seconds
[Mon Jan 16 10:25:48.007539 2017] [error] [pid 350] [mod_pagespeed 1.11.33.4-0 #350] Serf status 120171(APR does not understand this error code) polling for 1 threaded fetches for 0.05 seconds
[Mon Jan 16 10:25:53.021234 2017] [warn] [pid 350] [mod_pagespeed 1.11.33.4-0 #350] Fetch timed out: https://www.domain.com/assets/76dc6ad2/style.min.css (connecting to:10.33.12.222:80) (1) waiting for 50 ms
SSL termination on the load balancer. SSL is also configured to work from behind the load balancer as well so https can be served from within the network.
ModPagespeedFetchHttps enable
ModPagespeedRespectXForwardedProto on
ModPagespeedEnableFilters prioritize_critical_css
How to have serf request https via port 443?
#dhaupin
I don't seem to notice that error anymore.
This is probably what fixed it, explicitly handling https requests.
ModPagespeedLoadFromFile "https://example.com" "/var/www/example/"
ModPagespeedRespectXForwardedProto on

500 Internal server error in wp admin ,at update & plugin (Wordpress)

I'm having Internal server error in some sessions(parts) after I login in wp dashboard.
Issues are in wp-admin/plugins.php and some few other places where is relating with any plugins.
I have checked .htaccess, memory limit to my server and in wp file is ok, I have deactivated all the plugins, changed themes, updated WordPress and still have the same issue.
I have check the error log and this is what it shows:
[Thu Jun 09 12:22:25 2016] [error] [client 217.73.141.38] Premature end of script headers: update-core.php, referer: http://www.salus.al/wp-admin/
[Thu Jun 09 12:22:29 2016] [warn] [client 217.73.141.38] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://www.salus.al/wp-admin/
[Thu Jun 09 12:22:29 2016] [error] [client 217.73.141.38] Premature end of script headers: plugins.php, referer: http://www.salus.al/wp-admin/
[Thu Jun 09 12:22:32 2016] [warn] [client 217.73.141.38] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://www.salus.al/wp-admin/
Remove or rename your plugins folder and see if the problem goes away. If it does, then add each plugin one at a time to see which one produces the error. Perhaps clear all cache, cookies, etc as well.

Resources