Score:0

Apache2 - serves a subdirectory as root but now other sites in subdirectories are broken

ps flag

So I have a new tool installed on my webserver and it has a somewhat complicated folder structure, in order to get it to run, I put everything in a subdirectory and serve that as root of my domain.

The corresponding .conf

    <VirtualHost *:80>
    ServerName example.com
    DocumentRoot /var/www/html/example/public
    <Directory /var/www/html/example/public>
        AllowOverride All

       # Apache 2.2
        Order Allow,Deny
        Allow from All

        # Apache 2.4
        # Require all granted

        FallbackResource /index.php
    </Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

But now other sites that were served fine before are 404ing on me (the error message comes from the fresh hosted site.

So /var/www/html/example2 requested per http(s)://example.com/example2 isn't showing up anymore.

I'm the first to admit I am not very knowledgeable about Apache Configs, but there must be a way to solve this, any help is kindly regarded.

ws flag
"So /var/www/html/example2 requested per http(s)://example.com/example2" - but you've not shown us the config for that vhost.
tulekparson avatar
ps flag
As per now I have no .conf, I tried to make one, but without any success... (Tried an ALIAS), but I don't have that failing .conf anymore.
ws flag
If you can connect via SSL then you must have a vhost configuration.
tulekparson avatar
ps flag
Before I made the changes mentioned above I had a 000-default.conf with the root of the domain pointing to /var/www/html so all sites where served from that vhost. That's not working anymore because the domain root is pointing to /var/www/html/example I even tried copying /var/www/html/example2 to /var/www/html/example/example2 didn't work either, the script residing in [...]/example doesn't like that, I guess, because the 404 error I get is in the design and coloring of that script... Edit: Any pointers how a site.conf for subdirectories has to look?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.