LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-29-2003, 02:37 PM   #1
quozt
Member
 
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...

Dom
 
Old 07-29-2003, 03:13 PM   #2
Mathieu
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.
http://www.linuxquestions.org/questi...threadid=74985

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
jpbarto
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:
my.server.com (with ip 192.168.0.5)

and you want to have two more servers:
her.server.com and
store.server.com (both with the same ip (on the same box))

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

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

hope that helps,
jpbarto

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
elhombre
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 www.site2.com, it will bring up www.site1.com 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
ServerName www.site1.com
# ServerSignature email
DirectoryIndex index.php site1 index.html index.htm index.shtml
# ServerSignature email
# LogLevel debug
# HostNameLookups off
</VirtualHost>

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

<Directory "/">
Options FollowSymLinks
AllowOverride None
</Directory>

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

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

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

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:24 AM.

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
Open Source Consulting | Domain Registration