Solved

Adding virtual server to host multiple sites with Apache

Posted on 2004-09-07
7
217 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 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