RHEL6.6下面搭建LAMP環境(之__Apache源碼安裝)

來源:互聯網
上載者:User

標籤:rehl6.6 linux apache

本文使用軟體:

Red Hat Enterprise Linux 6.6  httpd-2.4.20


第一:Apache 安裝  :

下載Apache安裝包和依賴包

http://mirrors.hust.edu.cn/apache//httpd/   httpd-2.4.20.tar.gz
http://apr.apache.org/download.cgi  apr-1.5.2.tar.gz   apr-util-1.5.4.tar.gz apr-iconv-1.2.1.tar.gz
http://exim.mirror.fr/pcre/    pcre-8.38.tar.gz
http://www.zlib.net   zlib-1.2.8.tar.gz        

      

(1) 安裝apr
tar -zxvf apr-1.5.2.tar.gz
 ./configure --prefix=/usr/local/apr
make
make install

(2) 安裝apr-iconv
tar -zxvf apr-iconv-1.2.1.tar.gz
./configure --prefix=/usr/local/apr-iconv/ --with-apr=/usr/local/apr
make
make install

(3)、安裝apr-util

tar -zxvf apr-util-1.5.4.tar.gz
# ./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr --with-apr-iconv=/usr/local/apr-iconv/bin/apriconv
# make
# make install
(4) 安裝 pcre
# tar -zxvf pcre-8.38.tar.gz
# ./configure --prefix=/usr/local/pcre
# make
# make install

(5)
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --prefix=/usr/local/zlib/
make
make install


(6) 安裝apache
tar -zxvf httpd-2.4.20.tar.gz
cd httpd-2.4.20

./configure --prefix=/usr/local/apache2  --enable-ssl --enable-rewrite --enable-so --enable-headers --enable-expires --with-mpm=worker --enable-modules=most --enable-deflate --with-z=/usr/local/zlib/ --with-apr=/usr/local/apr  --with-apr-util=/usr/local/apr-util/  --with-pcre=/usr/local/pcre/ --enable-ssl
make
make install


vi /usr/local/apache2/conf/httpd.conf
ServerName localhost:80
<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>

配置開機啟動
echo "/usr/local/apache2/bin/apachectl start">>/etc/rc.local

cp /usr/local/apache2/bin/httpd /etc/init.d/
chmod a+x /etc/init.d/httpd

配置環境變數
vi ~/.bash_profile
    PATH=$PATH:$HOME/bin:/usr/local/apache2/bin
    export PATH

 source ~/.bash_profile


驗證:

/usr/local/apache2/bin/apachectl start  啟動apache

在瀏覽器中輸入http://localhost  

顯示:IT works  說明apache部署正常

RHEL6.6下面搭建LAMP環境(之__Apache源碼安裝)

聯繫我們

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