Drupal error on bottom : Not Found The requested URL / was not found on this server - apache

My website works but i have this error on bottom.
Not Found
The requested URL / was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at Port 80
this is my vhost configuration
<VirtualHost *:80>
ServerAdmin admin#xxxx.com
ServerName xxx.net
ServerAlias www.xxxx.net
DocumentRoot /var/www/xxxx.net/
<Directory /var/www/xxxx.net/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
ServerSignature Off
ErrorDocument 404 /var/www/xxxx.net/404.html
</VirtualHost>
My 404 page exist at this location /var/www/xxxx.net/404.html
Thx for you help !!!!

This may be malware code trying to load content from another host. I recommend to check your website.

Related

AH01630: client denied by server configuration: /data

I am getting this titular error message when following this guide in the Postfix admin section of the tutorial from Apache2's error logs and trying navigate to the website https://mailadmin.example.com/setup.php (also just replaced my website name with example.com) as I'm given a 403 Forbidden.
AH00112: Warning: DocumentRoot [/data/www/mailadmin.example.com/html/public] does not exist
AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
AH01630: client denied by server configuration: /data
Here is my virtual host configuration at sudo nano /etc/apache2/sites-available/mailadmin.example.com-le-ssl.conf
:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName mailadmin.example.com
ServerAlias mailadmin.example.com
ServerAdmin admin#example.com
DocumentRoot /data/www/mailadmin.example.com/html/public
<Directory /data/www/mailadmin.example.com/html/public>
Options -Indexes +FollowSymLinks
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.
# RewriteCond %{SERVER_NAME} =mailadmin.example.com
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
</IfModule>
I'm unaware what this /data means, and I can't find a folder of the sort. I don't see why I'm getting a 403 Forbidden.
The error says exactly what the problem is:
/data/www/mailadmin.example.com/html/public does not exist
create it!
Also, refer to the official documentation: https://github.com/postfixadmin/postfixadmin.
The guide is probably poorly written and inconsistent.

(Apache) Forbidden 403 when accessing subdomain

I want to set up the subdomain "shop" on my Apache 2.2 server on Windows/XAMPP and it redirects to "index.html" if I enter "shop.localhost" as the URL but once I try to connect via my domain "sv443.net" it redirects to my document root ("/index.html" instead of "/shop/index.html"). Connecting to "sv443.net/shop/" works fine though and even redirects to "index.html".
I'm using Cloudflare to handle the DNS stuff and added these records (I cut off the IP address part):
This is my httpd-vhosts.conf:
NameVirtualHost localhost:80
<VirtualHost localhost:80>
ServerName localhost
ServerAdmin sven.fehler#web.de
DocumentRoot "c:/users/sv443/desktop/mamp htdocs"
<Directory "c:/users/sv443/desktop/mamp htdocs">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost shop.localhost:80>
ServerName shop.localhost
ServerAdmin sven.fehler#web.de
DocumentRoot "c:/users/sv443/desktop/mamp htdocs/shop"
<Directory "c:/users/sv443/desktop/mamp htdocs/shop">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
And this is my hosts.dat:
(only comments)
2.205.169.73 sv443.net
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 localhost shop.localhost
Also I added this .htaccess file to the shop directory to redirect to the index.html if a 403 or 404 is encountered - removing this file doesn't fix my problem:
ErrorDocument 403 /shop/index.html
ErrorDocument 404 /shop/index.html
If someone tries to connect I get this error message in the Apache error.log:
AH01630: client denied by server configuration: C:/Users/Sv443/Desktop/MAMP htdocs/shop/.html
Thanks for any help!
If you can get content by explicitly specifying "/index.html" but not with "/", you should add DirectoryIndex index.html in your configuration, after loading mod_dir. This will define the default file to look for when it is not specified.
For your VirtualHost:
<VirtualHost *:80>
ServerName localhost
ServerAlias www.example.com
ServerAlias example.com
LogLevel debug
CustomLog "logs/example_access_log" combined
ErrorLog "logs/example_error_log"
[... REST OF CONFIGURATION ...]
</VirtualHost>
<VirtualHost *:80>
ServerName shop.localhost
ServerAlias shop.example.com
LogLevel debug
CustomLog "logs/shop_access_log" combined
ErrorLog "logs/shop_error_log"
[... REST OF CONFIGURATION ...]
</VirtualHost>
Apache decides which VirtualHost to use for the request based on the domain in the request. If it does not find a match, it uses the first one in the file (here localhost). Therefore you are not pointing to your "shop" sub-domain, unless you specify it in the VirtualHost for it, via ServerAlias ....

apache 2.4 - deny direct ip access and show custom error page

I want requests to http://example.com to serve my website, and requests to http://123.123.123.123 to show a customized 403 error page.
I have Apache/2.4.29 running on my Ubuntu server.
/etc/apache2/sites-available/vhosts.conf
<VirtualHost *:80>
ServerName default
<Location />
Require all denied
</Location>
</VirtualHost>
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/html
<Directory /var/www/html>
Options None
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
/etc/apache2/conf-available/security.conf
Alias /errors/ "/var/www/html/error-pages/"
ErrorDocument 401 /errors/401.php
ErrorDocument 403 /errors/403.php
ErrorDocument 404 /errors/404.php
ErrorDocument 500 /errors/500.php
<Directory /var/www/html/error-pages>
Require all granted
</Directory>
With the above setup direct-ip access is blocked, however it is not showing my custom error page.
Forbidden You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to
use an ErrorDocument to handle the request.
Then I tried using the directive instead of :
<VirtualHost *:80>
ServerName default
<Directory />
Require all denied
</Directory>
</VirtualHost>
Now all subdirectories (e.g. http://123.123.123.123/sub) show my error page, but unfortunately the root is not blocked at all and showing my index.php page.
My next guess was to experiment with wilcards:
<VirtualHost *:80>
ServerName default
<Location "/*">
Require all denied
</Location>
<Location "/*/">
Require all denied
</Location>
</VirtualHost>
This code works, and shows my own 403 error page on the root aswell all the subdirectories.
All this got me confused!
Is the how it should be done, or am I doing something wrong in the first two examples?
<VirtualHost _default_:80>
<Directory "${SRVROOT}/htdocs">
Require all denied
</Directory>
ErrorDocument 403 "Sorry, direct IP access not allowed."
ErrorLog "${SRVROOT}/logs/default-http-error.log"
CustomLog "${SRVROOT}/logs/default-http-access.log" combined
</VirtualHost>
This is what I have setup in my server where the directory directive is to denied access to all files in this virtualhost. And the errordocument 403 serving as a message. Other syntax are for error logging. Make sure this virtual host is before any other virtualhost. Something similar for the HTTPS scheme if you support HTTPS on your server.

WAMP Using PostgreSQL + Drupal 7 + Multisite + CleanURLs - Not working

As the title suggests I am trying to run multiple local development sites on WAMP using Postgresql...I have tried so many combinations and none work.
I have 3 sites that correspond to live productions sites so clean-urls is key...
site1.example.com
site2.example.com
site3.example.com
I installed Drupal7 in a local folder on my harddrive at c:\CM\Web\fooproject
I created a hard-link in WAMP at c:\wamp\www\fooproject to c:\CM\Web\fooproject
I edited "sites.php" in the drupal fooproject\sites directory to look like below:
$sites['localhost.site1.example.com'] = 'site1.example.com';
$sites['localhost.site2.example.com'] = 'site2.example.com';
$sites['localhost.site3.example.com'] = 'site3.example.com';
I added the following to my local PCs hosts file:
127.0.0.1 localhost.site1.example.com
127.0.0.1 localhost.site2.example.com
127.0.0.1 localhost.site3.example.com
I connect to the sites in the browser, e.g. - for site1 at:
"http://localhost/site1.example.com"
I created a database in PostgreSQL called "site1drupal"
I enabled the rewrite module in WAMP
Alias /site1.example.com "c:/wamp/www/fooproject/"
<Directory "c:/wamp/www/fooproject/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
I edited the ".htaccess" file in the drupal directory c:/wamp/www/fooproject/ to rewrite the base directory as follows:
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
RewriteBase /fooproject
I edited the httpd.conf file on WAMP Apache --> http.conf to include the Virtual hosts directory:
<VirtualHost *:80>
ServerAdmin site1#dummy-host.example.com
DocumentRoot "c:/wamp/www/fooproject/"
ServerName site1.example.com
ServerAlias localhost.site1.example.com
ErrorLog "c:/wamp/logs/site1-error.log"
CustomLog "c:/wamp/logs/site1-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin site2#dummy-host.example.com
DocumentRoot "c:/wamp/www/fooproject/"
ServerName site2.example.com
ServerAlias localhost.site2.example.com
ErrorLog "c:/wamp/logs/site2-error.log"
CustomLog "c:/wamp/logs/site2-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin site1#dummy-host.example.com
DocumentRoot "c:/wamp/www/fooproject/"
ServerName site1.example.com
ServerAlias localhost.site1.example.com
ErrorLog "c:/wamp/logs/site1-error.log"
CustomLog "c:/wamp/logs/site1-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin site3#dummy-host.example.com
DocumentRoot "c:/wamp/www/fooproject/"
ServerName site3.example.com
ServerAlias localhost.site3.example.com
ErrorLog "c:/wamp/logs/site3-error.log"
CustomLog "c:/wamp/logs/site3-access.log" common
</VirtualHost>
I copied the "default" folder in the sites directory and created 3 new folders called "site1.example.com", "site2.example.com" and "site3.example.com"
I am able to install the site fine and navigate to localhost/site1.example.com/?q=admin/config/search/clean-urls and enable clean urls
BUT the result is that it takes me to an "Internal Server error" page if I click link outside of the homepage :(
The error log says the following:
[Thu Feb 13 17:56:14.108803 2014] [core:error] [pid 5268:tid 1636] [client 127.0.0.1:57100] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://localhost/site1.example.com/
[Thu Feb 13 17:56:14.109805 2014] [core:debug] [pid 5268:tid 1636] core.c(3518): [client 127.0.0.1:57100] AH00122: redirected from r->uri = /site1.example.com/admin/config, referer: http://localhost/site1.example.com/
I am sure it is a simple fix but I just can't see it ..too many moving parts. Any help would be appreciated :D
Okay I figured this out ...
1st) I needed to remove the aliases I created using WAMP because they were only good if I had multiple INSTALLS of drupal (like testing different versions) ..have nothing to do with Multiple sites!
2) You set-up Vhosts for each site using the actual site name... e.g.
ServerName = site1.example.com
3) You edit the sites.php file to link what you put in your web-browser (localhost.site1.mwdworks.com => site1.mwdworks.com)
4) You add in your computer hosts file the site name you will put in the web-browser (for local development purposes - this can be any name as long as it matches what you put in sites.php ...)
e.g.
127.0.0.1 localhost.site1.example.com
and viola ...this all works well ...just follows these instructions and you are good)

Apache virtualhost 403

I'm stuck on this 403 problem. I set up virtual host for apache on ubuntu, and when I access the site, it returns 403.
/etc/apache2/site-available/os.solesschong.com
<VirtualHost *>
DocumentRoot /root/mysoft/sns
ServerName oa.solesschong.com
ErrorLog ${APACHE_LOG_DIR}/oa.solesschong.com-error.log
CustomLog ${APACHE_LOG_DIR}/oa.solesschong.com-access.log combined
<Directory /root/mysoft/sns>
Allow from all
</Directory>
</VirtualHost>
# a2enable oa.solesschong.com
file
root/mysoft/sns/index.php
DNS
oa.solesschong.com A-record: [IP of my server]
browser return
Forbidden
You don't have permission to access / on this server.
Apache/2.2.22 (Ubuntu) Server at oa.solesschong.com Port 80
Does the Apache process have permission access to read to /root/mysoft/sns/index.php?
Check your version of apache. If it is 2.4 then you need change alow configuration from
Allow from all
to
Require all granted