0

before I created a specific virtual host for my main website

the logging in to the main IP address opened the apache default welcome page

but after creating this virtual host, the domain.com is working fine but the IP address opens the same contents of the domain.com

# /etc/httpd/conf.d/domain.com.conf

<VirtualHost *:80>
    ServerName www.domain.com
    ServerAlias domain.com
    DocumentRoot /var/www/domian.com/public_html
    ErrorLog /var/www/domian.com/error.log
    CustomLog /var/www/domian.com/requests.log combined
</VirtualHost>

I don't want to change the apache welcome page


update

I putted this code before the contents of my site virtual host to resolve the problem

<VirtualHost _default_:80>
    DocumentRoot /var/www/html
</VirtualHost>

1 Answer 1

2

Don't use _default_:80 that only has relevance when you have virtual hosts bound to different IP addresses, use *:80 instead.

The default virtual host (for a particular ip:port or *:port combination) is the first listed in the output of apachectl -S. Add the output of this command to your post if you wish further explanation.

1
  • Thanks a lot for helping and the good explanation, I've change the keyword "default" to "*"
    – Mostafa
    Dec 20, 2016 at 14:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .