linux下使用最多的web伺服器軟體要算apache了。
linux下安裝apache詳解
下面是linux下安裝apache的完整程式碼,系統是redhat5.5
點此檢視詳細圖文教程
下載httpd-2.2.6.tar.bz2 把httpd-2.2.6.tar.bz2放到/soft 下
[root@localhost ~]#cd /soft
[root@localhost soft]#tar jxvf
httpd-2.2.6.tar.bz2 //解壓apache的壓縮包
[root@localhost
soft]#cd
[root@localhost soft]#cd
httpd-2.2.6 //定位到httpd-2.2.6 資料夾下
httpd-2.2.6]#ls //檢視顯示httpd-2.2.6 資料夾下內容
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
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服務
conf]#service httpd status //檢視自帶httpd服務狀態
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下使用最多的web伺服器軟體要算apache了。
linux下安裝apache詳解
下面是linux下安裝apache的完整程式碼,系統是redhat5.5
點此檢視詳細圖文教程
下載httpd-2.2.6.tar.bz2 把httpd-2.2.6.tar.bz2放到/soft 下
[root@localhost ~]#cd /soft
[root@localhost soft]#tar jxvf
httpd-2.2.6.tar.bz2 //解壓apache的壓縮包
[root@localhost
soft]#cd
下面是linux下安裝apache的完整程式碼,系統是redhat5.5
點此檢視詳細圖文教程
下載httpd-2.2.6.tar.bz2 把httpd-2.2.6.tar.bz2放到/soft 下
[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已經成功了