Solved

Adding virtual server to host multiple sites with Apache

Posted on 2004-09-07
7
219 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
[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
  • 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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 …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

636 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