《Apache之虛擬主機的配置》 RHEL6 3

2022-04-03 23:30:44 字數 1187 閱讀 9161

1、安裝httpd軟體包:

2、啟動apache服務:

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服務:

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

apache.example.com      192.168.0.1

redhat.example.com       192.168.0.1

11測試是否成功:

apache虛擬主機配置

之前已經在csdn上上傳過apache的文件在這裡補充說明一下,apache2.2.x與tomcat或iis或三者之間的虛擬主機配置。介紹一下如何整合其他 web伺服器,如 iis tomcat 等。網上有 n多整合方案講的都不是很清楚 特別是 windows 下的 這裡要特別提示一下,apache...

apache虛擬主機配置

多個網域名稱 伺服器 對應乙個 ip 位址,配置方法為 namevirtualhost 111.22.33.44 servername www.sample.com documentroot www sample servername www.sample2.com documentroot www...

apache配置虛擬主機

namevirtualhost 80 directoryindex default.php index.html index.php index.htm servername www.host1.com servername host1 com documentroot d wamp www1 er...