[NTLUG:Discuss] Virtual Host in Apache (LONG)

Keith From kfrom at cbssolutions.com
Thu Aug 26 12:39:53 CDT 1999


----- Original Message -----
From: MadHat <madhat at unspecific.com>
To: <discuss at ntlug.org>
Sent: Thursday, August 26, 1999 12:27 PM
Subject: Re: [NTLUG:Discuss] Virtual Host in Apache (LONG)


> 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.
>
> > 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
> > ClearModuleList
> > AddModule mod_env.c
>
> Load module and add module is just like using modules in the Kernel.
> You can either compile them in or just have the modules available for
> loading as needed.  These lines load them in at startup time.  Comment
> out the ones you don't use.
>
> > user nobody
> > group nobody
>
> Who the server runs as
>
> > serveradmin webmaster at cbssolutions.com
>
> whose email to show when there is an error
>
> > ServerRoot /etc/httpd
>
> server root helps determine where config files are primarily.  Other
> directives cal also be set relitive to this setting.
>
> > 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
>
> Details on how to log what.  I won't go into details here.
>
> > pidfile /var/run/httpd.pid
> > ScoreBoardFile /var/run/httpd.scoreboard
>
> locations of files to store data on the running server.
>
> > UseCanonicalName on
> > Timeout 300
> > minspareservers 8
> > maxspareservers 20
> > startservers 10
> > MaxClients 150
> > maxrequestsperchild 100
>
> Just details on how the server starts and how it manages connections.
>
> > <Directory />
> > AllowOverride None
> > Options None
> > </directory>
>
> Start by locking everything down.  nothing is allowd from the root down,
> so you have to specify where this are and what permissions they have.
>
> > Alias /doc /usr/doc
>
> Alias's say that http://domain/doc really is the directory /usr/doc
> onthe system.
>
> > <Directory /usr/doc>
> > order deny,allow
> > deny from all
> > allow from localhost
> > Options Indexes FollowSymLinks
> > </directory>
>
> permissions on that directory
>
> > DocumentRoot /files/www/cbs/pub/html/
>
> where the default web site lives
>
> > UserDir public_html
>
> under the users home directory, what is the name of their web directory
> so that when you go to http://domain/~user it looks in
> /home/user/public_html for their website.
>
> > DirectoryIndex index.html index.shtml index.cgi
>
> what files to look for the directories to show instead of a file listing
> (if Indexing is turned on)
>
> > FancyIndexing on
>
> allows the contents to be sorted by name, date, size and description (if
> it is an HTML file, the desc is the title) it has to be compiled into
> the build.
>
> > defaulticon /icons/unknown.gif
>
> If it doesn't know the file type use this icon
>
> > ReadmeName README
> > HeaderName HEADER
>
> Display these when showing a directory without an index file.  HEADER is
> the to README is at the bottom.
>
> > IndexIgnore .??* *~ *# HEADER* README* RCS
>
> What files to not show in a listing
>
> > AccessFileName .htaccess
>
> name of the file to look for specific access priviledges in a directory
>
> > TypesConfig /etc/mime.types
>
> where to pull the type and extensions
>
> > DefaultType text/plain
> > LanguagePriority en fr de
> > Alias /icons/ /home/httpd/icons/
> > ScriptAlias /cgi-bin/ /files/www/cbs/pub/cgi-bin/
>
> similar to alias, but it won't allow the listing (unless you turn it on)
> and will allow scripts to be excuted by default
>
> > servername CBS_Webserver
>
> this one is ....
>
> > 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
>
> I don't know
>
> > addtype text/html .shtml
>
> add type is adding a mime type rather than adding it into the mime.types
> file
>
> > 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^^
>
> setting up how to display indexes (the file listing)
>
> > 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/*
>
> additional itcons, more generalized
>
> > <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>
>
> Just setting the rights for these directories
> As for the Options and AllowOveride, there are details in the conf
> file.  You can set if a dir has access to excute scripts, list the
> contents, etc...
>
> > <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>
>
> and the virtual host setttings, most of this is seen in other parts og
> the config files
>
> HTH
>
> --
> MadHat
>
> _______________________________________________
> http://ntlug.org/mailman/listinfo/discuss
>

WOW......THANKS A MILLION
breaking down the httpd.conf file like that has all kinds
of light bulbs going off and doors opening for me. I think I got it now.

THANK YOU, THANK YOU, THANK YOU.....
I'm going to go make a bunch of changes and crash my system now.

Greg, thanks for that last bit of info also.

Gratefully Yours,
Keith






More information about the Discuss mailing list