[NTLUG:Discuss] Virtual Host in Apache (LONG)
Keith From
kfrom at cbssolutions.com
Thu Aug 26 13:53:24 CDT 1999
----- Original Message -----
From: MadHat <madhat at unspecific.com>
To: <discuss at ntlug.org>
Sent: Thursday, August 26, 1999 1:12 PM
Subject: Re: [NTLUG:Discuss] Virtual Host in Apache (LONG)
> Keith From wrote:
> >
> > ----- Original Message -----
> > From: MadHat <madhat at unspecific.com>
> > To: <discuss at ntlug.org>
> > Sent: Thursday, August 26, 1999 12:42 PM
> > Subject: Re: [NTLUG:Discuss] Virtual Host in Apache (LONG)
> >
> > > MadHat wrote:
> > > >
> > > > Keith From wrote:
> > > > > >
> > > >
> > > > You may want to look at
> > > > http://www.apache.org/docs/vhosts/index.html
> > > >
> > > > I will try to answer what I remember.
> > > >
> > > > >
> > > > > OK, this brings up another question about the "NameVirtualHost
> > > > > 209.223.22.92:80"
> > > > >
> > > > > If I were to have 5 sites going under Apache, would i need to do
> > > > > something like this????
> > > > >
> > > > > NameVirtualHost 209.223.22.92:80
> > > > > NameVirtualHost 209.223.22.93:80
> > > > > NameVirtualHost 209.223.22.94:80
> > > > > NameVirtualHost 209.223.22.95:80
> > > > > NameVirtualHost 209.223.22.96:80
> > > > >
> > > >
> > > > I haven't set it up this way before, with multiple NameVirtualHost
> > > > entries, but I think it will complain. If you are wanting to use
more
> > > > than 1 IP for multiple sets of virtual hosts, you may have to run
> > > > ddifferent instances of Apache. I know you have have 1 set of
virtual
> > > > hosts and the use IPs for other sites on the same apache, but not
> > > > multiple sets of VHs. I didn't see anything about it in the docs.
> > > >
> > >
> > > damn I can't type a complete sentence...
> > >
> > > OK, if you have 5 IPs and you want to have 5 domains, put them on
> > > seperate IPs, if you have 1 IP and 5 domains, use the NameVirtualHost
> > > and use the 1 IP for all 5. If you have say 2 IPs and you want 3
> > > domains on one IP and 2 on the other IP, you would have to use more
than
> > > one instance of httpd (apache). But if you just have 3 IPs and 5
> > > domains, you can have 1 domain point to the first IP, the next domain
> > > point to the next IP and have the last 3 domains point to the last IP
> > > (and use the NameVirtualHost on that IP) without running more than one
> > > instance of apache.
> > >
> > > Does that make sence? Or better yet, does that answer the
question/solve
> > > the problem?
> > >
> > > --
> > > MadHat
> > >
> > > _______________________________________________
> > > http://ntlug.org/mailman/listinfo/discuss
> > >
> > Yes, this makes sence. here is a copy of the httpd.conf file
> > that I am writing right now. I haven't tested it yet, but hopefully it
will
> > work. What do you think. Also, I guess i had better put all of
> > the AddModule lines and such back in.
>
> Only add the ones you find usefull. If you are not sure what they do,
> check the apache site. (I know I like spelling, the module, not the
> real thing)
>
> >
> > ####
> > # Configuration dumper for Comanche. It can be configured, so the .conf
is
> > human friendly
> > ####
> >
> > User webuser
> > Group webgroup
> >
> > #Timeout 300
> > #minspareservers 8
> > #maxspareservers 20
> > #startservers 10
> > #MaxClients 150
> > #maxrequestsperchild 100
>
> whith these commented out it will use the defaults. You can tweek the
> server by uncommenting them and changing them, but it depends on what
> type of content is being served to what setting will help.
>
> >
> > <VirtualHost 209.223.22.92>
> > ServerAdmin webmaster at mail.cbssolutions.com
> > DocumentRoot /files/www/cbs/pub/html
> > ServerName www.cbssolutions.com
> > ErrorLog /files/www/cbs/pub/logs/error_log
> > TransferLog /files/www/cbs/pub/logs/access_log
> > #<directory "/files/www/cbs/pub/html">
> > #Options Indexes Includes FollowSymLinks
> > #AllowOverride None
> > #order allow,deny
> > #allow from all
> > #</directory>
> > </Virtualhost>
>
> With the dir stuff commented out it will use the rights on the next dir
> defined above it, if there isn't one, it will go al the way back to /
> wich can cause some problems. Just depends on the content.
>
> >
> > <VirtualHost 209.223.22.93>
> > ServerAdmin webmaster at mail.cbssolution.com
> > DocumentRoot /files/www/testing/htdocs
> > Servername www.testing.com
> > ErrorLog /files/www/testing/logs/error_log
> > TransferLog /files/www/testing/logs/access_log
> > </VirtualHost>
>
> Should work.
>
>
> NOTE: add a line to the virtualhost stuff like this:
>
> ServerAlias testing.com www.testing.com this.is.testing.com
>
> that way is you point www and just testing.com to the same IP they will
> go to the same site, otherwise it will go to the default site. The last
> entry is just to show you can add as many aliases as you want.
>
> This is what one of mine looks like.
>
> <VirtualHost 206.190.46.20>
> ServerAdmin lheath at broadcast.com
> DocumentRoot /usr/local/virtual/danielash.org/www
> ServerName danielash.org
> ServerAlias danielash.org www.danielash.org
> ErrorLog "|/usr/local/apache/bin/rotatelogs
> /usr/local/virtual/danielash.org
> /logs/error_log 86400"
> CustomLog "|/usr/local/apache/bin/rotatelogs
> /usr/local/virtual/danielash.or
> g/logs/access_log 86400" common
> ScriptAlias /cgi-bin/ "/usr/local/virtual/danielash.org/cgi-bin/"
> <Directory "/usr/local/virtual/danielash.org/www">
> AllowOverride AuthConfig
> </Directory>
> <Directory "/usr/local/virtual/danielash.org/cgi-bin">
> AllowOverride AuthConfig
> Options None
> Order allow,deny
> Allow from all
> </Directory>
> </VirtualHost>
>
> --
> MadHat
>
> _______________________________________________
> http://ntlug.org/mailman/listinfo/discuss
>
OK, here are my httpd.conf and /etc/hosts files.
when I go to 209.223.22.89, which is the machines
IP address, I get the default site. 209.223.22.92 & 93
I am still getting a "server Not Responding" error.
any suggestions????
/etc/hosts file
---------------------------------------------------------------
127.0.0.1 localhost localhost.localdomain
209.223.22.89 mail.cbssolutions.com mail
209.223.22.92 www.cbssolutions.com cbssolutions
209.223.22.93 www.testing.com testing
---------------------------------------------------------------
httpd.conf file
---------------------------------------------------------------
####
# Configuration dumper for Comanche. It can be configured, so the .conf is
human friendly
####
LoadModule env_module modules/mod_env.so
LoadModule config_log_module modules/mod_log_config.so
LoadModule agent_log_module modules/mod_log_agent.so
LoadModule referer_log_module modules/mod_log_referer.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule status_module modules/mod_status.so
LoadModule info_module modules/mod_info.so
LoadModule includes_module modules/mod_include.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule asis_module modules/mod_asis.so
LoadModule imap_module modules/mod_imap.so
LoadModule action_module modules/mod_actions.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule proxy_module modules/libproxy.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule anon_auth_module modules/mod_auth_anon.so
LoadModule db_auth_module modules/mod_auth_db.so
LoadModule digest_module modules/mod_digest.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
ClearModuleList
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_log_agent.c
AddModule mod_log_referer.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_userdir.c
AddModule mod_proxy.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
AddModule mod_auth_db.c
AddModule mod_digest.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_usertrack.c
AddModule mod_so.c
AddModule mod_setenvif.c
serveradmin webmaster at cbssolutions.com
ServerRoot /etc/httpd
loglevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log common
pidfile /var/run/httpd.pid
ScoreBoardFile /var/run/httpd.scoreboard
UseCanonicalName on
Timeout 300
minspareservers 8
maxspareservers 20
startservers 10
MaxClients 150
maxrequestsperchild 100
<Directory />
AllowOverride None
Options None
</directory>
Alias /doc /usr/doc
<Directory /usr/doc>
order deny,allow
deny from all
allow from localhost
Options Indexes FollowSymLinks
</directory>
DocumentRoot /files/www/cbs/pub/html/
UserDir public_html
DirectoryIndex index.html index.shtml index.cgi
FancyIndexing on
defaulticon /icons/unknown.gif
ReadmeName README
HeaderName HEADER
IndexIgnore .??* *~ *# HEADER* README* RCS
AccessFileName .htaccess
TypesConfig /etc/mime.types
DefaultType text/plain
LanguagePriority en fr de
Alias /icons/ /home/httpd/icons/
ScriptAlias /cgi-bin/ /files/www/cbs/pub/cgi-bin/
servername CBS_Webserver
browsermatch Mozilla/2 nokeepalive
browsermatch {MSIE 4.0b2;} nokeepalive downgrade-1.0 force-response-1.0
browsermatch {RealPlayer 4.0} force-response-1.0
browsermatch Java/1.0 force-response-1.0
browsermatch JDK/1.0 force-response-1.0
addtype text/html .shtml
addencoding x-compress Z
addencoding x-gzip gz
addhandler server-parsed .shtml
addhandler imap-file map
addlanguage en .en
addlanguage fr .fr
addlanguage de .de
addlanguage da .da
addlanguage el .el
addlanguage it .it
addicon /icons/binary.gif .bin .exe
addicon /icons/binhex.gif .hqx
addicon /icons/tar.gif .tar
addicon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
addicon /icons/compressed.gif .Z .z .tgz .gz .zip
addicon /icons/a.gif .ps .ai .eps
addicon /icons/layout.gif .html .shtml .htm .pdf
addicon /icons/text.gif .txt
addicon /icons/c.gif .c
addicon /icons/p.gif .pl .py
addicon /icons/f.gif .for
addicon /icons/dvi.gif .dvi
addicon /icons/uuencoded.gif .uu
addicon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
addicon /icons/tex.gif .tex
addicon /icons/bomb.gif core
addicon /icons/back.gif ..
addicon /icons/hand.right.gif README
addicon /icons/folder.gif ^^DIRECTORY^^
addicon /icons/blank.gif ^^BLANKICON^^
addiconbyencoding (CMP,/icons/compressed.gif) x-compress x-gzip
addiconbytype (TXT,/icons/text.gif) text/*
addiconbytype (IMG,/icons/image2.gif) image/*
addiconbytype (SND,/icons/sound2.gif) audio/*
addiconbytype (VID,/icons/movie.gif) video/*
<Directory /home >
Options Indexes Includes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
</directory>
<directory "/files/www/cbs/pub/html">
Options Indexes Includes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
</directory>
<directory "/files/www/cbs/pub/cgi-bin">
AllowOverride None
order allow,deny
allow from all
</directory>
User nobody
Group nobody
Timeout 300
minspareservers 8
maxspareservers 20
startservers 10
MaxClients 150
maxrequestsperchild 100
<VirtualHost 209.223.22.92>
ServerAdmin webmaster at mail.cbssolutions.com
DocumentRoot /files/www/cbs/pub/html
ServerName www.cbssolutions.com
ErrorLog /files/www/cbs/pub/logs/error_log
TransferLog /files/www/cbs/pub/logs/access_log
<directory "/files/www/cbs/pub/html">
Options Indexes Includes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
</directory>
</Virtualhost>
<VirtualHost 209.223.22.93>
ServerAdmin webmaster at mail.cbssolution.com
DocumentRoot /files/www/testing/htdocs
Servername www.testing.com
ErrorLog /files/www/testing/logs/error_log
#TransferLog /files/www/testing/logs/access_log
</VirtualHost>
More information about the Discuss
mailing list