Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Stuck on v-hosts |
|
Author |
|
NogNeetMachinaal
Joined: 16 Feb 2014 Posts: 9 Location: Netherlands
|
Posted: Sun 21 Dec '14 18:21 Post subject: Stuck on v-hosts |
|
|
Hi Everyone,
I'm stuck and running arround in circles in an attempt to get the virtual hosts running on a Windows machine with Apache 2.2.
Based on the examples in the file called httpd-vhosts.conf, I have added the following to this file:
Code: | # WLM - 2014dec21
# Add my own virtualhost config
#
<VirtualHost *:7771>
ServerName wlm4services.local.net
DocumentRoot "F:/My Documents/My Sites/WLM4Services/"
ErrorLog "logs/wlm4services-error.log"
CustomLog "logs/wlm4services-access.log" common
</VirtualHost>
<VirtualHost *:7772>
ServerName pentiumstopwatch.local.net
DocumentRoot "F:/My Documents/My Sites/PentiumStopwatch/"
ErrorLog "logs/pentiumstopwatch-error.log"
CustomLog "logs/pentiumstopwatch-access.log" common
</VirtualHost>
|
In addition, I have added both of the server names to the local hosts file of that Windows machine and both pointing to that very same Windows machine.
Starting the httpd.exe with -S shows:
Code: | VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:7771 wlm4services.local.net (C:/Program Files (x86)/System/Apache/conf/extra/httpd-vhosts.conf:39)
*:7772 pentiumstopwatch.local.net (C:/Program Files (x86)/System/Apache/conf/extra/httpd-vhosts.conf:46)
Syntax OK
|
So I guess this means syntax wise the config is ok.
However, when I try to access one of these sites, nothing happens.
In addition, both the error- and access logs are all empty; only the Apache error log has some messages about being started:
Code: | [Sun Dec 21 17:19:05 2014] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sun Dec 21 17:19:06 2014] [notice] Apache/2.2.29 (Win32) mod_ssl/2.2.29 OpenSSL/0.9.8zc PHP/5.4.35 configured -- resuming normal operations
[Sun Dec 21 17:19:06 2014] [notice] Server built: Sep 10 2014 11:58:36
[Sun Dec 21 17:19:06 2014] [notice] Parent: Created child process 3124
[Sun Dec 21 17:19:06 2014] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sun Dec 21 17:19:06 2014] [notice] Child 3124: Child process is running
[Sun Dec 21 17:19:06 2014] [notice] Child 3124: Acquired the start mutex.
[Sun Dec 21 17:19:06 2014] [notice] Child 3124: Starting 64 worker threads.
[Sun Dec 21 17:19:06 2014] [notice] Child 3124: Starting thread to listen on port 80.
|
Perhaps someone can help me with this?
What else could be wrong here?
Thanks - Will |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Sun 21 Dec '14 19:57 Post subject: |
|
|
Your Apache starts and listens on port 80, and your vhosts you have set to port 7771.
If you really want to use 7771, set in htpd.conf the Listen directive to 7771 . |
|
Back to top |
|
NogNeetMachinaal
Joined: 16 Feb 2014 Posts: 9 Location: Netherlands
|
Posted: Sun 21 Dec '14 20:20 Post subject: |
|
|
Thank you for the quick response.
But this is what it is supposed to be.
I'm trying to run different sites with different TCP ports on the same host.
I was already able to do this on an Ubuntu server. But somehow, that very same approach doesn't seem to work for the Windows server.
If I replace the asterisks with the IP address of the host it doesn't work.
When the TCP-ports are replaced with 80, the wrong pages are served. In that case, the access logs are filled and show "URL's" that are not what I was expecting:
Code: | 178.84.219.156 - - [21/Dec/2014:19:13:55 +0100] "GET /wlm4services/welcome/ HTTP/1.1" 404 6213
192.168.0.19 - - [21/Dec/2014:19:13:56 +0100] "GET /wp-content/plugins/bbpress/templates/default/css/bbpress.css?ver=2.5.4-5380 HTTP/1.1" 200 29830
192.168.0.19 - - [21/Dec/2014:19:13:56 +0100] "GET /wp-content/plugins/captcha/css/style.css?ver=4.0.1 HTTP/1.1" 200 1012
192.168.0.19 - - [21/Dec/2014:19:13:56 +0100] "GET /wp-content/themes/themify-corporate/style.css?ver=1.0.8 HTTP/1.1" 200 81639
|
I would expect something with http://wlm4services.local.net in it. So unless that expectation is wrong, I would say there is definitely something wrong in the config. However, I don't know what or where. |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Sun 21 Dec '14 20:28 Post subject: |
|
|
I do not see how this is related to wlm4services.local.net ?
Try:
Listen 80
Listen 7771
And add vhost(s) for your 80 sites:
<VirtualHost *:80>
What was the approach on Ubuntu ? |
|
Back to top |
|
NogNeetMachinaal
Joined: 16 Feb 2014 Posts: 9 Location: Netherlands
|
Posted: Sun 21 Dec '14 20:58 Post subject: |
|
|
To check if this is what you had in mind - below the content of the config file.
Quote: | Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName morpheus.local.net
DocumentRoot "F:/My Documents/My Sites/"
ErrorLog "logs/morpheus-error.log"
CustomLog "logs/morpheus-access.log" common
</VirtualHost>
Listen 7771
NameVirtualHost *:7771
<VirtualHost *:7771>
ServerName wlm4services.local.net
DocumentRoot "F:/My Documents/My Sites/WLM4Services/"
ErrorLog "logs/wlm4services-error.log"
CustomLog "logs/wlm4services-access.log" common
</VirtualHost>
Listen 7772
NameVirtualHost *:7772
<VirtualHost *:7772>
ServerName pentiumstopwatch.local.net
DocumentRoot "F:/My Documents/My Sites/PentiumStopwatch/"
ErrorLog "logs/pentiumstopwatch-error.log"
CustomLog "logs/pentiumstopwatch-access.log" common
</VirtualHost>
|
The FQDN of the host itself is called morpheus.local.net.
A basic html page is available in the document root being "F:/My Documents/My Sites".
The other 2 are Wordpress sites.The document root for those is one below - as shown in the config file.
Steffen wrote: | What was the approach on Ubuntu ? |
I added the VirtualHost sections to the same config file, added the host IP address to the local hosts file and of we go. |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Sun 21 Dec '14 21:12 Post subject: |
|
|
Yep, I should remove the Listen lines in the httpd.vhosts.conf, and add in the httpd.conf :
Listen 80
Listen 7771
... |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1266 Location: Amsterdam, NL, EU
|
Posted: Mon 22 Dec '14 19:26 Post subject: |
|
|
Do wlm4services.local.net & pentiumstopwatch.local.net point to the same IP-address as morpheus.local.net? If not, adjust your hosts file. |
|
Back to top |
|
NogNeetMachinaal
Joined: 16 Feb 2014 Posts: 9 Location: Netherlands
|
Posted: Thu 01 Jan '15 20:34 Post subject: |
|
|
Jan-E wrote: | Do wlm4services.local.net & pentiumstopwatch.local.net point to the same IP-address as morpheus.local.net? If not, adjust your hosts file. |
Yes they do point the same IP address.
However, these 2 are still not working.
In total, I have 5 virtual hosts configured. From these 5, there are 2 Wordpress sites. From the remaining 3, one is ownCloud and 2 are plain html pages used for starting some sys admin tasks.
The 2 Wordpress sites are both showing the same issue. Both do not show and redirect to some non existing page. Or better, the page exist but the assembly of the URL doesn't point to the real page. For PentiumStopwatch, this is: Code: | https://morpheus.local.netpentiumstopwatch/welcome/ | For the other one, this is: Code: | https://wlm4services.local.netwelcome/ |
Both virtual hosts show the correct hostname - the part that ends with local.net. I don't understand where the phrase behind that comes from.
When using Code: | morpheus.local.net/pentiumstopwatch | and Code: | morpheus.local.net/wlm4services | the right things are showing up.
Now I know this is a bit of a stretch here since it doesn't seem to be a problem coming from Apache. But still - perhaps there is somebody out there who is able to point me in the right direction for a fix.
Thank you - Will |
|
Back to top |
|
|
|
|
|
|