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>
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.