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: Apache responds "It Works" but can not get Virtual
Author
Caps



Joined: 18 Nov 2010
Posts: 3

PostPosted: Thu 18 Nov '10 20:11    Post subject: Apache responds "It Works" but can not get Virtual Reply with quote

Apache is happy and gives me the "It Works" response. My virtualhost, I guess are not being used.

Here is what is coded within the httpp-vhost.conf: (mysite is replaced by the current domain)

<VirtualHost *:80>
ServerAdmin mymail@mysite.com
DocumentRoot "C:/www/mysite.com/htdocs"
ServerName mysite.com
ServerAlias www.mysite.com
ErrorLog "logs/mysite.com-error.log"
CustomLog "logs/mysite.com-access.log" common
</VirtualHost>

I've also used this:

<VirtualHost 10.10.2.220:80>
ServerAlias mysite.com *.mysite.com
ServerName www.mysite.com
DocumentRoot C:/www/www.mysite.com/htdocs
</VirtualHost>

DocumentRoot "C:/Program Files/Apache2.2/htdocs"

#DocumentRoot "C:/www"

(DocumentRoot is commented out - "c:/www/ are where the domains reside) example: c:/www/www.mysite.com


Will Appreciate any kind of help.
Back to top
glsmith
Moderator


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

PostPosted: Sat 20 Nov '10 3:25    Post subject: Reply with quote

1st vhost must be a duplicate of the main host configured in httpd.conf. You do not have to do the entire thing over, just enough to point at the main doc root

NameVirtualHosts *:80

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

# Add virtual hosts below
Back to top
Caps



Joined: 18 Nov 2010
Posts: 3

PostPosted: Sat 20 Nov '10 8:38    Post subject: Reply with quote

Hi glsmith,

I appreciate you showing me a more optimum way of setting up a virtualhost.

News Update, I can not use the VirtualHost function, if I do, apache will not start. I loaded the module:

LoadModule alias_module modules/mod_alias.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so

It seems as thought the viritualHost in brackets are not being recognized.

The results now is I can point to my custom directory and see my custom html file instead of using the default rootdirectory.

Any suggestions?
Back to top
Caps



Joined: 18 Nov 2010
Posts: 3

PostPosted: Sun 21 Nov '10 0:17    Post subject: Problem Solved Reply with quote

Had some extra characters Smile

Thank you
Back to top


Reply to topic   Topic: Apache responds "It Works" but can not get Virtual View previous topic :: View next topic
Post new topic   Forum Index -> Apache