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
Solved

Adding virtual server to host multiple sites with Apache

Posted on 2004-09-07
7
215 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mysql is corrupting stringified JSON object 11 56
How do Apache, PHP, and MySQL All Work Together? 6 130
Virtual host in apache 31 102
Redirect to catagorie in case of 404 4 23
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). #…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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