LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices



Reply
 
Search this Thread
Old 04-12-2006, 11:56 AM   #1
voip_tech_2004
LQ Newbie
 
Registered: Aug 2004
Posts: 18

Rep: Reputation: 0
apache and virtual host


have a question ...

in apache, there is default directory to put websites.. now if I was operating only one site, I would put stuff in DocumentRoot /var/www/html and all is well.. so lets say, I am hosting A sites there

Now, I want to put virtual host and put something in the new directory /var/virtualhost/html and made all th e config changes.... and hosting B sites....

Question is, if I want to host orginal sites and one virtual host site(A and B) do I need to move stuff over from /var/www/html and make it into another virtual host?
Another words, do I have to have A and B sites both in virtual host section now?
 
Old 04-12-2006, 12:36 PM   #2
voip_tech_2004
LQ Newbie
 
Registered: Aug 2004
Posts: 18

Original Poster
Rep: Reputation: 0
Obviously, below works, but I wanna know if this is the rite way to to it.. please let me know..

thanks.



#
NameVirtualHost 192.168.1.44:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# 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 192.168.1.44:80>
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes Includes
</Directory>
</VirtualHost>

<VirtualHost 192.168.1.44:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/virtual/www1.example.com/html
ServerName www1.example.com
ErrorLog logs/www1.example.com-error_log
CustomLog logs/www1.example.com-access_log combined
<Directory /var/www/virtual/www1.example.com/html>
Options Indexes Includes
</Directory>
</VirtualHost>




[root@d400-image conf]# lynx -dump guest1.example.com

yahooooooooooooooooooooooooooooooo

[root@d400-image conf]# lynx -dump www1.example.com

www1.example.com
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache - Name virtual host tisource Linux - Networking 5 03-03-2006 03:52 AM
Apache 2 Virtual host eckertc1 Linux - Software 6 03-22-2005 10:58 PM
Apache 2.0 Virtual Host? w0lfeyes Linux - Networking 1 05-03-2004 04:09 PM
apache and virtual host diverge Linux - Networking 2 01-11-2004 03:45 AM
apache virtual host mimi Linux - General 1 04-06-2002 06:11 AM


All times are GMT -5. The time now is 03:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration