Artyom
Artyom

Reputation: 3063

Apache virtualhost include

Connect the apache config files with the command:

include / usr / local / apache / conf / sites / *. conf

Create a file with two virtualhost.

<VirtualHost *>
    ServerAdmin [email protected]
    ServerName site.com
    ServerAlias site.com
    DocumentRoot "/var/www/pachko1/site.com"
</VirtualHost>
<VirtualHost *>
    ServerAdmin [email protected]
    ServerName site1.com
    ServerAlias site1.com
    DocumentRoot "/var/www/site1/site1.com"
</VirtualHost>

But when accessing site1.com always opens a folder of site.com.

If they are interchanged, when referring to site.com will open site1.com

Always works feather rule, why is this happening?

Sorry for my English.

Upvotes: 3

Views: 1105

Answers (1)

Pekka
Pekka

Reputation: 449613

Try adding NameVirtualHost directives:

NameVirtualHost site.com
NameVirtualHost site1.com

and then add the actual host names to the VirtualHost directives:

<VirtualHost site.com>
...
<VirtualHost site1.com>

Upvotes: 6

Related Questions