logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: adding a third name based virtual host not working
Author
nyteshade



Joined: 10 Mar 2010
Posts: 8
Location: ohio

PostPosted: Sun 20 Mar '11 0:49    Post subject: adding a third name based virtual host not working Reply with quote

I am trying to add a third virtual host but when I point my browser at it then it returns 'server not found + Firefox can't find the server at rcsDOTopencartDOTcom'. Localhost and rcs.meinsandkasten.com still work just fine. I've tried a bunch of things but nothing works. Any help much appreciated.
Code:


NameVirtualHost *:80

<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
  Options Includes
  AllowOverride
  Order Deny,Allow
  Allow from all
</Directory>

<Directory "C:/vHosts/rcs.meinsandkasten.com/web">
  Options Includes
  AllowOverride 
  Order Deny,Allow
  Allow from all
</Directory>

<Directory "C:/vHosts/rcs.opencart.com/web">
  Options Includes
  AllowOverride 
  Order Deny,Allow
  Allow from all
</Directory>


<VirtualHost *:80>
  DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
  ServerName localhost
  ErrorLog "logs/localhost-error.log"
  CustomLog "logs/localhost-access.log" common
</VirtualHost>

<VirtualHost *:80>
  DocumentRoot "C:/vHosts/rcs.meinsandkasten.com/web"
  ServerName rcs.meinsandkasten.com
  ErrorLog "logs/rcs.meinsandkasten.com-error.log"
  CustomLog "logs/rcs.meinsandkasten.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
  DocumentRoot "C:/vHosts/rcs.opencart.com/web"
  ServerName rcs.opencart.com
  ErrorLog "logs/rcs.opencart.com-error.log"
  CustomLog "logs/rcs.opencart.com-access.log" common
</VirtualHost>
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7407
Location: EU, Germany, Next to Hamburg

PostPosted: Sun 20 Mar '11 3:39    Post subject: Reply with quote

what is the output from httpd -S ?

Did you update your hosts file or do your work with a DNS server?
Back to top
nyteshade



Joined: 10 Mar 2010
Posts: 8
Location: ohio

PostPosted: Sun 20 Mar '11 13:47    Post subject: james blond Reply with quote

Thanks for the reply. My host file reflects the lines:
Code:

127.0.0.1   rcs.meinsandkasten.com
127.0.0.1   rcs.opencart.com


Ran httpd.exe -S that generated:
Quote:
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.2 for ServerName
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server localhost (C:/Program Files/Apache.../conf/extra/httpd-vhosts.conf:44)
port 80 namevhost localhost (C:/Program Files/Apache.../conf/extra/httpd-vhosts.conf:44)
port 80 namevhost rcs.meinsandkasten.com (C:/Program Files/Apache.../httpd-vhosts.conf:51)
port 80 namevhost rcs.opencart.com (C:/Program Files/Apache... /httpd-vhosts.conf:58 )
Syntax OK


Regarding DNS, well, I am using a switch and router attached to a cable modem in my home, and I do vaguely remember setting up something on the router but not sure about DNS. Guess I could log into it and check? I do have a sneaky suspicion that the 192.168.1.2 is clue to this problem, hmmmm, ya think? I'm not a network or apache guru though, obviously.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7407
Location: EU, Germany, Next to Hamburg

PostPosted: Sun 20 Mar '11 20:34    Post subject: Reply with quote

You have a
Code:

Listen 192.168.1.2:80

?
Back to top
nyteshade



Joined: 10 Mar 2010
Posts: 8
Location: ohio

PostPosted: Sun 20 Mar '11 22:57    Post subject: james blond Reply with quote

I have the following line in httpd.conf:
Code:
Listen 80
I understand that tells apache what port to listen to for http request. When I enter your suggestion:
Code:
Listen 192.168.1.2:80
alone or in conjunction with the initial line then apache will not start?
Back to top
nyteshade



Joined: 10 Mar 2010
Posts: 8
Location: ohio

PostPosted: Mon 21 Mar '11 0:48    Post subject: jame blond Reply with quote

My earlier try failed because I did not set the NameVirtualHost to the explicit IP address and Apache would not start. I have tried this with no luck either, Apache starts but none of the domains is reachable.
Code:
httpd.conf:
Listen 192.168.1.2:80

http-vhosts.conf:
NameVirtualHost 192.168.1.2:80

...and all virtual host containers in http-vhosts.conf have:
<VirtualHost 192.168.1.2:80>

Output from httpd.exe -S:
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.2 for ServerName
VirtualHost configuration:
192.168.1.2:80         is a NameVirtualHost
         default server localhost (C:/Program Files/Apache.../httpd-vhosts.conf:46)
         port 80 namevhost localhost (C:/Program Files/Apache../httpd-vhosts.conf:46)
         port 80 namevhost rcs.meinsandkasten.com (C:/Program Files/Apache.../httpd-vhosts.conf:53)
         port 80 namevhost rcs.opencart.com (C:/Program Files/Apache.../httpd-vhosts.conf:60)


This virtual hosting thing must be taboo. It looks easy but it must required alot of other things to be set perfectly.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7407
Location: EU, Germany, Next to Hamburg

PostPosted: Mon 21 Mar '11 2:33    Post subject: Reply with quote

Use

Listen 80
and
NameVirtualhost *:80


in httpd.conf add
Code:

ServerName localhost
Back to top
nyteshade



Joined: 10 Mar 2010
Posts: 8
Location: ohio

PostPosted: Mon 21 Mar '11 4:01    Post subject: james blond Reply with quote

I fixed my problem, this problem has plagued me for quite some time, seems like since I installed sp3. There was a hosts.TXT file in my etc directory, I must have saved it when MS changed the original file to read-only or some weirdness. Whenever I opened notepad as administrator then it was always the default file. I gave up on this problem months ago but since I need to install OpenCart I decided to take another stab at it. All is well now. Thanks for 'hanging in there' with a brother. Windows sucks sometimes, course if I was a bit more diligent.... peace.
Back to top


Reply to topic   Topic: adding a third name based virtual host not working View previous topic :: View next topic
Post new topic   Forum Index -> Apache