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