Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-29-2003, 02:37 PM   #1
Registered: Jul 2003
Location: Leeds
Distribution: Knoppix
Posts: 60

Rep: Reputation: 15
Apache Virtual Hosts

hi me again, right i want to set up a couple of websites on my server (using redhat 9 with all the apache stuff added) i have a thing called Apache Virtual Hosts installed and wondered how it worked at the moment my main host goes to localhost.. but i want to run several more websites (and muds) in different folders to be sent to different domains (eventually) is there an auto generation of those folders with the CGI-BIN and other items installed thanks for reading...

Old 07-29-2003, 03:13 PM   #2
Senior Member
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
No, you will have to setup the directory structure yourself.
If you want a GUI tool for Apache, you can try Webmin.

This thread has information on how to setup Virtual Hosts in Apache.

For your domains, you will need to configure a local DNS
or add the entries to /etc/hosts
Old 07-29-2003, 03:15 PM   #3
Senior Member
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
a virtual host allows apache to run multiple websites w/ one server.

lets say your main webserver is: (with ip

and you want to have two more servers: and (both with the same ip (on the same box))

by creating a virtual host you tell apache that when it sees a url of to provide content from a specific directory ... say /opt/my_server_com/http

now when someone types in an address of even though dns resolves to the same IP as apache will see the request as being for and serve content from the configured directory of say /opt/store_server_com

hope that helps,

P.S. /opt/store_server_com isn't a required dir name... content could be anywhere... /home/billy or /etc/website-2 ... it really doesn't matter. Also config directives in the virtual host can completely change the behavior of one website compared to another even though they are running on the same server.
Old 10-15-2003, 09:51 AM   #4
LQ Newbie
Registered: Oct 2003
Location: tx
Distribution: RH8 and SuSE9
Posts: 4

Rep: Reputation: 0
i have site1 on my RH8 system at this time and it works fine. i am trying to setup a virtual host for site2 but the problem is that when i (or anyone) goes to, it will bring up rather than going to the site2 folder where site2's index.html page is. what am i doing wrong?

this is the syntax i have in httpd.conf:

# Virtual host site1
<VirtualHost *>
DocumentRoot /var/www/html/site1
# ServerAdmin
# ServerSignature email
DirectoryIndex index.php site1 index.html index.htm index.shtml
# ServerSignature email
# LogLevel debug
# HostNameLookups off

# Virtual host site2
<VirtualHost *>
DocumentRoot /var/www/html/site2
# ServerAdmin
# ServerSignature email
DirectoryIndex index.html site2 index.php index.htm index.shtml
# ServerSignature email

<Directory "/">
Options FollowSymLinks
AllowOverride None

<Directory "/var/www/html">
Options Indexes Includes FollowSymLinks
AllowOverride None
Allow from from all
Order allow,deny

<Directory "/var/www/icons">
Options Indexes MultiViews
AllowOverride None
Allow from from all
Order allow,deny

<Directory "/var/www/cgi-bin">
Options ExecCGI
AllowOverride None
Allow from from all
Order allow,deny

Last edited by elhombre; 10-15-2003 at 10:22 AM.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 06:29 AM
Apache/Virtual Hosts Help C-Squared Linux - General 9 08-04-2003 12:45 PM
Apache Virtual Hosts (again) scatcat Linux - General 1 10-17-2002 09:51 AM
Apache: Virtual hosts pk21 Linux - Software 15 10-08-2002 05:08 PM
apache virtual hosts jonfa Linux - General 1 06-04-2002 01:50 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:05 AM.

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