[NTLUG:Discuss] Virtual Host in Apache

Keith From kfrom at cbssolutions.com
Thu Aug 26 11:55:20 CDT 1999


----- Original Message -----
From: MadHat <madhat at unspecific.com>
To: <discuss at ntlug.org>
Sent: Thursday, August 26, 1999 11:32 AM
Subject: Re: [NTLUG:Discuss] Virtual Host in Apache


> Keith From wrote:
> >
> > ----- Original Message -----
> > From: MadHat <madhat at unspecific.com>
> > To: <discuss at ntlug.org>
> > Sent: Thursday, August 26, 1999 11:05 AM
> > Subject: Re: [NTLUG:Discuss] Virtual Host in Apache
> >
> > > > Keith From wrote:
> > > >
> > > > OK, here is my problem.
> > > > I want to run multiple domains with Apache
> > > > assigning 1 IP address per site.
> > > > I have altered my httpd.conf file and added this:
> > > >
> > > >    <VirtualHost 209.223.22.92>
> > > >     ServerAdmin webmaster at mail.cbssolutions.com
> > > >     DocumentRoot /files/www/testing/html
> > > >     ServerName www.testing.com
> > > >     ErrorLog /files/www/testing/logs/error_log
> > > >     TransferLog /files/www/testing/logs/access_log
> > > >     <directory "/files/www/testing/html">
> > > >     Options Indexes Includes FollowSymLinks
> > > >     AllowOverride None
> > > >     order allow,deny
> > > >     allow from all
> > > >     </directory>
> > > >     </VirtualHost>
> > > >
> > > >
> > > > I also went into /etc/hosts and added the new address
> > > > to the hosts file like this:
> > > >
> > > > 209.223.22.92    www.testing.com    testsite
> > > >
> > > > when I try to browse 209.223.22.92, I get a
> > > > server not responding error.
> > > >
> > > > What am i missing here, what else do i need to configure.
> > > >
> > > > Thanks a million to all of you.
> > >
> > > Do you have a line that reads:
> > > NameVirtualHost 209.223.22.92:80
> > > or similar?
> > >
> > > Also if you browse there by IP instead of name, it will show the
default
> > > site and not one of the virtual sites, it works off the head info
being
> > > sent from the browser.
> > >
> > > --
> > > MadHat
> > >
> > > _______________________________________________
> > > http://ntlug.org/mailman/listinfo/discuss
> > >
> >
> > No, i do not have a line that reads:
> >
> > NameVirtualHost 209.223.22.92:80
> >
> > Where would i insert this????
>
> I just have it right before the first VirtualHost entry
>
>
> > Also, i do try to browse there by IP, and that
> > is when i was getting the "Server not respoding" error
>
> Make sure the server is running (ps or if you built apache yourself, use
> the apachectl to testconfig, if it is a package, I am not sure this is
> included).
>
> Does your box have more than 1 IP?
>
> >
> > Thanks,
> > Keith
>
>
> --
> MadHat
>
> _______________________________________________
> http://ntlug.org/mailman/listinfo/discuss
>

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

At this time, I only have 1 IP on this box, and I am running
a Mail server from it(qmail)

this is what my httpd.conf file looks like at this time.
Could you tell me what are all of these "LoadModule" files,
"AddModule" files and the rest of this crap.  It looks like a lot of
stuff that isnt needed. When looking at example httpd.conf files
they all look simple and straight forward. This is the default
httpd.conf file that was created when I installed RH6 and
told the installation program to install Apache. I did not
install and compile myself. I guess what I need to do is
just create a new httpd.conf, point Apache to it, and start
it off simple and expand on it from there and see what works, huh.


####
# 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
user nobody
group nobody
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>
<VirtualHost 209.223.22.92>
ServerAdmin webmaster at mail.cbssolutions.com
DocumentRoot /files/www/testing/htdocs
ServerName www.testing.com
ErrorLog /files/www/testing/logs/error_log
TransferLog /files/www/testing/logs/access_log
<directory "/files/www/testing/htdocs">
Options Indexes Includes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
</directory>
</virtualhost>







More information about the Discuss mailing list