introductioninstalling redhatunix commandsediting filesssh
sitemapapacheftptcp/ipmisc-notesresources

back  main  next
some common items that I change right after installing apache are listed here

apache configuration changes
In a terminal logged in as root open /usr/local/apache/conf/httpd.conf with your favorite editor. I highly recommend that you read the entire file, see how it's laid out and read the comments before editing. I haven't listed the locations of the text that you will be editing. Also the file is really large. Using your editors find command is definitely the fastest way to navigate if you are unfamiliar with the layout of apache's httpd.conf file.

disable apache's proxy module
comment out LoadModule proxy_module        libexec/libproxy.so
comment out AddModule mod_proxy.c

For more info on modules and what each module does see apaches documentation web site and read the section on modules. You may find that you want to disable other modules as well depending on how and what you want your server to run.

turn off serversignature
I recommend turning off the ServerSignature feature as it will provide more information than you need to give when parsing the generic built in error 404 page. As a rule of thumb when running a server, try not to give hackers information that will be useful in finding security exploits.

change the document root
This is the directory apache will be looking to when serving web pages
. If you will be running multiple hosts, example: www.site1.com and www.site2.com... all sites will be set up as virtual servers and you will setup the document roots in the "virtual hosts" section of apache's httpd.conf file. See the "virtual hosts" section of apache's httpd.conf file for an example. If you only plan on one host, find DocumentRoot and change the path to match a directory on your filesystem... I recommend creating a directory at the root so it's easy to navigate to.

define the script alias
This will be the directory to run scripts from. Commonly called "cgi-bin".
To do this just search for "ScriptAlias". Read the comment information and designate the directory to use as the script alias. If you had a site that was "www.site.com", you designated your script alias, and you wanted to call a perl script called "test.pl" that was inside the script alias directory, you would type "www.site.com/cgi-bin/test.pl"

add execcgi to options line
Unmodified options line:
Options Indexes FollowSymLinks Multiviews
Modified options line: Options Indexes FollowSymLinks Multiviews ExecCGI

have apache include the virtualhost name in your log files
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
# with hostnames
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
Add the "%v" to include the virtualhost name (www.site.com). This is useful if you are running several virtual hosts on one server. It identifies the hostname in the log files, making processing the log files with a analysis program like webalizer, funnelweb or webtrends a bit more flexible.

have apache automatically start at boot
create a startup script in /etc/init.d to start apache and link to it in /etc/rc3/d
Name the script "apache"
Contents of script:
/usr/local/apache/bin/apachectl start

make a symbolic link to this script in /etc/rc3.d
# ln -s /etc/init.d/apache /etc/rc3.d/S99apache

The capital "S" indicates that it is a start up script. The "99" indicates what order the script shall start in. Putting the script in /etc/rc3.d will activate the script when the server gets to run level 3 from a boot or reboot.

note: This is not an option when using a SSL certificate.