Apa Che?

| Tuesday, February 20, 2007

Apache – Web server

# Looking for the older Apache v2.0.55?
fetch http://www.ip97.com/apache.org/httpd/httpd-2.2.2.tar.gz
# Unzip and Untar
tar xvf httpd-2.2.2.tar.gz
# Configure
cd httpd-2.2.2
./configure --prefix=/opt/apache --enable-modules=all --enable-mods-shared=all --enable-http --enable-ssl --enable-cgi --enable-cgid --enable-expires
--enable-headers --enable-mime-magic --enable-imagemap --enable-cern-meta --enable-usertrack --enable-unique-id --enable-speling --enable-rewrite --enable-so
--enable-info --enable-auth-dbm --enable-authn-anon --enable-authn-dbd --enable-authn-alias --enable-authz-owner --enable-auth-digest --enable-cache
--enable-mem-cache --enable-dav --enable-dav-fs --enable-dav-lock --enable-dbd --enable-dumpio --enable-ext-filter --enable-deflate --enable-log-forensic
--enable-logio --enable-ident --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-vhost-alias --enable-suexec

# Compile
make && make install


Create an “rc” script to start traplogd at boot time

# Create an “rc” script to start at boot time:
vi /usr/local/etc/rc.d/apache.sh

#!/bin/sh
CHROOT=/opt/apache
PIDFILE=/logs/httpd.pid
echo -n " apache"
case "$1" in
start)
/opt/apache/bin/apachectl -k start
;;
stop)
kill `cat ${CHROOT}/${PIDFILE}`
;;
*)
echo ""
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac
exit 0
# Make the startup script executable:
chmod 755 /usr/local/etc/rc.d/apache.sh

Apache Notes for Admins

# Edit the "httpd.conf" to suit your needs, at least change the variables:
vi /opt/apache/conf/httpd.conf
User nobody
Group nobody
ServerAdmin you@example.com

# Set directory permissions:
chown -R nobody /opt/apache/htdocs/

# Commands to remember:
/opt/apache/bin/apachectl -k start
/opt/apache/bin/apachectl -k restart
/opt/apache/bin/apachectl -k stop

# The Apache configuration file:
vi /opt/apache/conf/httpd.conf

# Apache logs:
cd /opt/apache/logs
tail -f /opt/apache/logs/error_log
cat /opt/apache/logs/access_log

# See Also:
http://www.devshed.com/c/a/Apache/Building-Apache-the-Way-You-Want-It/


mod_perl

Home:
http://perl.apache.org/

# Change to the /tmp directory not your normal source dir!
cd /tmp
# Download
fetch http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz
# Unzip and Untar
tar xvf mod_perl-2.0-current.tar.gz
# Configure
cd mod_perl-2.0.2
perl Makefile.PL MP_APXS=/opt/apache/bin/apxs
# Edit the "httpd.conf" and add the new perl module to load, at the very bottom of the conf file
vi /opt/apache/conf/httpd.conf
LoadModule perl_module modules/mod_perl.so
# Compile
make && make test && make install

0 komentar: