Installing Apache in Linux

Source: Internet
Author: User

First, preface

installation of the background is the company's projects to use, their own Linux installation software is not many, the process is more tortuous, need to record (recent blog seems to have this tall on the background) ~ First of all, the author installation environment and related software version:

Operating system: RedHat Enterprise Linux Server release 5.8 (Tikanga)

Apache:httpd-2.4.25.tar.gz

Apr:apr-1.5.2.tar.gz

Apr-util:apr-util-1.5.4.tar.gz

Pcre:pcre-8.40.tar.gz

Second, the text

Download Apache installation package (this article download httpd-2.4.25.tar.gz),: http://httpd.apache.org/
When installing Apache, the original author for different versions of the installation, at compile time is different, configure followed by different parameters, this article is for the installation of httpd-2.4.25.tar.gz

httpd-2.4.25 version compile command:

./configure--prefix=/usr/local/apache2 (can be installed directly after installation directory parameters without any parameters) Makemake install

httpd-2.4.25 version compile command:

./configure--prefix=/usr/local/apache2--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util/--with-pcre =/usr/local/pcre (in addition to specifying the installation directory for Apache, install APR, Apr-util, Pcre, and specify parameters) Makemake install

Error:apr not found, error:apr-util not found, error:pcre-config for Libpcre are present when compiling Apache (problems encountered while installing httpd-2.4.25) Found's problem.

The following is a httpd-2.4.25 of these problems to solve the actual operation of a:

http://apr.apache.org/download.cgi Download apr-1.5.2.tar.gz, apr-util-1.5.4.tar.gz
https://sourceforge.net/projects/pcre/files/Download pcre-8.40.tar.gz ( do not download the beginning of Pcre2, otherwise the installation will not be reported to find Pcre-config script error )
1. Solving Apr not found problem

  [Email protected] bin]# tar-zxf apr-1.5.2.tar.gz  [[email protected] apr-1.5.2]#./configure--prefix=/usr/local/ Apr  [[email protected] apr-1.5.2]# make  [[e-mail protected] apr-1.5.2]# make install

2. Solve Apr-util not found problem

  [Email protected] bin]# tar-zxf apr-util-1.5.4.tar.gz  [[email protected] apr-util-1.5.4]#./configure--prefix=/ Usr/local/apr-util-with-apr=/usr/local/apr/bin/apr-1-config  [[email protected] apr-util-1.5.4]# make  [[ Email protected] apr-util-1.5.4]# make install

3, solve pcre-config for libpcre not found problem

  [Email protected] ~]# tar-zxf pcre-8.40.tar.gz [[  email protected] ~]# CD pcre-8.40  [[email protected] pcre-8.40 ]#./configure--prefix=/usr/local/pcre  [[email protected] pcre-8.40]# make
[[email protected] pcre-8.40]# make install

Apache uses 80 ports by default, so if you have an application that consumes 80 of this port, you should be aware that there is a port conflict problem.
? start Apache:/usr/local/apache2/bin/apachectl start
? stop Apache:/usr/local/apache2/bin/apachectl stop
? Restart Apache:/usr/local/apache2/bin/apachectl restart

In IE through http://localhost:80, if you see "It works!" displayed on the page The word, the Apache authentication is passed. If the index suffix of the Web site is in PHP format, modify the httpd.conf configuration file (/usr/local/apache2/conf) and increase the index.php in DirectoryIndex

Supplemental Instructions *****************************

After installing APR, Arp-util, Pcre, I execute the following command:

  ./configure--prefix=/usr/local/apache2--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util--with-pcre= /usr/local/pcre

  After that, the following error is reported:

Check to find out that seems to be the system comes with the SSL problem, because the installation of the software is basically the latest version, because the system comes with this version of OpenSSL is too low? With a try attitude, re-download a OpenSSL for installation (anyway, foggy), first try again, attach the installation tutorial:

1) https://www.openssl.org/source/Download openssl-1.0.2k.tar.gz

2) #tar-xzf openssl-1.0.2k.tar.gz

3) #cd openssl-1.0.2k

4) Openssl-1.0.2k#./config--prefix=/usr/local/openssl

5) Openssl-1.0.2k#make depend

6) openssl-1.0.2k#cd/usr/local

7)/usr/local# ln-s OpenSSL SSL

8) on the last side of the/etc/ld.so.conf file, add the following:

/usr/local/openssl/lib

9) # Ldconfig

10) Add OPESSL environment variable, in the last line of/etc/profile, add:

Export Openssl=/usr/local/openssl/bin

Export path= $OPENSSL: $PATH: $HOME/bin

11) Execute Source/etc/profile

At this point, OpenSSL installation is complete, and the final execution:

./configure--prefix=/usr/local/apache2--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util--with-pcre= /usr/local/pcre

  Apache installation is complete!

Third, reference links

1, http://blog.csdn.net/dazhi_100/article/details/17143213

2, http://www.cnblogs.com/zhuque/archive/2012/11/03/2763352.html

Installing Apache in Linux

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.