Installation of Apache under Linux

Source: Internet
Author: User

Apache is the name of a foundation, and HTTPD is the package we need to install.

Apr and apr-util are a common function library, it makes httpd can not relate to the underlying operating system platform, can be easily ported, if you do not install the two, httpd will not work.

Steps

1. Download httpd, Apr and Apr-util

wget Http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gzwget http://mirrors.cnnic.cn/apache/apr/ Apr-1.6.3.tar.gzwget http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.bz2



2, decompression httpd, Apr and Apr-util

Tar zxvf httpd-2.4.29.tar.gztar zxvf apr-1.6.3.tar.gztar jxvf apr-util-1.6.1.tar.bz2



3. Install Apr

Cd/usr/local/src/apr-1.6.3./configure-prefix=/usr/local/aprmake && make Install



4, Installation Apr-util

Cd/usr/local/src/apr-util-1.6.1./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR


(Install apr-util dependent APR)

The installation process may cause the following error

Libtool:link:cannot Find the library '/usr/local/src/apr-util-1.6.1/xml/expat/libexpat.la ' or unhandled argument '/usr /local/src/apr-util-1.6.1/xml/expat/libexpat.la ' make:*** [libaprutil-1.la] Error 1


The solution is:

Yum Install-y expat-devel



5, installation httpd

Cd/usr/local/src/httpd-2.4.29./configure \//The backslash here is an escape character, plus he can write a line of commands into multiple lines--prefix=/usr/local/apache2.4--with-apr=/ USR/LOCAL/APR--with-apr-util=/usr/local/apr-util--enable-so--enable-mods-shared=most



Here--prefix specify the installation directory,

--enable-so means that enabling DSO,DSO means displaying certain functions in the form of modules.

--enbale-mods-shared=most indicates that most of the feature modules are installed in a shared manner and will be visible under the modules directory after installation.


To avoid make errors, install some library files in advance

Yum install-y pcre Pcre-devel


Compile

Makemake Install



After the installation is complete, you can view the module files under modules

Ls/usr/local/apache2.4/modules



These modules are not fully loaded and can be configured in the configuration file if you want to use which modules.

See which modules are loaded:

/usr/local/apache2.4/apachectl-m


Or

/usr/local/apache2.4/httpd-m





Installation of Apache under 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.