Solved

virtual host

Posted on 2001-08-30
5
319 Views
Last Modified: 2013-11-18
my web server is apache 1.3.19 running on RH 7.1

I have setup two name based virtual host and disable the global directive e.g. documentroot, servername

abc.com is the original default domain before adding two new virtual host

xyz.com and mydomain.com is new virtual host

but I found that when I access http://abc.com it will display the web content of the first virtual host ie xyz.com

my httpd.conf is something like that

Include /etc/httpd/conf/xyz.com.conf
Include /etc/httpd/conf/mydomain.com.conf





0
Comment
Question by:adrianmak
5 Comments
 
LVL 1

Accepted Solution

by:
larry718 earned 20 total points
ID: 6452052
Try this, I've got this to work on my machine:

I am a newbie at this and here's what I did to get virtualhost of 2 domain names working:

From a new apache 1.3.20 httpd.conf setting:

#NameVirtualHost *

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
========================================
so you change this to:

NameVirtualHost *

<VirtualHost *>
    ServerAdmin webmaster@abc.com
    DocumentRoot /usr/local/apache/htdocs/www/abc
    ServerName www.abc.com
    ErrorLog /usr/local/apache/logs/abc.com-error_log
    CustomLog /usr/local/apache/logs/abc.com-access_log common
</VirtualHost>

<VirtualHost *>
    ServerAdmin webmaster@mydomain.com
    DocumentRoot /www/docs/mydomain.com
    ServerName www.mydomain.com
    ErrorLog /usr/local/apache/logs/mydomain.com-error_log
    CustomLog /usr/local/apache/logs/mydomain.com-access_log common
</VirtualHost>
=============================================
make sure you create directories within the htdocs/www & htdocs/logs for these 2 domain names.  
also
> ./apachectl configtest
before you
> ./apachectl start

Good Luck! =)
0
 
LVL 1

Expert Comment

by:larry718
ID: 6452059
oops, i've double check, i actually got apache 1.3.19.
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 6474078
Very easy.  Once again, I will not reveal it to you.

Clean up your question history (over 70 open questions), kick up the points, and maybe folks will start answering your questions.  

I know this is not the first time I have bugged you about this problem, which only seems to have gotten worse.

Please clean up your act.

-Jon
0
 
LVL 3

Expert Comment

by:modder
ID: 6511918
adrianmak's account has been closed for refusing to provide feedback even after being reminded.

Please advise as to who should get points for this.

modder
Community Support
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6836865
This question appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, you must tell the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below, include the question QID/link.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this Help Desk link for Member Guidelines, Member Agreement and the Question/Answer process:  Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues.
http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.11983658.html
http://www.experts-exchange.com/questions/Q.20036627.html
http://www.experts-exchange.com/questions/Q.20086927.html
http://www.experts-exchange.com/questions/Q.20038026.html
http://www.experts-exchange.com/questions/Q.20115179.html
http://www.experts-exchange.com/questions/Q.20137648.html
http://www.experts-exchange.com/questions/Q.20142044.html
http://www.experts-exchange.com/questions/Q.20146117.html
http://www.experts-exchange.com/questions/Q.20145507.html
http://www.experts-exchange.com/questions/Q.20151134.html
http://www.experts-exchange.com/questions/Q.20151223.html
http://www.experts-exchange.com/questions/Q.20176702.html
http://www.experts-exchange.com/questions/Q.20180730.html


PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:
 
Please leave any comments regarding this question here on closing recommendations if this item remains inactive another three days.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange


P.S.  For year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 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

19 Experts available now in Live!

Get 1:1 Help Now