This article discusses how to install an Apache web server that supports mod_perl, mod_ssl, and PHP, and installs Webalizer implementation log analysis. Handle hand guides beginners to edit a safe and fully fully equipped Web server system.
Required software
Apache_1.3.20.tar.gz
Home:
http://www.apache.org
MOD_PERL-1.26.Tar.gz
Home:
http://perl.apache.org
OpenSSL-0.9.6B.Tar.gz
Home:
http://www.openssl.org
MOD_SSL-2.8.4-1.3.20.tar.gz
Home:
http://www.modssl.org
PHP-4.0.6.tar.gz
Home:
http://php.apache.org
Webalizer-2.01-06-src.tgz
Home:
http://www.mrunix.net/webalizer
GD-1.8.4.tar.gz
Home:
http://www.boutell.com/gd
In addition, the system is required to install the following RPM package:
LIBPNG LIBPNG-DEVEL ZLIB ZLIB-DEVEL LIBJPEG LIBJPEG-Devel
You can detect if the system is installed with these RPM packages via the rpm -qa | grep libPnp command. If not installed, load the RedHat installation disc, install these RPM packets under / mnt / cdrom / redhat / rpms.
Step 1: Install OpenSSL
1, decompression software:
# TAR XVFZ openssl-0.9.6b.tar.gz
2, install
# cd openssl-0.9.6b
# ./config
# Make
# Make Test
# make install
Step 2: Install MOD_SSL
1, unzip MOD_SSL
# TAR XVFZ Apache_1.3.20.tar.gz
# TAR XVFZ MOD_SSL-2.8.4-1.3.20.tar.gz
2, install MOD_SSL
# CD MOD_SSL-2.8.4-1.3.20
# ./configure --with-apache = .. / apache_1.3.20
Step 3: Install MOD_PERL
1, decompression
# TAR XVFZ MOD_PERL-1.26.tar.gz
2, install
$ perl makefile.pl everything = 1 apache_src = .. / apache_1.3.20 / src us_apaci = 1 preip_httpd = 1 do_httpd = 1
$ Make
$ make Install
Step 4: Configure Apache
# cd apache_1.3.20
# ./configure
Five steps: Install PHP
1, decompression
# TAR XVFZ PHP-4.0.6.tar.gz
2, install
# CD PHP-4.0.6
# Cflags = -O2 -i / usr / local / ssl / include / OpenSSL
# ./configure --with-apache = .. / apache_1.3.20 --with-mysql --with-gd = .. / GD-1.8.4 --Nable-Memory-limited = Yes --enable-debug = NO
# gmake
# Gmake Install
Step 6: Install Apache
# SSL_BASE = .. / OpenSSL-0.9.6B
#./configure --enable-module = ssl --activate-module = src / modules / perl / libperl.a --enable-module = perl --activate-module = src / modules / php4 / libphp4.a - Enable-module = php4 # make
# make certificate
# make install
Step 7: Install GD
# Make All
# cp libgd.a / usr / lib
# cp gd * .h / usr / incrude /
Step 8: Install Webalizer
1, decompression
# TAR XVFI Webalizer-2.01-06-src.tar.bz2
2, install
# Cd Webalizer-2.01-06
# ./configure
# Make
# make install
3, configuration
Rename / etc / Webalizer.conf.sample is Webalizer.conf.
According to the actual modification of the server:
Logfile / usr / local / apache / logs / access_log
Set WWW Access Log File Location
Outputdir / usr / local / apache / htdocs / usage
Set the web access statistics output directory
HistoryName Webalizer.hist
Incremental YES
Hostname
Www.test.com
PageType HTM *
PageType CGI
PageType PHTML
PageType PHP3
PageType Pl
PageType JSP
4, set the cron task
Add the following content in the / etc / crontab file:
02 4 * * * root / usr / local / bin / Webalizer
I.e.
5. Create an output directory
#mkdir / usr / local / apache / htdocs / usage
Step 9: Protect access statistics is not illegally visited
We will not want to visit the statistics from our website to be browsed by others, so you need to protect the USAGE directory, only allow legal users to access.
First, conditions
Www.test.com Site pair "/" is set to:
Documentroot / usr / local / apache / htdocs
AccessFileName .htaccess
ALLOWOVERRIDE ALL
Second, demand
Demand: Restrict / usr / local / apache / htdocs / usage / directory access, only allows users "admin" to access this directory in password "12345678".
Third, build user files using htpasswd
htpasswd -c /usr/local/apache/.htpasswd admin
This program will ask the user "admin" password, you enter "12345678" and take effect twice.
Fourth, establish a .htaccess file
Create a file with VI in / usage / apache / htdocs / usage / directory. HTACCESS, write the following lines:
Authname admin-only
Authtype Basic
Authorfile /usr/local/apache/.htpasswd
Require User Admin
V. Test
Access this time through browser
Http://www.test.com/USAGE will discharge the username and password, when entering admin, 12345678, can access the directory.