CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Apache configuration (http://www.codingforums.com/forumdisplay.php?f=69)
-   -   Virtual Hosts not working.... (http://www.codingforums.com/showthread.php?t=284110)

Vernk 12-14-2012 04:10 AM

Virtual Hosts not working....
 
:mad:

I've been trying to get these damn virtual hosts to work for 4 hours and I can't figure it out... I got it working once and now it won't budge...
I'm trying to test 3 domains 2 subdomains and 1 domain..
All of the domains below just go to the test site..
Here are some screenshots and my setup..

http://gyazo.com/e6595c0d0c4a13fa4fdf5d674012fd7a

Code:

<VirtualHost 204.45.103.228:80>
DocumentRoot C:/xampp/htdocs/testsite
ServerName www.xtremetop100voter.com
</VirtualHost>

<VirtualHost 204.45.103.228:80>
DocumentRoot C:/xampp/htdocs/swiftcaptcha
ServerName www.captcha.swiftvoter.com
</VirtualHost>

<VirtualHost 204.45.103.228:80>
DocumentRoot C:/xampp/htdocs/swiftserver
ServerName www.server.swiftvoter.com
</VirtualHost>

I would also need a fallback page for incase there is no virtual host for it.

Ctechinfo 12-28-2012 06:36 AM

The one thing I noticed missing from your info was the ##NameVirtualHost *:80 line. Did that get unblocked?? The following is my vhosts file for a guide.

You also may have to ajust your host file in windows. I am using custom names versus IP's so I am not sure if an adjustment is infact needed.
Code:

#
# Virtual Hosts
#
# 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.2/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 postmaster@dummy-host.localhost
    ##DocumentRoot "C:/xampp/htdocs/dummy-host.localhost"
    ##ServerName dummy-host.localhost
    ##ServerAlias www.dummy-host.localhost
    ##ErrorLog "logs/dummy-host.localhost-error.log"
    ##CustomLog "logs/dummy-host.localhost-access.log" combined
##</VirtualHost>

##<VirtualHost *:80>
    ##ServerAdmin postmaster@dummy-host2.localhost
    ##DocumentRoot "C:/xampp/htdocs/dummy-host2.localhost"
    ##ServerName dummy-host2.localhost
    ##ServerAlias www.dummy-host2.localhost
    ##ErrorLog "logs/dummy-host2.localhost-error.log"
    ##CustomLog "logs/dummy-host2.localhost-access.log" combined
##</VirtualHost>

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin postmaster@dummy-host.localhost
    DocumentRoot "C:/xampp/htdocs/ctechinfo"
    ServerName domain1.localhost
    ServerAlias domain1.localhost
    ErrorLog "logs/domain1.localhost-error.log"
    CustomLog "logs/dummy-host.localhost-access.log" combined
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin postmaster@dummy-host2.localhost
    DocumentRoot "C:/xampp/htdocs/hydrocephalustalk"
    ServerName domain2.localhost
    ServerAlias domain2.localhost
    ErrorLog "logs/domain2.localhost-error.log"
    CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin postmaster@dummy-host.localhost
    DocumentRoot "C:/xampp/htdocs/timberindustryinformation"
    ServerName domain3.localhost
    ServerAlias domain3.localhost
    ErrorLog "logs/domain3.localhost-error.log"
    CustomLog "logs/domain3.localhost-access.log" combined
</VirtualHost>



All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.