# # Here is a sample conf for using the rewrite module to do named based vhosts # it also works on IP based as well. # # TG ServerType standalone ServerRoot "/usr/local/apache" #LockFile /usr/local/apache/logs/httpd.lock PidFile /usr/local/apache/logs/httpd.pid ScoreBoardFile /usr/local/apache/logs/httpd.scoreboard #ResourceConfig conf/srm.conf #AccessConfig conf/access.conf Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 15 MinSpareServers 5 MaxSpareServers 10 StartServers 5 MaxClients 100 MaxRequestsPerChild 30 #Listen 3000 #Listen 12.34.56.78:80 #BindAddress * Port 80 User nobody Group web ServerAdmin linux@mydomain.com #ServerName www.net DocumentRoot "/usr/local/apache/htdocs" Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all UserDir html # # AllowOverride FileInfo AuthConfig Limit # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec # # Order allow,deny # Allow from all # # # Order deny,allow # Deny from all # # DirectoryIndex index.html AccessFileName .htaccess Order allow,deny Deny from all #CacheNegotiatedDocs UseCanonicalName Off TypesConfig /usr/local/apache/conf/mime.types DefaultType text/plain MIMEMagicFile /usr/local/apache/conf/magic HostnameLookups Off ErrorLog /usr/local/apache/logs/error_log LogLevel warn LogFormat "%{SERVER_NAME}e %h %l %u %t \"%r\" %s %b" vcommon CustomLog /usr/local/apache/logs/access_log vcommon #CustomLog /usr/local/apache/logs/access_log common ServerSignature On Alias /icons/ "/usr/local/apache/icons/" Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/" AllowOverride None Options None Order allow,deny Allow from all Options MultiViews FollowSymLinks ExecCGI +Includes IndexOptions FancyIndexing 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/* 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^^ # # DefaultIcon is which icon to show for files which do not have an icon # explicitly set. # DefaultIcon /icons/unknown.gif # # AddDescription allows you to place a short description after a file in AddDescription "GZIP compressed document" .gz AddDescription "tar archive" .tar AddDescription "GZIP compressed tar archive" .tgz ReadmeName README HeaderName HEADER IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t AddEncoding x-compress Z AddEncoding x-gzip gz AddLanguage en .en AddLanguage fr .fr AddLanguage de .de AddLanguage da .da AddLanguage el .el AddLanguage it .it LanguagePriority en fr de #AddType application/x-httpd-php3 .phtml #AddType application/x-httpd-php3-source .phps AddHandler cgi-script .cgi AddType text/html .shtml AddHandler server-parsed .shtml #AddHandler send-as-is asis AddHandler imap-file map # To enable type maps, you might want to use # #AddHandler type-map var #MetaDir .web #MetaSuffix .meta #ErrorDocument 500 "The server made a boo boo. #ErrorDocument 404 /missing.html #ErrorDocument 404 /cgi-bin/missing_handler.pl #ErrorDocument 402 http://some.other_server.com/subscription_info.html 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 RewriteEngine On RewriteMap lowercase int:tolower RewriteCond %{REQUEST_URI} !^/icons/ RewriteCond %{REQUEST_URI} !^/cgi-bin/ RewriteRule ^/(.*)$ /www/domains/${lowercase:%{SERVER_NAME}}/html/$1 RewriteCond %{REQUEST_URI} ^/cgi-bin/ RewriteRule ^/(.*)$ /www/domains/${lowercase:%{SERVER_NAME}}/html/$1 [T=application/x-httpd-cgi]