Solved

Apache config, 7 domains, 3 on one IP, 2 on another, 1 on the 3rd, and 1 on the 4th. (mutiple VirtualHosts over different IP's)

Posted on 2004-04-25
2
515 Views
Last Modified: 2010-03-04
Hello all. Appreciate your time in advance. Background.... Im running on win 2k3, apache 2.0.48. I am using 4 IP's for the server, and have had one domain on each ip and that was cool, but i need to add mutiple domains, each with its own folders. On another PC i have apache runnign and have used mutiple virtual hosts on one IP, but when i try and combine these two meathods i get errors.. Googling the topic i got a few ideas, but no "heres how its done" examples, so i am getting stuck. Below is what i have right now... When i start apache, the "DOS" window says open and it never says "apache started". Occasionally while trying different options i get some errors. Oddly some of the domains work, even though apache never says its started, however if i try and access "site1B" it just goes to the default install apache home page... "Seeing this instead of the website you expected?". I hope ive covered enough bases here to give you an idea whats going on.

The short version...i need 3 domains on 1 ip, 2 domains on ANOTHER ip, and 1 domain on a 2nd IP, and 1 on a 4th IP.

I guess i should point out that i'm trying to do this in 1 apache install. Also i want to restrict each domain to listen only on there assigned IP, but all using port 80. As a last resort, i guess i will go back and install 4 apache's, but id rather no do that if i dont have to. Thanks for your help.

NameVirtualHost 10.0.0.99

<VirtualHost 10.0.0.99>

      ServerAdmin webmaster@site1A.com
      DocumentRoot X:/websites/site1A.com/www
      ServerName www.site1A.com
      ServerAlias *.site1A.com
      
      CustomLog '|"X:/apache/Apache2/bin/rotatelogs.exe" "X:/websites/site1A.com/www/weblog/site1A.com-%y-%m-%d.log" 86400' combined

      # Turn on mod_deflate
      SetOutputFilter DEFLATE

</VirtualHost>

<VirtualHost 10.0.0.99>

      ServerAdmin webmaster@site1B.com
      DocumentRoot X:/websites/site1B.com/www
      ServerName www.site1B.com
      ServerAlias *.site1B.com
      ServerPath /site1B.com/www
      CustomLog '|"X:/apache/Apache2/bin/rotatelogs.exe" "X:/websites/site1B.com/www/weblog/site1B.com-%y-%m-%d.log" 86400' combined

      # Turn on mod_deflate
      SetOutputFilter DEFLATE

</VirtualHost>

<VirtualHost 10.0.0.99>

      ServerAdmin webmaster@site1C.com
      DocumentRoot X:/websites/site1C.com/www
      ServerName www.site1C.com
      ServerAlias *.site1C.com
      ServerPath /site1C.com/www
      CustomLog '|"X:/apache/Apache2/bin/rotatelogs.exe" "X:/websites/site1C.com/www/weblog/site1C.com-%y-%m-%d.log" 86400' combined

      # Turn on mod_deflate
      SetOutputFilter DEFLATE

</VirtualHost>


<VirtualHost 10.0.0.101>

      ServerAdmin webmaster@site2A.com
      DocumentRoot x:/websites/site2A.com/html
      ServerName www.site2A.com
      ServerAlias *.site2A.com
      ErrorLog logs/site2A.com-error_log
      TransferLog logs/site2A.com-access_log

</VirtualHost>


<VirtualHost 10.0.0.102>

      ServerAdmin webmaster@site3A.com
      ServerName wwww.site3A.com
      ServerAlias *.site3A.com *.alternate.com

      # Define docroot
      DocumentRoot x:/websites/stokesc/site3A.com/www

      # Set settings for docroot
      <Directory x:/websites/stokesc/site3A.com/www>
            Order Deny,Allow
            Allow from All
            # Allow settings to be overwritten through .htaccess files
            AllowOverRide AuthConfig Options
            # Enable directory browsing.
            Options +Indexes
            IndexOptions FancyIndexing FoldersFirst NameWidth=60 SuppressDescription IgnoreCase TrackModified
      </Directory>

      CustomLog '|"X:/apache/Apache2/bin/rotatelogs.exe" "X:/websites/stokesc/site3A.com/www/weblog/site3A.com-%y-%m-%d.log" 86400' combined
      
      # Turn on mod_deflate
      SetOutputFilter DEFLATE

</VirtualHost>


<VirtualHost 10.0.0.103>

      ServerAdmin webmaster@site4A.com
      DocumentRoot x:/websites/site4A.com/html
      ServerName www.site4A.com
      ServerAlias *.site4A.com

      CustomLog '|"X:/apache/Apache2/bin/rotatelogs.exe" "X:/websites/site4A.com/weblog/site4A.com-%y-%m-%d.log" 86400' combined

      # Turn on mod_deflate
      SetOutputFilter DEFLATE

</VirtualHost>
0
Comment
Question by:williarlr12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Mercantilum earned 63 total points
ID: 10916014
First of all, you need one NameVirtualHost for each IP

NameVirtualHost 10.0.0.99
NameVirtualHost 10.0.0.101
NameVirtualHost 10.0.0.102
NameVirtualHost 10.0.0.103

Once this is fixed, please start your server with the following option

apache -S
  or
httpd -S

in a command shell, (depending on the name of your exe)
This will show the virtual hosts configuration.
0
 
LVL 7

Assisted Solution

by:shahrial
shahrial earned 62 total points
ID: 10916788
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question