Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-08-2013, 11:12 AM   PM User | #1
Ctechinfo
New Coder

 
Join Date: Sep 2012
Posts: 88
Thanks: 3
Thanked 3 Times in 3 Posts
Ctechinfo is an unknown quantity at this point
Multiple vhosts 2 work/2 dont

The first two domains work as intended. The second two fallback to the first domains folder..

For instance if I put http://emachineupgraders.localhost/ into the address bar, the content for http://ctechinfo.localhost/ is displayed.

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.
#

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin postmaster@dummy-host.localhost
    DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/ctechinfoNEW"
    ServerName ctechinfo.localhost
    ServerAlias ctechinfo.localhost
    ErrorLog "logs/ctechinfo.localhost-error.log"
    CustomLog "logs/ctechinfo.localhost-access.log" combined
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin postmaster@dummy-host.localhost
    DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/dslwebserverNew"
    ServerName domain4.localhost
    ServerAlias dslwebserver.localhost
    ErrorLog "logs/domain4.localhost-error.log"
    CustomLog "logs/domain4.localhost-access.log" combined
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin postmaster@dummy-host.localhost
    DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/timberindustryinformationNEW"
    ServerName timberindustryinfo.localhost
    ServerAlias timberindustryinfo.localhost
    ErrorLog "logs/timberindustryinfo.localhost-error.log"
    CustomLog "logs/timberindustryinfo.localhost-access.log" combined
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin postmaster@dummy-host.localhost
    DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/emachineupgraders"
    ServerName emachineupgraders.localhost
    ServerAlias emachineupgraders.localhost
    ErrorLog "logs/emachineupgraders.localhost-error.log"
    CustomLog "logs/emachineupgraders.localhost-access.log" combined
</VirtualHost>
Ctechinfo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:53 AM.


Advertisement
Log in to turn off these ads.