APR Apr-util Apache source code installation and configuration system service

Source: Internet
Author: User
  1. Download the source code package from the official website

    Apr-1.5.1.tar.gz

    Apr-util-1.5.3.tar.gz

    Httpd-2.4.10.tar.gz

  2. The installation user is root.

    Unzip command tar-zxvf httpd-2.4.10.tar.gz

  3. Install Apr, APR-util

./Configure -- prefix =/usr/local/APR

Error: Rm: cannot remove 'libtoolt': no such file or directory

I did not directly ignore it. I have modified Configure on the Internet to solve this problem. I did not try it here.


Make

Make install



./Configure -- prefix =/usr/local/APR-util \

-- With-Apr =/usr/local/APR

Make

Make install


4 install Apache with source code

4.1 Installation

./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-dav --enable-module=so --enable-mods-shared=allmakemake install

4.2 modify the original port 80 to port 8008

Back up CP/usr/local/Apache/CONF/httpd. conf/usr/local/Apache/CONF/httpd. conf. Bak

Modification point: Listen 8008

Servername http: // localhost: 8008

4.3 start Apache

/Usr/local/Apache/bin/apachectl start

Curl http: // 127.0.0.1: 8008

See <HTML> <body>

Successful

4.4 configure the apachectl STATUS Command

Back up CP/usr/local/Apache/CONF/extra/httpd-info.conf/usr/local/Apache/CONF/extra/httpd-info.conf.bak modify httpd-info.conf the entire file modified as follows # get information about the requests being processed by the server # and the configuration of the server. # required modules: mod_authz_core, mod_authz_host, # mod_info (for the server-Info handler), # mod_status (for the server-status handler) # Allow Server Status reports generated by mod_status, # With the URL of http: // servername/Server-status # change the ".example.com" to match your domain to enable. <location/Server-status> sethandler server-status order deny, allow # deny from all allow from all # require host .example.com # require IP 127 </location> # extendedstatus controls whether Apache will generate "full" status # Information (extendedstatus on) or just basic information (extendedstatus # Off) when the "server-status" handler is called. the default is off. # extendedstatus onextendedstatus on <ifmodule mod_info.c> <location/Server-Info> sethandler server-Info order deny, allow # deny from all allow from all </location> </ifmodule> # Allow Remote Server Configuration Reports, with the URL of # http: // servername/Server-Info (requires that mod_info.c be loaded ). # change the ".example.com" to match your domain to enable. #

Modify HTTP. conf

First, check whether there is any

LoadModule status_module modules/mod_status.so

If not, re-compile the search.

Mod_status.so may be a problem with the./configure command and apapche version.

Then modify the configuration file for the httpd-info.conf to take effect

# Real-time info on requests and configuration#Include conf/extra/httpd-info.confInclude conf/extra/httpd-info.conf

Last modified/usr/local/Apache/bin/apachectl

# Statusurl = "change to the following statusurl =" http: // localhost: 8008/Server-status"

./Apachectl status is configured

4.5 Apache configuration system service

# Cp/usr/local/Apache/bin/apachectl/etc/init. d/httpd # cp/usr/local/Apache/bin/apachectl/usr/local/bin/httpd # ln-S/etc/init. d/httpd/etc/rc. d/rc5.d/s61httpd # ln-S/etc/init. d/httpd/etc/rc. d/rc4.d/s61httpd # ln-S/etc/init. d/httpd/etc/rc. d/rc3.d/s61httpd open/etc/init. d/httpd file in #! /Bin/bash add # chkconfig: 345 61 61 # description: run chkconfig -- list | grep httpd in Apache and the HTTPd service starts up and runs at level 345. register the chkconfig service -- add httpd to set the startup level chkconfig -- levels 345 httpd on.

4.6 Access Apache from a non-local machine and open port 8008 on the firewall

/Etc/sysconfig/iptables

Add

-A input-p tcp-M state -- state new-m tcp -- dport 8008-J accept


Restart iptable

/Etc/init. d/iptables restart


View iptable status

/Etc/init. d/iptables status


Finished.

I have referenced a lot of online materials. Thank you for your reference ~~~~

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.