【apache http server安裝】CentOS上編譯安裝Aapche Http Server詳細過程

來源:互聯網
上載者:User

標籤:apache http server   安裝   

  1. 下載apache httpd

# wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.10.tar.gz

 

2. 解壓 apache httpd

# tar xzvf httpd-2.4.10.tar.gz

  1. 編譯apache httpd

[[email protected]]# ./configure

checkingfor chosen layout... Apache

checkingfor working mkdir -p... yes

checkingfor grep that handles long lines and -e... /bin/grep

checkingfor egrep... /bin/grep -E

checkingbuild system type... i686-pc-linux-gnu

checkinghost system type... i686-pc-linux-gnu

checkingtarget system type... i686-pc-linux-gnu

configure:

configure:Configuring Apache Portable Runtime library...

configure:

checkingfor APR... no

configure:error: APR not found.  Please read thedocumentation.

說明需要先安裝apr, apr-util和prce後再編譯httpd

 

3. 安裝apr

# wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.1.tar.gz

# wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.3.tar.gz

 

#tar xzvf apr-1.5.1.tar.gz

#cd apr-1.5.1.tar.gz

# ./configure--prefix=/usr/local/apr

#make

#make install

 

安裝apr-util

#tar xzvf apr-util-1.5.3.tar.gz

#cd apr-util-1.5.3

# ./configure --prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-config

#make

#make install

 

4. 安裝c++編譯器

yum -y install gcc

# yum -y install gcc-c++

 

5. 安裝prce

#wget  http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.35%2F&ts=1407339176&use_mirror=jaist

# tar xzvf pcre-8.35.tar.gz

 

#cd pcre-8.35

#./configure --prefix=/usr/local/pcre

#make & make install

6. 編譯httpd

# ./configure --prefix=/usr/local/apache2--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/  --with-pcre=/usr/local/pcre

#make & make install

 

7. 將80連接埠在防火牆上關閉或者關閉防火牆

#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT  

#/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT  

#/etc/rc.d/init.d/iptables save 

重啟電腦後,防火牆預設已經開放了80和22兩個連接埠。

 

臨時性的完全關閉防火牆,可以不重啟機器:

#/etc/init.d/iptables status                ##查看防火牆狀態

#/etc/init.d/iptable stop                   ## 本次關閉防火牆

#/etc/init.d/iptable restart               ## 重啟防火牆


或者永久性關閉防火牆:

#chkconfig --level 35 iptables off   ## 注意中間的是兩個英式小短線;重啟

 

8. 啟動apache httpd

/usr/local/apache2/bin/apachectl

9. 在瀏覽器中輸入:http://192.168.146.128/  顯示It works 頁面則表示apachehttp server安裝成功了!

 


 

 

 


本文出自 “開普技術” 部落格,請務必保留此出處http://kypulo.blog.51cto.com/9227739/1536675

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.