Apache full installation guide

Source: Internet
Author: User
Complete Apache installation guide-Linux Enterprise Application-Linux server application information. For more information, see the following section. Abstract: This article discusses how to install apache web servers that support mod_perl, mod_ssl, and php, and install webalizer to analyze web access logs. Guide beginners to edit a secure and fully functional web server system ........

Abstract: This article discusses how to install apache web servers that support mod_perl, mod_ssl, and php, and install webalizer to analyze web access logs. Guide beginners to edit a secure and fully functional 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 must install the following rpm packages:

Libpng-devel zlib-devel libjpeg-devel

You can run the rpm-qa | grep libpnp command to check whether the system has these rpm packages installed. If not, load the redhat installation disc and install these rpm packages in/mnt/cdrom/RedHat/RPMS.

Step 1: Install openssl

1. Unzip the software:

# Tar xvfz openssl-0.9.6b.tar.gz

2. Installation

# 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. Extract

# Tar xvfz mod_perl-1.26.tar.gz

2. Installation

$ Perl Makefile. pl everything = 1 APACHE_SRC = ../apache_1.3.20/src USE_APACI = 1 PREP_HTTPD = 1 DO_HTTPD = 1
$ Make
$ Make install

Step 4: Configure apache

# Cd apache_1.3.20
#./Configure

Step 5: install php

1. Extract

# Tar xvfz php-4.0.6.tar.gz

2. Installation

# 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 -- enable-memory-limit = 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/include/

Step 8: Install webalizer

1. Extract

# Tar xvfI webalizer-2.01-06-src.tar.bz2

2. Installation

# Cd webalizer-2.01-06
#./Configure
# Make
# Make install

3. Configuration

Rename webalizer. conf. sample Under/etc/to webalizer. conf.

Modify the following content based on the actual Server:

LogFile/usr/local/apache/logs/access_log

Set the location of the www access log file

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 a cron task

Add the following content at the end of the/etc/crontab file:

02 4 *** root/usr/local/bin/webalizer

You can.

5. Create an output directory

# Mkdir/usr/local/apache/htdocs/usage

Step 9: Protect access statistics from unauthorized access

We certainly do not want our Website access statistics to be browsed by others at will. Therefore, we need to protect the usage directory and only allow access by legal users.

I. Conditions

The website www.test.com has the following settings:
DocumentRoot/usr/local/apache/htdocs
AccessFileName. htaccess
AllowOverride All

Ii. Requirements

Requirement: restrict access to the/usr/local/apache/htdocs/usage/directory. Only the user "admin" can access this directory with the password "12345678.

3. Use htpasswd to create User Files

Htpasswd-c/usr/local/apache/. htpasswd admin

This program will ask the user "admin" password, you enter "12345678", take effect twice.

4. Create a. htaccess File

Use vi to create a file. htaccess in the/usr/local/apache/htdocs/usage/directory and write the following lines:

AuthName admin-only
AuthType Basic
AuthUserFile/usr/local/apache/. htpasswd
Require user admin

V. Test

In this case, you can access ghost through a browser.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.