DocumentRoot to whatever you want it to be DocumentRoot "X:/webroot")This uses mod_alias
Use the command Redirect gone path-from-top-of-website
Example: Redirect gone /notes/everquest.html
From http://www.onlamp.com/pub/a/apache/2003/12/23/apache_ckbk.html
Support virutal hosts by remapping a the hostname to a directory.
Use
mod_rewriteRewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.com$ RewriteRule ^(.*)$ /home/%2$1
Note: There must be no spaces between the allow deny and the comma
<Directory /> Order deny,allow deny from all #the following line disables getting directory listings: Options -Indexes </Directory> <Directory /usr/local/apache/vhosts/cousineddie> Order allow,deny Allow from all </Directory>
| Need | Module | Description |
|---|---|---|
| Very Important | mod_access | Allows and Deny's access to items (such as .htaccess and .htpasswd) |
| Optional | mod_actions | This module provides for executing CGI scripts based on media type or request method. |
| Optional | mod_asis | Allows sending of files that contain their own http header information |
| Optional | mod_auth | User authentication using text files |
| Optional | mod_autoindex | Makes the directory listing pages if they are allowed. |
| Optional | mod_cgi | Runs cgi scripts |
| Very Important | mod_dir | Addes a trailing '/' if the URL is a directories that don't have one. Lets you pick what the defaut file to load in a directory is. |
| Optional | mod_env | Modifies the environment which is passed to CGI scripts and SSI pages |
| Optional | mod_imap | Serverside image map support. |
| Optional | mod_include | Server side include support. |
| Junk | mod_isapi | Allows some Microsoft ISAPI modules to be used. |
| Required? | mod_mime | Associates the requested filename's extensions with the file's behavior (handlers and filters) and content (mime-type, language, character set and encoding) |
| MORE TO ADD | ||
<virtualhost *:80>
ServerName 66.56.82.97
RedirectMatch permanent (.*) http://www.exogenesis.org$1
</virtualhost>
From the best I can tell, this is some sort of attack on IIS
SEARCH /\x90\x02\xb1\x02...
It is a very long line and mucks up looking at the access.log. Here is how to
keep it out of the log:
Here is how to turn on automatic log rotating. (add the following to httpd.conf)
TransferLog "|rotcmd"rotcmd is the command to be used to rotate the logs. Since Apache comes with a log rotate command, its description follows.
rotatelogs is part of the Apache distrobution
rotatelogs logpath rotint [ offset ]logpath is the path to the logfile to rotate.rotint is the rotation interval time in seconds.offest number of minutes to offest from UTC (defaults to zero). For UTC -5 hours use -300.I have a friends domain pointing to my server, but his web pages are stored at an ISP. I figured out how to get his URL to load his page at the ISP. I added the following to my httpd.conf file:
(Note that there is no file with the name tigerofdoom.html on my server)
<VirtualHost *:80>
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
ServerName www.tigerofdoom.com
DirectoryIndex /tigerofdoom.html
</VirtualHost>
Redirect /tigerofdoom.html http://home.comcast.net/~tigerofdoom/
Note: You can do this at the end of the conf file and have it work for all virtual hosted websites
Note: If you use VirtualHosts, then there is _NO_ main default host.
All hosting is done through VirtualHosts, so you must make your default settings occur in a
VirtualHost block.
VirtualHost block is the default block that gets used if a match does
not happen with any of the VirtualHost blocks.
NameVirtualHost *:80VirtualHost matches the value
of NameVirtualHost.To change it: DirectoryIndex newDefaultPage.html
You can also add alternate defaults by appending more values:
DirectoryIndex index.html index.php
Usage: apache [-D name] [-d directory] [-f file] [-n service]
[-C "directive"] [-c "directive"] [-k signal]
[-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T]
-D name : define a name for use in directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled-in modules
-L : list available configuration directives
-S : show parsed settings (currently only vhost settings)
-t : run syntax check for config files (with docroot check)
-T : run syntax check for config files (without docroot check)
-n name : name the Apache service for -k options below;
-k stop|shutdown : tell running Apache to shutdown
-k restart : tell running Apache to do a graceful restart
-k start : tell Apache to start
-k install | -i: install an Apache service
-k config : reconfigure an installed Apache service
-k uninstall | -u: uninstall an Apache service
@echo off
echo "content-type: text/plain"
echo.
echo "Have a nice day"
NOTE: The trick is that echo. prints just a carrage return
IE will sometimes think you are trying to download instead of running a .bat file here is a trick to make it not try that. Tack a path onto the end of the URL like this http://localhost/cgi-bin/test.bat/fakepath this passes fakepath as the environment setting PATH_INFO to the bat file
You set or disable this in a <directory> block, the Indexes command is cases sensitive.
Note: place this at the end of httpd.conf to make it work right. I need to figure out where the highest place it can go is.
#too allow browsing <directory "C:/Program Files/Apache Group/Apache2/htdocs"> Options +Indexes </directory> #to disallow browsing <directory "C:/Program Files/Apache Group/Apache2/htdocs"> Options -Indexes </directory>
Used to map arbitraray directorys on the system to specific URLS. Put something like the following in the httpd.conf file.