Apache 配置https詳細(xì)步驟

1、先lsb_release -a? 查看系統(tǒng)版本,不同版本情況很大區(qū)別

[root@iZ23p5a9q9nZ ~]# lsb_release -a

LSB Version::core-4.1-amd64:core-4.1-noarch

Distributor ID:CentOS

Description:CentOS Linux release 7.0.1406 (Core)

Release:7.0.1406

Codename:Core

2、先卸載apache 1,service httpd stop停止Apache ??2、yum list|grep httpd #查看apache包名,例如httpd.x86_64

yum erase httpd.x86_64 ????????#相關(guān)依賴包自動(dòng)會被刪除

3、安裝 httpd : ???yum -y install httpd

安裝openssl ???:yum install openssl

默認(rèn)安裝的路徑為/etc/httpd/

4、然后重啟 ?service httpd restart

5、報(bào)這個(gè)Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration

錯(cuò)誤的時(shí)候運(yùn)行加載mod_ssl yum install mod_ssl

cd /etc/httpd/conf

編輯/etc/httpd/conf/httpd.conf

找到如下內(nèi)容:

#ServerName www.example.com:80

更改為

ServerName localhost:80

把證書拷貝到某個(gè)目錄下

cd /etc/httpd/conf/vhosts.conf

6、添加文件vhosts.conf

vim /etc/httpd/conf.d/vhosts.conf

配置apache

service httpd start

此命令查看啟動(dòng)Apache是報(bào)的詳細(xì)錯(cuò)誤,會提示到哪一行問題 ?systemctl status httpd.service -l

其他查看apache各種狀態(tài)命令

service apache2 restart

service apache2 status

service apache2 reload

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容