Welcome to CGI City - One of the biggest WWW Resources for CGI and Perl materials
Tips and Tutorials
How To Install Apache Web Server
By: Tito Mijares

Assumptions:

  • Apache version 1.3.12
  • Apache tarball downloaded into a dir named /home/_installer/apache
  • Hardware has Red Hat Linux operating system.
  • User has root privileges.

1.0 Unpacking Apache

# cd /home/_installer/apache
# gzip -dc apache* | tar xvf -
# mv apache_1.3.12 /usr/local
# cd /usr/local
# chown -R root:root apache_1.3.12
# ln -s apache_1.3.12 httpd

2.0 Configuring Apache

2.1 Conventions

/www - main "publishing" directory
/www/conf - configuration files directory
/www/logs - log directory
/www/servers - "sites" directory
/www/servers/yourdomain.com - document root for yourdomain.com

2.2 Creating Configuration directories

# cd /
# mkdir www
# cd /www
# mkdir conf logs servers
# cd servers
# mkdir yourdomain.com

2.3 Configuring Apache

# cd /usr/local/httpd
# ./configure --prefix=/usr/local/httpd --sysconfdir=/www/conf

note: this sets up installation of the binaries at /usr/local/httpd and configuration files at /www/conf

2.4 Compiling Apache

note: assumes you're in /usr/local/httpd and have done ./configure

# make
# make install

3.0 Automatic Apache Startup during boot

note: Red Hat comes with a bundled apache startup file which we shall modify

3.1 Edit /etc/rc.d/init.d/httpd

# cd /etc/rc.d/init.d
# vi httpd

# Add the following lines

PIDFILE=/usr/local/httpd/logs/httpd.pid
BINFILE=/usr/local/httpd/bin/httpd
SYSCONF=/www/conf/httpd.conf

# endof added lines
case "$1" in
  start)

echo -n "Starting httpd: "
# modified the following line
#daemon httpd
# to show...
daemon $BINFILE -f $SYSCONF
# endof modification

3.2 Automatic Shutdown

# cd /etc/rc.d/rc0.d
# ln -s ../init.d/httpd K15httpd
# cd /etc/rc.d/rc6.d
# ln -s ../init.d/httpd K15httpd

3.3 Automatic Startup

# cd /etc/rc.d/rc3.d
# ln -s ../init.d/httpd S15httpd
# cd /etc/rc.d/rc5.d
# ln -s ../init.d/httpd S15httpd

That's it!

-oOo-

Back to Tips and Tutorials


Search For:
Quick jump to
Home | About Us | Contact Us | Link To Us | Search
Tips & Tutorials | References | Books | Add A Resource
Custom Programming Services | Advertise
Disclaimer | Privacy Policy

Copyright © 1998-2099    CGI City    All Rights Reserved
All original materials contained herein including text, images, and original scripts written by CGI City, are copyrighted by CGI City. All other scripts and materials are copyrighted by their respective authors/owners.