Linux Install Apache Httpd__linux

Source: Internet
Author: User
Tags bz2 documentation file permissions

I thought it was a simple process to install Apache under Linux. Three orders can be done, JXVF decompression, make compiled, made install installed on the OK. I did not think this process is still quite a lot of difficulty. Maybe it's about the environment. Let's talk about my environment first.

---------------------------

linux:cenos5.5 (Verify 4.8 will also encounter the following issues)

apache:httpd-2.4.1.tar.bz2

---------------------------

[Root@localhost apache]# tar jxvf httpd-2.4.1.tar.bz2//Unzip the Apache compression pack
[root@localhost apache]# CD httpd-2.4.1//Navigate to httpd-2.4.1 folder
[root@localhost httpd-2.4.1]# ls//view display httpd-2.4.1 folder contents
[Root@localhost httpd-2.4.1]#./configure--help | More//View install Apache configuration parameters
[Root@localhost httpd-2.4.1]#./configure--prefix=/usr/local/apache--enable-so//Configure Apache path, followed by the--enable-so parameter table Show Apache Core Load DSO

[Root@localhost httpd-2.4.1]# make//compile Apache

There was a mistake. Tips:

Configure:error:APR not found. Please read the documentation

can be downloaded to apr-1.4.6.tar.gz on the Apache website

Resolve Apr not found problem >>>>

Apr and apr-util download Address: http://apr.apache.org/download.cgi

[Root@localhost apache]# tar-zxf apr-1.4.6.tar.gz

[Root@localhost apache]# CD apr-1.4.6

[Root@localhost apr-1.4.6]#./configure--prefix=/usr/local/apr

[Root@localhost apr-1.4.6]# make

[Root@localhost apr-1.4.6]# make install

After the installation is complete, then compile Apache

[Root@localhost httpd-2.4.1]# make

There was a mistake again. Tips:

Configure:error:apr-util not found. Please read the documentation

All right. or the above Apache website address to download apr-util-1.4.1.tar.gz

solve Apr-util not found problem >>>>

[Root@localhost apache]# tar-zxf apr-util-1.4.1.tar.gz

[Root@localhost apache]# CD apr-util-1.4.1

[Root@localhost apr-util-1.4.1]#./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/ Apr-1-config

[Root@localhost apr-util-1.4.1]# make
[Root@localhost apr-util-1.4.1]# make install

To compile Apache again, make an error again. Tips:

configure:error:pcre-config for Libpcre not found. PCRE are required and available from http://pcre.org/ , the correlation between my x!linux installation software can sometimes crash.

.. /configure still prompts Apr-util not found, adding--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util after the occurrence of >>> >>

[root@localhost apache]#./configure–help | grep pcre

--with-pcre=path Use external Pcre library
Download Address: http://ftp.exim.llorien.org/pcre/

Download Pcre-8.30.zip, List files more, the General browser will have a search function, you can ctrl+f search location after downloading.

[Root@localhost Apache] #unzip-o pcre-8.30.zip

[Root@localhost Apache] #cd pcre-8.30

[Root@localhost pcre-8.30]#./configure--prefix=/usr/local/pcre

[Root@localhost pcre-8.30] #make

[root@localhost pcre-8.30] #make Install

Compiling Apache

[Root@yahoo httpd-2.3.12-beta]# ./configure--prefix=/usr/local/apache2--WITH-APR=/USR/LOCAL/APR-- with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre

Note that the following parameters must be consistent with the previous installation of the APR and the Apr-util path.

[Root@localhost httpd-2.4.1]# make
[Root@localhost httpd-2.4.1]# make install

This compile installation should not report any errors again. Ha ha..

Start Apache

[Root@localhost bin]# pwd

/usr/local/apache/bin

[Root@localhost bin]# Apachectl Stop

[Root@localhost bin]# apachectl start

See if Port 80 is occupied

[Root@localhost conf] #netstat-an | Grep:80

To see if the Apache startup service starts

[Root@localhost bin]# Ps-aux | grep httpd

Warning:bad syntax, perhaps a bogus '-'? See/usr/share/doc/procps-3.2.7/faq

Root 2866 0.0 1.2 25164 9556? Ss 22:45 0:00/usr/sbin/httpd-k Start

Apache 2867 0.0 0.7 25300 5556? S 22:45 0:00/usr/sbin/httpd-k Start

Apache 2868 0.0 0.6 25300 5444? S 22:45 0:00/usr/sbin/httpd-k Start

Apache 2869 0.0 0.6 25300 5444? S 22:45 0:00/usr/sbin/httpd-k Start

Apache 2870 0.0 0.7 25300 5556? S 22:45 0:00/usr/sbin/httpd-k Start

Apache 2871 0.0 0.6 25164 4796? S 22:45 0:00/usr/sbin/httpd-k Start

Apache 2872 0.0 0.6 25164 4796? S 22:45 0:00/usr/sbin/httpd-k Start

Apache 2873 0.0 0.6 25164 4796? S 22:45 0:00/usr/sbin/httpd-k Start

Apache 2874 0.0 0.6 25164 4796? S 22:45 0:00/usr/sbin/httpd-k Start

Root 3141 0.0 0.0 4244 676 pts/1 r+ 22:48 0:00 grep httpd

The following is a visit to the Apache default page to open. Http://ip:80/index.html

Also prompted the error:

is the port occupied. To modify Apache configuration files

/usr/local/apache/conf/httpd.conf configuration file

[root@localhost conf] VI httpd.conf

Locate the following line:

Listen 80 Convert 80 to other ports, such as 8080 or 8,800, if they are not occupied.

Locate the following line:

ServerName www.example.com:80 IP Add port number, such as: 192.168.0.105:80

Port changed to change, has always reported that error. Since there is no previous experience of installing Apache under Linux, you are looking for an Apache default running page. So, found, .../apache/htdocs/index.html file (misled by Tomcat). Actually, the files in the/var/www/html directory are running.

You don ' t have permission to access/index.html on this server

The real mistake is on the tip. Because my location file permissions are not enough. Then give the file a permission.

Create a file in/var/www/html index.html

[Root@localhost html]# chmod 766 index.html

Ok! again to the location of Apache, the page opened normally. The process is very tangled, the ending is very good.

-----------Summary--------------

Files that need to be installed:

apr-1.4.6

apr-util-1.4.1.tar.bz2

Pcre-8.30.zip

/usr/local/apache Apache installation directory

/usr/local/apache/conf/httpd.conf configuration file

/usr/local/apache/bin/apachectl Stop/start Stop/Start program

/var/www/html/to create a page that can be accessed under this folder


Apache installation problem Kam Set

Issue 1: Missing package gcc-c++ causes installation package Apr-util not to pass

[Root@getlnx05 kerry]# Unzip Pcre-8.33.zip

[root@getlnx05 kerry]# CD pcre-8.33

[root@getlnx05 pcre-8.33]#./configure--prefix=/usr/local/apr-util-with-apr=/usr/local/apr/bin/apr-1-config

This error generally occurs because the package gcc-c++ is not installed and can be checked by the following command.

[root@getlnx05 pcre-8.33]# Yum list gcc-c++

Loaded Plugins:product-id, Security, Subscription-manager

Updating Red Hat repositories.

Available Packages

Gcc-c++.x86_64 4.1.2-51.el5 Rhel-debuginfo

[root@getlnx05 pcre-8.33]# Yum list gcc

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.