The full installation guide for the Apache Web server _linux

Source: Internet
Author: User
Tags install openssl openssl
The 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 to the system installation, there are several RPM packages:
Libpng libpng-devel zlib zlib-devel libjpeg libjpeg-devel
You can use the Rpm-qa grep LIBPNP command to detect if the system has these RPM packages installed. If it is not installed, load the RedHat installation CD and install the RPM packages under/mnt/cdrom/redhat/rpms.
First step: Install OpenSSL
1, decompression software:
# tar Xvfz openssl-0.9.6b.tar.gz
2, installation
# CD openssl-0.9.6b#./config# make# make test# make install
Step two: Install Mod_ssl
1, decompression Mod_ssl
# tar Xvfz apache_1.3.20.tar.gz# tar xvfz mod_ssl-2.8.4-1.3.20.tar.gz
2. Installation Mod_ssl
# CD mod_ssl-2.8.4-1.3.20#./configure――with-apache=....../apache_1.3.20
Step three: Install Mod_perl
1, decompression
# 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
Fourth Step: Configure Apache
# CD apache_1.3.20#./configure
Five steps: Installing PHP
1, decompression
# 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
Sixth step: 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
Seventh Step: Install GD
# make all# CP libgd.a/usr/lib# CP gd*.h/usr/include/
Eighth Step: Install Webalizer
1, decompression
# tar Xvfi webalizer-2.01-06-src.tar.bz2
2, installation
# CD webalizer-2.01-06#./configure# make# Make Install
3, configuration
The/etc/under the webalizer.conf.sample renamed to Webalizer.conf.
The following is actually modified by the server:
Logfile/usr/local/apache/logs/access_log
Setting the WWW access log file location
Outputdir/usr/local/apache/htdocs/usage
Set Web Access Statistics output directory
Historyname webalizer.hist
Incremental Yes
HostName www.test.com
PageType htm*pagetype cgipagetype phtmlpagetype php3pagetype plpagetype JSP
4. Set Cron task
At the end of the/etc/crontab file, add the following:
4 * * * Root/usr/local/bin/webalizer
Can
5. Create output Directory
#mkdir/usr/local/apache/htdocs/usage
Step Nineth: Protect access statistics from unauthorized access
We certainly don't want our website access statistics to be viewed randomly by others, so we need to protect the usage directory and allow only legitimate users to access it.
One, conditions
The www.test.com site has a set of ocumentroot/usr/local/apache/htdocsaccessfilename. Htaccessallowoverride all for "/"
Second, demand
Requirements: Restrict access to the/usr/local/apache/htdocs/usage/directory, allowing only the user "admin" to access this directory with password "12345678".
Third, the use of htpasswd to establish user files
Htpasswd-c/USR/LOCAL/APACHE/.HTPASSWD Admin
This program will ask the user "admin" password, you enter "12345678", two times effective.
Iv. Establishment. htaccess file
Use VI to create a file in the/usr/local/apache/htdocs/usage/directory. Htaccess, write the following lines:
AuthName admin-onlyauthtype basicauthuserfile/usr/local/apache/.htpasswdrequire User admin
Five, test
At this time through the browser access Http://www.test.com/usage will pop-up box to request a username and password, then enter admin, 12345678 can access the directory.

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.