VirtualHost - config file httpd-vhosts.conf not work

Problems with the Windows version of XAMPP, questions, comments, and anything related.

VirtualHost - config file httpd-vhosts.conf not work

Postby marshallfey » 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 filmeveryyear.com 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 filmeveryyear.com and not load website i want.
Domain is usinfoculture.com
IP is 158.69.223.163
Email is filmeveryyear@usinfoculture.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 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 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 filmeveryyear@usinfoculture.com
##DocumentRoot "C:/xampp/htdocs/usinfoculture"
##ServerName usinfoculture.com
##ServerAlias www.usinfoculture.com
##ErrorLog "logs/usinfoculture.com-error.log"
##CustomLog "logs/usinfoculture.com-access.log"
##</VirtualHost>




Please help, thank you very much.
marshallfey
 
Posts: 4
Joined: 24. November 2015 10:36
Operating System: Windows Server 2012 R2

Re: VirtualHost - config file httpd-vhosts.conf not work

Postby Nobbie » 24. November 2015 11:33

If you do not remove all leading "#" in your rows, your config contains only comments. Only rows without '#' in the beginning are recognized.
Also look into httpd.conf, if httpd-vhosts.conf is really included (and not commented out, again via "#" in the beginning).

And: if you define at least only one VirtualHost, all external (not VirtualHosts) declarations of ServerName, DocumentRoot etc. are ignored! That means, if you define a VirtualHost for your usinfoculture.com, you *should* also declare a VirtualHost for "localhost", otherwise you wont have any localhost anymore (it would yield to usinfoculture.com instead).
Nobbie
 
Posts: 8779
Joined: 09. March 2008 13:04

Re: VirtualHost - config file httpd-vhosts.conf not work

Postby marshallfey » 24. November 2015 12:01

I have remove ##
<VirtualHost *:80>
ServerAdmin filmeveryyear@usinfoculture.com
DocumentRoot "C:/xampp/htdocs/usinfoculture"
ServerName usinfoculture.com
ErrorLog "logs/usinfoculture.com-error.log"
CustomLog "logs/usinfoculture.com-access.log"
</VirtualHost>
and then i stop Apache and MySQL and start it again is: Apache not ok
11:58:17 AM [Apache] Attempting to stop Apache (PID: 1612)
11:58:17 AM [Apache] Attempting to stop Apache (PID: 2500)
11:58:17 AM [Apache] Status change detected: stopped
11:58:19 AM [mysql] Attempting to stop MySQL app...
11:58:19 AM [mysql] Status change detected: stopped
11:58:22 AM [Apache] Attempting to start Apache app...
11:58:26 AM [mysql] Attempting to start MySQL app...
11:58:26 AM [mysql] Status change detected: running
11:58:30 AM [Apache] Attempting to start Apache app...
11:58:31 AM [Apache] Status change detected: running
11:58:31 AM [Apache] Status change detected: stopped
11:58:31 AM [Apache] Error: Apache shutdown unexpectedly.
11:58:31 AM [Apache] This may be due to a blocked port, missing dependencies,
11:58:31 AM [Apache] improper privileges, a crash, or a shutdown by another method.
11:58:31 AM [Apache] Press the Logs button to view error logs and check
11:58:31 AM [Apache] the Windows Event Viewer for more clues
11:58:31 AM [Apache] If you need more help, copy and post this
11:58:31 AM [Apache] entire log window on the forums

, and MySQL ok. So i have backup file httpd-vhosts.conf first and copy replace (C:\xampp\apache\conf\extra\httpd-vhosts.conf) and start Apache and MySQL again and result is all ok.
11:58:22 AM [Apache] Attempting to start Apache app...
11:58:26 AM [mysql] Attempting to start MySQL app...
11:58:26 AM [mysql] Status change detected: running
11:58:30 AM [Apache] Attempting to start Apache app...
11:58:31 AM [Apache] Status change detected: running
11:58:31 AM [Apache] Status change detected: stopped
11:58:31 AM [Apache] Error: Apache shutdown unexpectedly.
11:58:31 AM [Apache] This may be due to a blocked port, missing dependencies,
11:58:31 AM [Apache] improper privileges, a crash, or a shutdown by another method.
11:58:31 AM [Apache] Press the Logs button to view error logs and check
11:58:31 AM [Apache] the Windows Event Viewer for more clues
11:58:31 AM [Apache] If you need more help, copy and post this
11:58:31 AM [Apache] entire log window on the forums
12:01:38 PM [mysql] Attempting to stop MySQL app...
12:01:38 PM [mysql] Status change detected: stopped
12:01:39 PM [Apache] Attempting to start Apache app...
12:01:39 PM [Apache] Status change detected: running
12:01:42 PM [mysql] Attempting to start MySQL app...
12:01:42 PM [mysql] Status change detected: running


Please help me slove problem. Thank you.
marshallfey
 
Posts: 4
Joined: 24. November 2015 10:36
Operating System: Windows Server 2012 R2

Re: VirtualHost - config file httpd-vhosts.conf not work

Postby Nobbie » 24. November 2015 15:15

Look into the error log, you made any kind of error in your Virtualhost declaration.
Nobbie
 
Posts: 8779
Joined: 09. March 2008 13:04

Re: VirtualHost - config file httpd-vhosts.conf not work

Postby marshallfey » 24. November 2015 15:47

Error log is here, please view it and help me, thank you. Error log: http://filmeveryyear.com/download/error.log .
marshallfey
 
Posts: 4
Joined: 24. November 2015 10:36
Operating System: Windows Server 2012 R2

Re: VirtualHost - config file httpd-vhosts.conf not work

Postby Nobbie » 24. November 2015 17:07

Its the wrong error log, you need the error log from the VirtualHost usinfoculture.com

P.S.: usinfoculture.com is up and running - what are you doing there? And why dont you know anything about Apache configuration? This board is not meant for teaching Apache, it is meant for technical problems with Xampp (for Windows). You should read tutorials and documentation about Apache configuration, if you are unsure how to configure Apache. It is a pain for me to debug your configuration remotely.
Nobbie
 
Posts: 8779
Joined: 09. March 2008 13:04

Re: VirtualHost - config file httpd-vhosts.conf not work

Postby marshallfey » 24. November 2015 18:12

I have 2 domain and i point to one ip vps same last time i use Xampp. Last time with old Xampp version i can run 2 website on one ip vps. Thank for support to me, maybe i run one website on vps. It's ok.
marshallfey
 
Posts: 4
Joined: 24. November 2015 10:36
Operating System: Windows Server 2012 R2


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 59 guests