Linux安裝HTTPD服務

1、掛載ISO鏡像

在根目錄下新建一個mount-point文件夾,將CD掛給該文件夾:

<pre name="code" class="html">#mount /dev/cdrom /mount-point
#ls

如何在OEL5.7安裝httpd服務 - 心比天高命比紙薄 - 心比天高命比紙薄


2、更改YUM源

yum源文件的位置在/etc/yum.repos.d/xxx.repo,編輯該文件,並且將如下內容添加到該文件中:

[oel-5.7]
name=OL5.7 x86_64 dvd - server(名字是Linux鏡像的名稱)
baseurl=file:///mount-point/Server
enabled=1
ggkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1

[oel-5.7-cluster]
name=OL5.7 x86_64 dvd -cluster
baseurl=file:///mount-point/Cluster
enabled=1
ggkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1

[oel-5.7-ClusterStorage ]
name=OL5.7 x86_64 dvd - clusterstorage
baseurl=file:///mount-point/ClusterStorage
enabled=1
ggkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1

[oel-5.7-vt]
name=OL5.7 x86_64 dvd - vt
baseurl=file:///mount-point/VT
enabled=1
ggkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
保存文件並退出。

3、安裝HTTPD服務

運行#yum install httpd

按照屏幕出現的提示,安裝缺少的RPM包

如何在OEL5.7安裝httpd服務 - 心比天高命比紙薄 - 心比天高命比紙薄

 
如何在OEL5.7安裝httpd服務 - 心比天高命比紙薄 - 心比天高命比紙薄
 
如何在OEL5.7安裝httpd服務 - 心比天高命比紙薄 - 心比天高命比紙薄


如何在OEL5.7安裝httpd服務 - 心比天高命比紙薄 - 心比天高命比紙薄


4、檢測是否安裝成功

服務器的web地址欄裏面輸入http://127.0.0.1如果出現下面的圖片,就說明成功了。

如何在OEL5.7安裝httpd服務 - 心比天高命比紙薄 - 心比天高命比紙薄

5、啓停服務

啓動——service httpd start
停止——service httpd stop
狀態——service httpd status

6、設置httpd自啓動

#chkconfig --list | grep httpd (查看httpd的狀態)
#chkconfig --level 3 httpd on (將httpd服務設置爲開機啓動)

如何在OEL5.7安裝httpd服務 - 心比天高命比紙薄 - 心比天高命比紙薄





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章