Solved

Adding virtual server to host multiple sites with Apache

Posted on 2004-09-07
7
216 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
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 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