linux下安裝apache詳解

2021-09-02 08:39:44 字數 2046 閱讀 4923

[root@localhost ~]#cd /soft

[root@localhost soft]#tar jxvf httpd-2.2.6.tar.bz2    //解壓apache的壓縮包

[root@localhost soft]#cd httpd-2.2.6     //定位到httpd-2.2.6 資料夾下

[root@localhost httpd-2.2.6]#ls     //檢視顯示httpd-2.2.6 資料夾下內容

[root@localhost httpd-2.2.6]#./configure --help | more    //檢視安裝apache配置引數

[root@localhost httpd-2.2.6]#./configure  --prefix=/usr/local/apache  --enable-so    //  配置apache路徑

[root@localhost httpd-2.2.6]#make     //編譯apache

[root@localhost httpd-2.2.6]#make install    //安裝apache

[root@localhost httpd-2.2.6]#cd /usr/local/apache   //進入apache的目錄     

[root@localhost apache]#  cd conf/

[root@localhost conf]#cp -a httpd.conf httpd.conf-     //備份apache配置檔案

[root@localhost conf]#chkconfig  --list httpd     //檢視httpd服務是否已存在

[root@localhost conf]#chkconfig httpd off    //關閉系統自帶了httpd的服務,如果存在httpd服務   

[root@localhost conf]#service httpd status    //檢視自帶httpd服務狀態

[root@localhost conf]#/usr/local/apache/bin/apachectl -k start    //linux啟動apache命令              

[root@localhost conf]#netstat -an | grep :80    //檢視linux80埠是否開啟

[root@localhost conf]#ps -aux | grep httpd     //linux下檢視apache程序

[root@localhost conf]#cd ../..

[root@localhost local]#cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache //拷貝apache啟動指令碼

[root@localhost local]#vi /etc/rc.d/init.d/apache    // 這裡是編輯apache啟動指令碼

在開頭的#!/bin/sh  下面加上

#chkconfig: 2345  85  15

[root@localhost local]#chkconfig --add apache    //新增apache服務

[root@localhost local]#chkconfig --list apache    //列出apache服務

[root@localhost local]#service apache stop    //停止apache服務

[root@localhost local]#netstat -an | grep :80     //檢視linux的80埠是否關閉

[root@localhost local]#ps -aux | grep httpd     //檢視是否存在httpd服務,若果之前自帶httpd服務啟動的話會導致新新增的apache服務啟動失敗

[root@localhost local]#service apache start    //啟動apache服務

開啟你的伺服器ip位址,看看是否出現了tomcat的預設首頁,如果出現的話,那麼恭喜你

linux下安裝apache已經成功了

linux下安裝boost python詳解

boost.python的安裝 安裝boost boost.python的測試 boost.python 是boost庫的乙個子功能,可以實現python和c c 的無縫銜接。相比於cpython和cython來說boost.python在使用上會更加方便。關於boost.python的詳細內容可參...

linux下安裝apache詳解

下面是linux下安裝apache的完整 系統是redhat5.5 root localhost cd soft root localhost soft tar jxvf httpd 2.2.6.tar.bz2 解壓apache的壓縮包 root localhost soft cd httpd 2....

linux下安裝apache詳解

root localhost cd soft root localhost soft tar jxvf httpd 2.2.6.tar.bz2 解壓apache的壓縮包 root localhost soft cd httpd 2.2.6 定位到httpd 2.2.6 資料夾下 root local...