Linux installation Apache

Source: Internet
Author: User

This article is from the Internet on the reference summary, has been personally tested.

Ubuntu under compile install Apache need to pre-compile and install multiple dependencies, including: Apr, Apr-util,pcre,zlib-devel, etc., quite troublesome, recorded in this for reference.

Because the Ubuntu system does not have C + + installed by default, it is also necessary to install the relevant components of C + + compilation first.

[Note]apt-cache policy package name//view installed package information.]

--------------------------------------Split Line--------------------------------------

Ubuntu 13.04 Installation lamp\vsftpd\webmin\phpmyadmin services and Settings http://www.linuxidc.com/Linux/2013-06/86250.htm

CentOS 5.9 under Compile and install lamp (Apache 2.2.44+mysql 5.6.10+php 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm

RedHat 5.4 Under the Web server architecture source code construction Lamp Environment and application Phpwind http://www.linuxidc.com/Linux/2012-10/72484p2.htm

Lamp source Environment Build Web server linux+apache+mysql+php http://www.linuxidc.com/Linux/2013-05/84882.htm

Lamp+xcache Environment Construction Http://www.linuxidc.com/Linux/2014-05/101087.htm

--------------------------------------Split Line--------------------------------------

Specific installation steps:

1, install the C + + compilation related components first:

Just installed in the Ubuntu system already has GCC, but this gcc what files can not compile, because there are no necessary header files, so to install build-essential This package, installed this package will automatically install the G++,libc6-dev, Linux-libc-dev,libstdc++6-4.1-dev and so on some necessary software and header files of the library.

To install the required packages:

sudo apt-get install build-essential

2, compile and install Apr

(1) First download Apr: Address: http://mirror.esocc.com/apache/apr/

Storage location:/usr/local/src/apr-1.5.1.tar.gz

(2) #cd/USR/LOCAL/SRC

(3) #tar-ZXVF apr-1.5.1.tar.gz

(4) #cd apr-1.5.1

(5) #./configure-prefix=/usr/local/apr

(6) #make

(7) #make Install

3, then compile and install Apr-util, similar to the previous installation Apr

(1) First download Apr-util: Address with apr:http://mirror.esocc.com/apache/apr/

Storage location:/usr/local/src/apr-util-1.5.3.tar.gz

(2) #cd/USR/LOCAL/SRC

(3) #tar-ZXVF apr-util-1.5.3.tar.gz

(4) #cd apr-util-1.5.3

(5) #./configure-prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR//This is an APR. installation path

(6) #make

(7) #make Install

4, then compile and install Pcre

(1) First download pcre: Address: http://sourceforge.net/projects/pcre/files/pcre/

Storage location:/usr/local/src/pcre-8.35.tar.gz

(2) #cd/USR/LOCAL/SRC

(3) #tar-ZXVF pcre-8.35.tar.gz

(4) #cd pcre-8.35

(5) #./configure-prefix=/usr/local/pcre

(6) #make

(7) #make Install

5, install Zlib-devel

#apt-get Install Zlib1g-dev

Zlib-devel is a redhat/fedora name, Zlib1g-dev and Libz-dev are the Debian/ubuntu names (Zlib1g-dev provides libz-dev wh Ich is a virtual package).

Or:

(1) Download zlib: Address: http://sourceforge.net/projects/libpng/files/zlib/

Storage Address:/home/xxx/downloads

#cp/HOME/XXX/DOWNLOADS/ZLIB-1.2.8.TAR.GZ/USR/LOCAL/SRC

#cd/USR/LOCAL/SRC

#tar-ZXVF zlib-1.2.8.tar.gz

#cd zlib-1.2.8

#./configure-prefix=/usr/local/zlib

#make && make Install

6, finally compile and install Apache

(1) Download Apache, Address: http://httpd.apache.org/download.cgi

Storage location:/home/xxx/downloads

#cd/home/xxx/downloads

#cp HTTPD-2.4.9.TAR.GZ/USR/LOCAL/SRC

#cd/USR/LOCAL/SRC

#tar-ZXVF httpd-2.4.9.tar.gz//Decompression

#cd httpd-2.4.9

#./configure-prefix=/usr/local/apache2--enable-deflate--enable-expires--enable-headers--enable-modules=most-- Enable-so--with-mpm=worker--enable-rewrite--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util-- With-pcre=/usr/local/pcre

#echo $? Check if there is an error

#0//Return 0 description no problem.

#make

#make Install

above./cofigure The following parameter description:

#--prefix=<install_path> indicates that the compiled binaries are installed into the <Install_Path> directory, replacing <INSTALL_PATH> with the actual installation path, such as--prefix=/ usr/local/apache-2.4.9, if this configuration parameter is omitted, it is installed by default to/usr/local/apache2.

#--ENABLE-SO indicates that the compiled dynamic load module (DSO) supports the httpd binary file, which enables the Apache modules to be compiled separately from the core and dynamically loaded at runtime. With DSO support, upgrading and adding modules requires only compiling the relevant modules, without recompiling the entire system. The latest version of Apache compiles this module to httpd binaries by default, and if you are using an earlier version of Apache and need DSO support, you may want to explicitly indicate this option.

#--enable-mods-shared=<module-list> explicitly indicates that modules to be compiled in DSO,<module-list> a space-delimited list of module names, all or Most,all to include all modules , most represents the inclusion of most modules, such as--enable-mods-share= "Rewritedeflate",--enable-mods-share=most, with the same effect as multiple--enable-<feature>= Share

#--with-mpm=<mpm> the Apache multi-path processing module, <mpm>={beos|event|worker|prefork|mpmt_os2},prefork is the default processing module under UNIX system, It will run a non-threaded, pre-derived Web server that is suitable for systems that do not have a thread-safe library and need to avoid thread-compatibility issues, and it is the best mpm to require each request to be independent of each other, so that if a request has a problem it will not affect other requests. The worker is a multi-threaded multi-process module that supports mixed multithreading, because the threads are used to process requests, and the overhead of system resources is less than the process-based MPM, and it uses multiple processes, each with multiple threads, to obtain the stability of the process-based MPM. If your system is thread-safe, then I recommend using a worker instead of prefork, which will give your system real performance improvements.

Installation is complete.

Linux installation Apache

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.