I
I
inetbug2013-02-06 16:30:36
Apache HTTP Server
inetbug, 2013-02-06 16:30:36

Subdomains not working

There is an example.com domain connected via a2ensite:

<VirtualHost *:80>
        ServerName example.com
        ServerAdmin [email protected]

        DocumentRoot /home/inetbug/www/example.com
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /home/inetbug/www/example.com/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

I wanted to make it so that when I go to subdomain.example.com Apache opens another directory:
<VirtualHost *:80>
        ServerName subdomain.example.com
        ServerAdmin [email protected]

        DocumentRoot /home/inetbug/www/subdomain
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /home/inetbug/www/subdomain/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

Again, I added this configuration via a2ensite, but it does not work - the address is not found by the browser. What obvious thing did I forget to add? Maybe problems with the domain itself?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Melkij, 2013-02-06
@inetbug

DNS returns IP for subdomain? It is checked by a banal subdomain ping.
Quite an obvious thing - they forgot to reload Apache.

D
d3ZORg, 2013-02-06
@d3ZORg

Somewhat little information.
What's in ns? Well, did Apache reboot? ;)

S
SergeyR, 2013-02-06
@SergeyR

You need to add ServerAlias ​​subdomain.example.com to your configuration

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question