VirtualHost - config file httpd-vhosts.conf not work
Posted: 24. November 2015 11:08
Hello,
I have install Xampp 5.6.14 on VPS Windows Server 2012 R2 Standard. I point ip to VPS with domain example.org and it work correct (load ok) but i want add more than one website on VPS so i config file httpd-vhosts.conf. But it dont work, it load website example.org and not load website i want.
Domain is example.com
IP is 123.123.123.123
Email is email@example.com
I have read http://httpd.apache.org/docs/2.4/vhosts/ but try config and not ok. I have stop and restart Apache and MySQL.
I try to config is:
Please help, thank you very much.
I have install Xampp 5.6.14 on VPS Windows Server 2012 R2 Standard. I point ip to VPS with domain example.org and it work correct (load ok) but i want add more than one website on VPS so i config file httpd-vhosts.conf. But it dont work, it load website example.org and not load website i want.
Domain is example.com
IP is 123.123.123.123
Email is email@example.com
I have read http://httpd.apache.org/docs/2.4/vhosts/ but try config and not ok. I have stop and restart Apache and MySQL.
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ##ServerName or ##ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host.example.com
##DocumentRoot "C:/xampp/htdocs/dummy-host.example.com"
##ServerName dummy-host.example.com
##ServerAlias http://www.dummy-host.example.com
##ErrorLog "logs/dummy-host.example.com-error.log"
##CustomLog "logs/dummy-host.example.com-access.log" common
##</VirtualHost>
##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com"
##ServerName dummy-host2.example.com
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
##</VirtualHost>
I try to config is:
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ##ServerName or ##ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host.example.com
##DocumentRoot "C:/xampp/htdocs/dummy-host.example.com"
##ServerName dummy-host.example.com
##ServerAlias http://www.dummy-host.example.com
##ErrorLog "logs/dummy-host.example.com-error.log"
##CustomLog "logs/dummy-host.example.com-access.log" common
##</VirtualHost>
##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com"
##ServerName dummy-host2.example.com
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
##</VirtualHost>
##<VirtualHost *:80>
##ServerAdmin email@example.com
##DocumentRoot "C:/xampp/htdocs/example"
##ServerName example.com
##ServerAlias http://www.example.com
##ErrorLog "logs/example.com-error.log"
##CustomLog "logs/example.com-access.log"
##</VirtualHost>
Please help, thank you very much.