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: Setting up Apache on Windows
Author
IceBreaker



Joined: 23 Dec 2011
Posts: 2
Location: London

PostPosted: Fri 23 Dec '11 9:17    Post subject: Setting up Apache on Windows Reply with quote

Hi All,

I have been working with Apache and PHP for some years now, but this has mainly been in a Linux envrionment. Recently I've tried to install Apache (with SSL) on Windows 7... with no luck.

I want to have a Virtual Domain setup for two domain: fernsolutions.biz and shebaweavers.com

Here is my hosts file:
Code:
127.0.0.1       localhost
127.0.0.1       fernsolutions.biz
127.0.0.1       shebaweavers.com


Here is my httpd.conf file:
Code:
ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"
Listen 80
ServerName localhost:80
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
Include conf/extra/httpd-vhosts.conf



Moderators note: removed unneeded config per forum rules


And here is my httpd-vhosts.conf file:
Code:
NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "C:/Websites/fernsolutions.biz/htdocs"
    ServerName fernsolutions.biz:80
    CustomLog "C:/Websites/fernsolutions.biz/access_log" common
    ErrorLog "C:/Websites/fernsolutions.biz/error_log"
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/Websites/shebaweavers.com/htdocs"
    ServerName shebaweavers.com:80
    CustomLog "C:/Websites/shebaweavers.com/access_log" common
    ErrorLog "C:/Websites/shebaweavers.com/error_log"
</VirtualHost>


However whenever I go to http://shebaweavers.com the default "It works" comes up and NOT the website I'm pointing too.

I have noticed that when I run the httpd -S I get the following:
Code:
httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.0.2 for ServerName
VirtualHost configuration:
Syntax OK


Any ideas?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 23 Dec '11 10:24    Post subject: Reply with quote

the error seems odd since localhost is the ServerName in the main config.

first vhost however:

<VirtualHost _default_:80>
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
</VirtualHost>

per "Main host goes away" section, tho not what most folks experience;
http://httpd.apache.org/docs/2.2/vhosts/name-based.html

The key words there are "first VirtualHost should be a duplicate of the main host"

_default_ is mentioned elsewhere and <Virtualhost *:80> would work as well.
Just first vhost has to be same location as main host (ServerName in httpd.conf). It becomes the default virtual host. If you added to your hostfile
127.0.0.1 junk.domain

and never configured any special place for that to go in Apache, http://junk.domain would end up showing what was at the _default_ location, in this case "It Works!"
Back to top
IceBreaker



Joined: 23 Dec 2011
Posts: 2
Location: London

PostPosted: Fri 23 Dec '11 21:52    Post subject: Reply with quote

Hi glsmith,

Sorry about including all the comments in the config file... should have really read the forum's rules on that. Embarassed

I've tried what you've suggested and now have added the following lines to my httpd-vhosts.conf file:
Code:
<VirtualHost _default_:80>
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
</VirtualHost>


I also tried it adding it like this:

Code:
<VirtualHost localhost:80>
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
</VirtualHost>


But sadly I still get the same error mentioned in the first post. Any ideas?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Fri 23 Dec '11 23:00    Post subject: Reply with quote

Maybe you can have a look at http://www.apachelounge.com/viewtopic.php?p=19692#19692

Steffen
Back to top


Reply to topic   Topic: Setting up Apache on Windows View previous topic :: View next topic
Post new topic   Forum Index -> Apache