Apache2.4 installation guide and one-click installation script

Source: Internet
Author: User
Tags automake
Apache2.4 installation guide and one-click installation script 1. preface this document attempts to clarify the installation of Apache2.4 in the simplest way. Apache uses the automake compilation method, including the libraries it depends on. because of this dependency, the compilation and installation are slightly more complex. 2. dependency Library Apache dependency... Apache2.4 installation guide and one-click installation script 1. this document attempts to clarify the installation of Apache2.4 in the simplest way. Apache uses the automake compilation method, including the libraries it depends on. because of this dependency, the compilation and installation are slightly more complex. 2. the dependent database Apache depends on apr, apr-util, and pcre. download URL: 1) Apr and Apr-util: http://apr.apache.org/ . As of February 26, apr-1.4.6.tar.gzand apr-util-1.5.1.tar.gz; 2) Pcre: http://pcre.org/ (The actual download URL is http://sourceforge.net/projects/pcre/files/pcre/ And ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ , It is recommended to download from sourceforge.net, and the next one is often popular ). As of, the version is: pcre-8.32.tar.gz. 3. Apache2.4 download URL http://httpd.apache.org/download.cgi#apache24Apache2.4 The source code package for is: httpd-2.4.3.tar.gz (note that the last version 3 may be different ). 4. the installation steps Apr and Apr-util do not need to be specially compiled and installed. they are completed with Apache. see the "install Apache" section below. 4.1. install Pcre before installing Apache. install Pcre in the automake mode. The steps are as follows: 1 ). /configure -- prefix =/usr/local/pcre (note: install Pcre in the/usr/local/pcre directory) 2) make3) make install4.2. install Apache1) upload httpd-2.4.3.tar.gz to the compiling Directory (assuming the compiling directory is/tmp/X, or any other directory). 2) enter the/tmp/X Directory and decompress the source package: tar xzf httpd-2.4.3.tar.gz. after decompression, a httpd-2.4.3 directory will be generated in/tmp/X, there will be a srclib subdirectory under the httpd-2.4.3 directory 3) upload the source package of Apr and Apr-util to the srclib subdirectory 4) go to the srclib subdirectory and decompress the source package of Apr and Apr-util, such as tar xzf. Pr-1.4.6.tar.gz; tar xzf apr-util-1.5.1.tar.gz, note that after decompression the generated Apr and Apr-util directory is with version number 5) rename the Apr and Apr-util Directory, remove the following version number, such: mv apr-1.4.6 apr; mv apr-util-1.5.1 apr-util (described in this official guide) 6) go to the/tmp/X/httpd-2.4.3 Directory, compile Apache in automake mode (note that you need to specify Pcre ):. /configure -- prefix =/usr/local/httpd -- with-pcre =/usr/local/pcre (note:/usr/local/httpd is the installation directory of Apache, can be modified as needed ). 7) execute make to compile the source code. 8) after the compilation is successful, execute make install to install Apache under directory 9 of/usr/local/httpd !!! 5. modify the configuration. If Apache is installed in the/usr/local/httpd Directory, go to the/usr/local/httpd/conf directory. conf is modified as needed. the frequently modified rows include: 1) Listen 802) DocumentRoot "/usr/local/httpd/htdocs" 6. appendix 1: Apache official Chinese document homepage http://httpd.apache.org/docs/2.4/7 . Appendix 2: One-click script 7.1. one-click script prerequisite 1) use root user operations; 2) put the Apr, Apr-util, Pcre, and Apache installation packages in the same directory, for example :~ /App # lsapr-1.4.6.tar.gz apr-util-1.5.1.tar.gz httpd-2.4.3.tar.gz pcre-8.32.tar.gz3) under the Directory do not want to put its suffix is .tar.gz file 7.2. one-click script full text #! /Bin/sh # Writed by yijian on 2012/12/26 # A key to install apache # Download # which wget # if test $? -Ne; then # echo "wget not found" # else # wget" http://mirror.bjtu.edu.cn/apache/apr/apr-1.4.6.tar.gz "# Wget" http://mirror.bjtu.edu.cn/apache/apr/apr-util-1.5.1.tar.gz "# Wget" http://labs.mop.com/apache-mirror/httpd/httpd-2.4.3.tar.gz "# Wget" http://nchc.dl.sourceforge.net/project/pcre/pcre/8.32/pcre-8.32.tar.gz "# Fi # Get namesapr_tar_gz = 'ls | grep-e" apr-[0-9] * \. [0-9] * \. [0-9] * \. tar \. gz "'apr _ util_tar_gz = 'ls | grep-e" apr-util-[0-9] * \. [0-9] * \. [0-9] * \. tar \. gz "'apr = 'basename $ 2.16.tar.gz 'apr _ util = 'basename $ 2.16.tar.gz' httpd = 'basename httpd-* .tar.gz 'pcre = 'basename pcre-* .tar.gz 'echo $ aprecho $ apr_utilecho $ pcreecho $ httpd # unzip filestar xzf extends apr.tar.gz tar xzf extends apr_util.tar. Gztar xzf restart pcre.tar.gz tar xzf restart httpd.tar.gz # Dependsmv $ apr $ httpd/srclib/release F test $? -Ne 0; thenexit 1 fimv $ apr_util $ httpd/srclib/apr-utilif test $? -Ne 0; thenexit 1fi # Compile pcrecd $ pcre./configure -- prefix =/usr/local/pcremakeif test $? -Ne 0; thenexit 1 fimake installif test $? -Ne 0; thenexit 1fi # Compile apachmcm ../$ httpd./configure -- prefix =/usr/local/httpd -- with-pcre =/usr/local/pcreif test $? -Ne 0; thenexit 1 fimakeif test $? -Ne 0; thenexit 1 fimake installif test $? -Ne 0; thenexit 1fi # Congratulationecho "finished" cd/usr/local/httpd/conf

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.