Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2011
    Posts
    113
    Thanks
    9
    Thanked 1 Time in 1 Post

    Virtual Hosts not working....



    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.
    Last edited by Vernk; 12-14-2012 at 03:19 PM.

  • #2
    Regular Coder
    Join Date
    Sep 2012
    Posts
    100
    Thanks
    5
    Thanked 3 Times in 3 Posts
    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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •