httpd的編譯安裝

來源:互聯網
上載者:User

標籤:$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的編譯安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.