標籤:$path org for dev 解壓 apache eve message tar.gz
1.環境介紹
系統:2.6.32-279.el6.i686
2.準備編譯環境
[[email protected] ~]# yum groupinstall "Server Platform Development" "Development tools" -y[[email protected] ~]# yum install pcre-devel -y
3.下載安裝需要軟體
[[email protected] ~]# cd /usr/src #切換到src目錄[[email protected] ~]# wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz #下載apr檔案[[email protected] src]# wget ftp://ftp.mirrorservice.org/sites/ftp.apache.org/apr/ apr-util-1.5.4.tar.gz #下載apr-util檔案[[email protected] src]# wget http://mirrors.cnnic.cn/apache//httpd/ httpd-2.4.25.tar.bz2 #下載httpd檔案[[email protected] src]# lsapr-1.5.2.tar.gz apr-util-1.5.4.tar.gz debug httpd-2.4.25.tar.bz2 kernels
4.安裝apr,apr-tuil
[[email protected] src]# tar xf apr-1.5.2.tar.gz #解壓[[email protected] src]# cd apr-1.5.2[[email protected] apr-1.5.2]# ./configure --prefix=/usr/local/apr/ #編譯[[email protected] apr-1.5.2]# make && make install #安裝
[[email protected] src]# tar xf apr-util-1.5.4.tar.gz [[email protected] src]# cd apr-util-1.5.4[[email protected] apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr [[email protected] apr-1.5.2]# make && make install
5.編譯httpd
[[email protected] src]# tar xf httpd-2.4.25.tar.bz2 [[email protected] src]# cd httpd-2.4.25[[email protected] httpd-2.4.25]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-modules=most --enable-mpms-shared=all --with-mpm=event --with-include-apr[[email protected] httpd-2.4.25] make && make install
6.其他必要的配置
[[email protected] httpd-2.4.25]# ln -sv /etc/httpd24/ /etc/httpd #建立符號連結`/etc/httpd‘ -> `/etc/httpd24/‘[[email protected] httpd-2.4.25]# vim /etc/profile.d/httpd.sh #添加path變數[[email protected] httpd-2.4.25]# cat /etc/profile.d/httpd.sh export PATH=/usr/local/apache/bin:$PATH[[email protected] httpd-2.4.25]# source /etc/profile.d/httpd.sh #生效httpd.sh檔案[[email protected] httpd-2.4.25]# httpd -v #查看版本Server version: Apache/2.4.25 (Unix)Server built: Apr 3 2017 19:00:32[[email protected] httpd-2.4.25]# vim /etc/man.config #配置man文檔#添加行MANPATH /usr/local/apache/man
7啟動httpd
[[email protected] httpd-2.4.25]# apachectl start #啟動AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using localhost.localdomain. Set the ‘ServerName‘ directive globally to suppress this messagehttpd (pid 2863) already running[[email protected] httpd-2.4.25]# elinks -source 192.168.168.152 #測試網頁<html><body><h1>It works!</h1></body></html>
httpd的編譯安裝