DocumentRoot remains the same, updated from Apache2 2.2.22 to 2.4.7


Keenora fluff ball

I do have the following question. I have moved some websites with the same hierarchy and site structure to a new server using Apache 2.4.7. The old one has 2.2.22. I have changed the default DocumentRoot to /var/www

For testing, I created an index.html file with a dot as content. Now, I do have a file in /sites-enabled/ with the following content:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/w2/shop2/website/magento
    ServerName test-w2.de
    ErrorLog /var/www/_logs/w2-error.log

<Directory /var/www/w2/shop2/website/magento>
    php_admin_flag safe_mode Off
    php_admin_value memory_limit 512M
    php_admin_value max_execution_time 600
    php_admin_value upload_max_filesize 128M
    php_admin_value open_basedir /var/www/w2/shop2/website/magento:/usr/:/tmp
    Options -Indexes +FollowSymLinks +Includes
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>

</VirtualHost>

That was a valid configuration on my old 2.2.22 Apache. Now when I try to enter the domain, it takes the dotted html file! If I try test-w2.de/w2/shop2/website/magento it goes to the correct directory but obviously doesn't work very well ;)

So it's like completely ignoring the DocumentRoot. What's wrong with this error.log says nothing, access.log apparently says it's serving index.html at /var/www. and there were no misconfigurations like when I restarted apache.

I also deleted sites-enabled/000-default.conf. The content was moved to apache2.conf which shows:

...
<Directory /var/www/>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride None
        Require all granted
</Directory>

Of course, before loading the /* that enables the site.

Keenora fluff ball

OK, I solved it. Two things; first the fact that the original apache2.conf was searching for *.conf files and mine just didn't have any extension. However, after that error occurs, the virtual host is still ignored. I have found,

Order deny,allow

and

Allow from all

Things have to be replaced with:

Require all granted

After that, the configuration is loaded. No errors even without warnings. But that's the problem, the whole conf file is just ignored.

Related


Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache2 wildcard not showing correct DocumentRoot

Quebec For some reason my apache2 server was showing me the contents of another virtual host instead of the wildcard virtual host. When I type hello.purecore.io, the apache2 server will show what is in api.purecore.io and show another folder. The virtualhost c

Apache: 2 SSL certificates, same DocumentRoot

Dusty Grist My website is configured apacheand now I'm trying to setup redirects correctly. My website uses wildcard SSL authentication and my ssl certificate covers *.mydomain.com. My certificate provider only covers one level of subdomains. My website URL is

Warning: DocumentRoot x does not exist when starting apache2

Jared Eitnier I cloned a rack server with some extra directories that /var/www/I don't want . I just want to delete unwanted websites on this server. I thought it would be as simple as deleting directories and all files in each directory. So I removed it all v

Warning: DocumentRoot x does not exist when starting apache2

Jared Eitnier I cloned a rack server with some extra directories that /var/www/I don't want . I just want to delete unwanted websites on this server. I thought it would be as simple as deleting directories and all files in each directory. So I removed it all v

Warning: DocumentRoot x does not exist when starting apache2

Jared Eitnier I cloned a rack server with some extra directories that /var/www/I don't want . I just want to delete unwanted websites on this server. I thought it would be as simple as deleting directories and all files in each directory. So I removed it all v

Nginx and apache2 on the same server

StudentMichal Wloga I have ubuntu 16.04 using nginx and apache2. There are 2 DNS A records pointing to this computer: app1.mydomain.com app2.mydomain.com I need app1.mydomain.com resolved by Apache and app2.mydomain.com resolved by nginx. Both are on port 80.

Apache2 deployed by stupid 4

AusiasMart: I've been trying to deploy my dumb 4 application to a local apache server. I want to be able to access my app via http://localhost/my_app/ . I have set the URL in the .env file: app.baseURL = 'http://localhost/my_app' Edit the .htaccess inside the

Apache2 deployed by stupid 4

AusiasMart: I've been trying to deploy my dumb 4 application to a local apache server. I want to be able to access my app via http://localhost/my_app/ . I have set the URL in the .env file: app.baseURL = 'http://localhost/my_app' Edit the .htaccess inside the

2 websites under the same IP apache2 configuration?

private I know there is a lot of documentation on this, but my question is different. I am running 2 websites (subdomains) on one apache2 server. Site 1 is running fine, site 2 is somehow linked to the apache2 directory /var/www So when I go to page 1, I see m

2 websites under the same IP apache2 configuration?

private I know there is a lot of documentation on this, but my question is different. I am running 2 websites (subdomains) on one apache2 server. Site 1 is running fine, site 2 is somehow linked to the apache2 directory /var/www So when I go to page 1, I see m

Start apache2 server from terminal

Mostafiz Ur Rahman I have installed LAMP stack on Ubuntu 14.04. Now I want to start apache2 server from terminal. Is there any command to do this? database Try to execute the following command $sudo service apache2 restart|stop|start Open a web browser and g

apache2 logging

that power Is there any chance that log messages from apache (V2.4) are written to journalctl/journald logs, not log files? (I've seen that Apache2.5 will have a mod_journald to allow this task) Ricky G. Custom logging can be set in httpd.conf. CustomLog "|/bi

apache2 logging

that power Is there any chance that log messages from apache (V2.4) are written to journalctl/journald logs, not log files? (I've seen that Apache2.5 will have a mod_journald to allow this task) Ricky G. Custom logging can be set in httpd.conf. CustomLog "|/bi

apache2 logging

that power Is there any chance that log messages from apache (V2.4) are written to journalctl/journald logs, not log files? (I've seen that Apache2.5 will have a mod_journald to allow this task) Ricky G. Custom logging can be set in httpd.conf. CustomLog "|/bi

RewriteRule on apache2

username I have a question about the Rewriterules . I want to redirect domain.xx/exampletodomain.xx/index.php?content=example This actually works, but I also have a file called example.php in the same folder ( domain.xx/example.php) . Whenever I open the domai