"Just 3 steps" to manually install Apache and configure (pro-Test)

Source: Internet
Author: User
Tags fully qualified domain name

The REDHAT6 uses the CentOS yum source.

The first step is to download the Apache-dependent package and install

Install Apr
:http://apr.apache.org/download.cgi

Unpacking:tar-jxvf apr-1.5.0. tar.bz2 Note: here the format of the package is tar.bz2 format, if it is in. tar format with TAR-ZXVF + package name command decompression.

Go to the folder in the package and execute the following command in turn:

./configure--prefix=/work/installed/apr ( Note: Configure installed folder directory can be defined by itself )

Make

Make Install

Installing Apr-util
: http://apr.apache.org/download.cgi
Unpacking package: tar-jxvf apr-util-1.5.3. tar.bz2

Go to the folder and execute it in turn:

./configure--prefix=/work/installed/apr-util--with-apr=/work/installed/apr

make

Make install

Installing Pcre
:http://pcre.org/
Unpacking package:tar-jxvf pcre-8.35. tar.bz2

./configure--prefix=/work/installed/pcre

Make

Make Install

Note : If you encounter problems when you install Pcre: Configure:error:You need a C + + compiler for C + + support.
ubuntu solution :sudo apt-get install build- Essential

Solutions for CentOS 6/redhat 6: Yum installation package: Yum install gcc gcc-c++ kernel-devel

The second step installs Apache and configures:

Installation:

: http://httpd.apache.org/
Decompression: TAR-JXVF httpd-2.4.9.tar.bz2

Enter the extracted file and execute:

./configure--prefix=/work/installed/apache--WITH-APR=/WORK/INSTALLED/APR--with-apr-util=/work/installed/ Apr-util--with-pcre=/work/installed/pcre

Make

Make Install

Note: If the installation is wrong and you want to reinstall it, delete the installed folder and then clean the compilation in the extracted folder:

The third step is to configure Apache:

Modify the configuration file, if you do not modify it will start the Apache service, the problem occurs:
AH00558:httpd:Could not reliably determine the server ' s fully qualified domain name, using 127.0.1.1. Set the ' ServerName ' directive globally to suppress this message
Workaround:

To modify a file under the installed directory:

Command: vim/work/installed/apache/conf/httpd.conf
put:
# ServerName WWW.EXAMPLE.COM:80
Switch
ServerName localhost:80

You can then also configure your own publishing home page directory:

You can also add a PHP home page:

If there is a hosts file under/etc/, modify:

Modified files: vi/etc/hosts

Type in the following: 192.168.8.119 server.example.com

IP address to your own IP on the line.

To start the Apache service:

Input command:/work/installed/apache/bin/apachectl start

Auto Start: Vim etc/rc.local

Add:/work/installed/apache/bin/apachectl start Here is the Apache installation directory inside the configuration file, let it boot automatically start on the line!

If not, shut down the firewall: iptables-f

Enter an IP address to see: it works!

However, the firewall must be turned off, so you need to configure the firewall:

Open the configuration file for iptables: vi/etc/sysconfig/iptables

Add a 80 port: (If you customize the port, fill in your own port)

-A rh-firewall-1-input-m state–state new-m tcp-p tcp–dport 80-j ACCEPT

Another yum installation of Apache and Apache is provided for reference only:

Http://www.cnblogs.com/xiaobo-Linux/p/4631675.html


"Just 3 steps" to manually install Apache and configure (pro-Test)

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.