歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> rhel6.3使用yum安裝apache的方法

rhel6.3使用yum安裝apache的方法

日期:2017/3/1 17:59:53   编辑:Linux技術

1、安裝httpd軟件包:

Yum install httpd

2、啟動apache服務:

[root@redhat Desktop]# /etc/init.d/httpd start

Starting httpd: [ OK ]

3、安裝mod-ssl軟件包

[root@redhat Desktop]# yum install mod_ssl –y

4、創建一個/date/www/html的目錄、並且修改安全上下文:

Chcon –t httpd_sys_content_t /date/ -R(l臨時修改都行)

5、在/date/www/html下添加一個apache可執行的文件:

6、在/var/www/html下添加一個可執行的文件

7、配置Apache的配置文件:(注意打開80端口)

8、配置ssl的配置文件:(注意添加 加密那2行)

9、重啟apache服務:

[root@redhat conf.d]# /etc/init.d/httpd restart

Stopping httpd: [ OK ]

Starting httpd: [ OK ]

[root@redhat conf.d]#

10、配置域名解析:/etc/hosts

apache.example.com 192.168.0.1

redhat.example.com 192.168.0.1

11測試是否成功:

Copyright © Linux教程網 All Rights Reserved