Hiren Shah
Hiren Shah

Reputation: 225

Apache2.4.11 virtualhostconfiguration is not working

I have tried the below code to point the domain name to specific directory into linux

NameVirtualHost *.80
<VirtualHost *:80>
     ServerName example.com
     DocumentRoot /var/www/html/example.com
</VirtualHost> 

but the above code is not working.

Upvotes: 1

Views: 44

Answers (2)

Ravi Gupta
Ravi Gupta

Reputation: 26

the above code is for apache2.2, so you just replace above code with

<VirtualHost *:80>
   ServerName     example.com
   ServerAlias    www.example.com
   ServerAdmin    [email protected]
   DocumentRoot   "/var/www/html/example.com"
   CustomLog      "/var/www/html/example.com/access_log" combined
   ErrorLog       "/var/www/html/example.com/error_log"
</VirtualHost>

Upvotes: 0

FranMercaes
FranMercaes

Reputation: 151

Did you run a2ensite exemple.com.conf? Restart apache after that.

Upvotes: 1

Related Questions