(Apache2 can also be installed using the sudo apt-get install apache2, below to explain how to manually install the configuration apache2)
Before installing apache2, install apache2 dependencies, apache2 dependencies are:Apr, Apr-util, Pcre, and pcre dependent on Perl.
Apache Dependency Packages:
Apr:http://mirrors.cnnic.cn/apache//apr/apr-1.5.1.tar.gz
Apr-util:http://mirrors.cnnic.cn/apache//apr/apr-util-1.5.4.tar.gz
Pcre:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
Perl:http://www.cpan.org/src/5.0/perl-5.20.2.tar.gz
Apache:
http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.12.tar.bz2
After downloading all extracted to a directory, the demo here is all extracted to the desktop. (Note: Before downloading Perl, first enter: Perl-v in the terminal, see if Perl is installed, installation is not required to download)
Open Terminal: CD desktop #之前已经所有下载的全部解压到桌面了, so go to the desktop first.
The following sequence explains the Apache installation process:
(blue indicates the command to enter the terminal, #后面是注释说明)
Apr Dependent Package Installation:
CD Apr #进入apr目录
The ./configure--prefix=/usr/local/apr #--prefix Indicates the directory that will be installed, that is, the APR is installed in the/USR/LOCAL/APR directory, which can be passed./configure- H command to view parameters
Make
Make Install
After installation, you will be able to see the APR file under the/usr/local directory.
Apr-util Dependent Package Installation:
CD.. /apr-util #从apr目录下转到apr-util
./configure--prefix=/usr/local/apr-util
Make
Make Install
Perl Installation: (Note: Before you download Perl, open the terminal input: perl-v, see if Perl is installed, install without downloading)
Cd.. /perl
SH configure-de
Make
Make Test
Make install
Pcre Dependent package Installation: (Do not download pcre2xx, otherwise when installing Apache will appear xx not found)
Cd.. /pcre
./configure--prefix=/usr/local/pcre
Make
Make install
Apache Installation:
Cd.. /httpd
./configure--prefix=/usr/local/apache2--enable-so--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util- -with-pcre=/usr/local/pcre
Make
Make install
To this, Apache installation is complete, now go to the Apache Bin directory, open Apache service:
CD ~/usr/local/apache2/bin
Apachectl start
Open Browser, enter 127.0.0.1
If you also need to configure PHP, please refer to http://php.net/manual/en/install.unix.apache2.php
Manual Configuration apache2.4.12 under Ubuntu