Solved

Adding virtual server to host multiple sites with Apache

Posted on 2004-09-07
7
209 Views
Last Modified: 2010-03-04
Hi guys,
I have a Windows 2003 server , running Apache 2.0.48
I am hosting a web site on Apache currently, and i want to add some other web sites.
I had the following entry in the config file first

<VirtualHost *:80>
    ServerAdmin administrator@xxx.com
    DocumentRoot "Z:/Apache/xxxx"
    ServerName something.xxx.com
    ErrorLog  "E:/Program Files/Apache Group/Apache2/logs/something.xxx.com-error_log"
    CustomLog "E:/Program Files/Apache Group/Apache2/logs/something.xxx.com-access_log" common
</VirtualHost>

Then i add the following lines myself for the second web site

<VirtualHost *:80>
    ServerAdmin administrator@xxx.com
    DocumentRoot "Z:/Apache/yyyy"
    ServerName Newsite.xxx.com
    ErrorLog  "E:/Program Files/Apache Group/Apache2/logs/Newsite.xxx.com-error_log"
    CustomLog "E:/Program Files/Apache Group/Apache2/logs/Newsite.xxx.com-access_log" common
</VirtualHost>

When i go to Newsite.xxx.com it takes me to the first web site,although i have specified the directory for the secon site as  "Z:/Apache/yyyy"

I would appreciate any help on this issue.
I should say that i have very little experience on Apache web server.

thanks





0
Comment
Question by:cakirfatih
  • 4
  • 3
7 Comments
 
LVL 15

Accepted Solution

by:
samri earned 500 total points
ID: 11999090
hi Cakirfatih,

When you had edited, and save the config file, did you restart apache service?

Do you have DNS configured for newsite.xxx.com. Chances is you may have -- otherwise, you would not get to the site at all!

Check your httpd.conf for "NameVirtualHost *", if it's commented, uncomment it, if it is not there add it (without quote).

Next, what is the exact URL that you typed in your web browser?  The reason is, Apache will attemp to match the Vhost based on HostHeader that the client sent (in Name virtual hosting).  This host header would be from the URL that you typed in the URL bar.

Next, if you got a chance, jump to Apache tutorial on VirtualHost.  Bunch of very useful info: http://httpd.apache.org/docs-2.0/vhosts/

HTH.
0
 

Author Comment

by:cakirfatih
ID: 11999170
I just restarted the Apache services. I did not restart it after i changed the config file.
Now i recive the following message when i go to my second site

Forbidden
You don't have permission to access / on this server.


--------------------------------------------------------------------------------

Apache/2.0.48 (Win32) PHP/4.3.4 Server at Newsite.xxx.com Port 80

I have a DNS entry for that host, i am sure about that
and the NameVirtualHost * is not commented in my config file
0
 
LVL 15

Assisted Solution

by:samri
samri earned 500 total points
ID: 11999231
hi Cakirfatih,

now we are seeing something different.

Try to add a file index.html in Z:/Apache/yyyy directory.  And see if you are getting something.

-- copy and paste this into the index.html
<html>
<head>
<title>newsite.xxx.com</title>
<body>
This is my new site
</body>
---

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:cakirfatih
ID: 11999394
I guess we are on the rigt track now.
When i change my default page, to index.html  i can view it now.

it used to be default.asp , and i have some include commend in this file.

how do i use includes in Apache server, what should be the correct extensions for active web pages in Apache

0
 
LVL 15

Expert Comment

by:samri
ID: 11999468
cakirfatih,

To have apache server asp pages, you would need to install modules that would let apache know how to handle ASP pages.

Apache::ASP module : http://www.apache-asp.org/

of Sun Chilisoft :  http://wwws.sun.com/software/chilisoft/index.html

some other modules could be found in Apache module directory.

http://modules.apache.org/search

cheers.
0
 

Author Comment

by:cakirfatih
ID: 11999908
Samri,

thanks a lot for your all help,
I checked that asp module thing, but it seemed a very complicated process to install it.

Do you know any easy way to install it to my Apache server, like an .exe file?
0
 
LVL 15

Expert Comment

by:samri
ID: 12005173
hi Chakirfatih,

I am not quite aware of any pre-packaged apache.  But my I would suspect that there  should be.  
I would post the link should I came across any.

Cheers.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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 …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now