Try CentOS 6.8 installation Apache Service

Source: Internet
Author: User

1. Install the development Tools package Group

Dependency issues need to be addressed before installing the Apache server, such as installing GCC, gcc++, OpenSSL, and so on, as it is done in a virtual machine, where the dependency problem is solved by directly installing the package group.

(1) Mount the installation CD and install the "Development tools" package group

650) this.width=650; "src=" http://i.imgur.com/HpzkNc7.jpg "style=" margin-top:0px;margin-right:0px;margin-bottom:0 px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px; border-right-width:0px;border-bottom-width:0px;border-left-width:0px; "alt=" hpzknc7.jpg "/>

[[email protected] ~]# Mount/dev/cdrom/media mount CD to media directory [[email protected] ~]# cd/etc/yum.repos.d/Configure Yum Source [email Protected] yum.repos.d]# Vim centos-base.repo configuration details [base] only need to keep the base warehouse configuration parameters as follows, other content can be deleted name=centos-$releasever-basebas Eurl=file:///media/gpgcheck=0[[email protected] yum.repos.d]# yum Groupinstall "Development tools" installation package Group

After the installation is successful, you can solve the dependency problem, if your virtual machine is networked, you can skip the Mount step and enter the command directly: Yum Groupinstall "Development tools" installs the package group.

(2) Download and unzip the Apache package

You can download the package from the official Apache website, here to "httpd-2.2.29.tar.bz2" as an example, will download the package uploaded to the virtual machine user home directory, if the virtual machine can be online, can be downloaded by wget command, usage: wget+ space + download URL.

[[email protected] ~]# TAR-XVF httpd-2.2.29.tar.bz2 extract httpd pack

650) this.width=650; "src=" http://i.imgur.com/FFvrIvj.jpg "style=" margin-top:0px;margin-right:0px;margin-bottom:0 px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px; border-right-width:0px;border-bottom-width:0px;border-left-width:0px, "alt=" ffvrivj.jpg "/> Here, Preparations for the formal installation of httpd have been completed.

(3) Installing Apache

Note: Before installing the source package to check the install, Readme file.

1) Configure compilation options:./configure

We can use the command "./configure--help" To view compilation-related options, this compilation only uses the "--prefix" option to specify the program installation directory. Requires CD to the extracted directory

[Email protected] httpd-2.2.29]#/configure--PREFIX=/USR/LOCAL/APACH2

If the compilation is complete without prompting for errors, the compilation is successful, as long as the dependency problem solves this step without any problems.

2) Build Service program: Make
[[email protected] httpd-2.2.29]# make this step takes a long time

650) this.width=650; "src=" http://i.imgur.com/Vuz0oXE.jpg "style=" margin-top:0px;margin-right:0px;margin-bottom:0 px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px; border-right-width:0px;border-bottom-width:0px;border-left-width:0px; "alt=" vuz0oxe.jpg "/>

3) Install the service program: make install (in fact, copy the configuration, manuals and other files to the corresponding path)
[[email protected] httpd-2.2.29]# make install

If there is no error prompt, then complete all the source code compile installation Now, we can check the/USR/LOCAL/APACH2 directory 650) this.width=650; "Src=" http://i.imgur.com/U9z3Zh2.jpg " Style= "margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px; padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px; border-left-width:0px; "alt=" u9z3zh2.jpg "/>

(4) Test Apache
[[email protected] bin]# /usr/local/apach2/bin/apachectl start    Start apache[[ email protected] bin]# /usr/local/apach2/bin/httpd start   This can also start apache[[email  protected] Desktop]$ netstat -natActive Internet connections  (servers  and established) proto recv-q send-q local address                Foreign Address              State      tcp         0      0 127.0.0.1:6010               0.0.0.0:*                    LISTEN        tcp        0      0  192.168.184.130:59364       213.198.96.137:80            established tcp        0       0 192.168.184.130:22           192.168.184.1:49614         ESTABLISHED      tcp        0      0  :::80                        :::*                          LISTEN       tcp        0      0 :::22                        :::*                           LISTEN      tcp         0      0 ::1:631                      :::*                           listen

You can see that port 80 is listening (LISTEN), indicating that Apache boot is successful, or you can enter your virtual machine IP address view in the virtual machine GUI (note shutting down the firewall)

650) this.width=650; "src=" http://i.imgur.com/kBcXsyZ.jpg "style=" margin-top:0px;margin-right:0px;margin-bottom:0 px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px; border-right-width:0px;border-bottom-width:0px;border-left-width:0px; "alt=" kbcxsyz.jpg "/>


Try CentOS 6.8 installation Apache Service

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.