0
votes

I have some problems with apache and virtual host. On my host i have 1 website runing, i want to create a subdomain for the forums.

When i go forum.domain.com it shows my main page, when i go to domain.com it also points to the main page.

<VirtualHost domain.com:80>
    DocumentRoot "C:\wamp\www"
    ServerName domain.com


    <Directory "C:\wamp\www">
        # AllowOverride All      # Deprecated
        # Order Allow,Deny       # Deprecated
        # Allow from all         # Deprecated

        # --New way of doing it
        Require all granted    
    </Directory>
</VirtualHost>

<VirtualHost forum.domain.com:80>
    DocumentRoot "C:\wamp\www\forum"
    ServerName forum.domain.com


    <Directory "C:\wamp\www\forum">
        # AllowOverride All      # Deprecated
        # Order Allow,Deny       # Deprecated
        # Allow from all         # Deprecated

        # --New way of doing it
        Require all granted    
    </Directory>
</VirtualHost>

I also added a 3 DNS A records to my domain, @, www and forum, they all point to my server IP

What am i doing wrong here ?

1

1 Answers

0
votes

Fixed it,

<VirtualHost domain.com:80>

changed to

<VirtualHost *:80>

For both the virtual hosts.