取消注释
[root@node2 ~]# cd /usr/local/apache/conf/
[root@node2 conf]# vim httpd.conf
#LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule ssl_module modules/mod_ssl.so //删除#
#LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
# Virtual hosts
Include conf/extra/httpd-vhosts.conf //删除#
修改文件
[root@node2 ssl]# cd ..
[root@node2 conf]# vim extra/httpd-vhosts.conf
[root@node2 conf]# tail -17 extra/httpd-vhosts.conf
#
<VirtualHost *:80>
DocumentRoot "/usr/local/apache/htdocs/www.ccllss.com"
ServerName www.ccllss.com
ErrorLog "logs/www.ccllss.com-error_log"
CustomLog "logs/www.ccllss.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/usr/local/apache/htdocs/www.ccllss.com"
ServerName www.ccllss.com
ErrorLog "logs/www.ccllss.com-error_log"
CustomLog "logs/www.ccllss.com-access_log" common
</VirtualHost>
[root@node2 conf]#
创建目录 移动文件 重新启动服务
[root@node2 conf]# mkdir -p /usr/local/apache/htdocs/{www.ccllss.com,blog.ccllss.com}
[root@node2 conf]# ls /usr/local/apache/htdocs
blog.ccllss.com index.html www.ccllss.com
[root@node2 conf]#
[root@node2 conf]# mv /var/www/html/blog/* /usr/local/apache/htdocs/blog.ccllss.com/
[root@node2 conf]# mv /var/www/html/www/* /usr/local/apache/htdocs/www.ccllss.com/
[root@node2 conf]# apachectl stop
[root@node2 conf]# apachectl start
[root@node2 conf]#
修改httpd.conf 文件
[root@node2 conf]# vim httpd.conf
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf //删除注释
#
#LoadModule cache_socache_module modules/mod_cache_socache.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so //删除注释
#LoadModule socache_dbm_module modules/mod_socache_dbm.so
修改文件extra/httpd-ssl.conf
[root@node2 conf]# vim extra/httpd-ssl.conf
# General setup for the virtual host
DocumentRoot "/usr/local/apache/htdocs/www.ccllss.com"
ServerName www.ccllss.com:443
ServerAdmin you@example.com
ErrorLog "/usr/local/apache/logs/www.ccllss.com_error_log"
TransferLog "/usr/local/apache/logs/www.ccllss.com_access_log"
# SSL Engine Switch:
SSLCertificateFile "/usr/local/apache/conf/ssl/httpd.crt"
#SSLCertificateFile "/usr/local/apache/conf/server-dsa.crt"
#SSLCertificateFile "/usr/local/apache/conf/server-ecc.crt"
SSLCertificateKeyFile "/usr/local/apache/conf/ssl/httpd.key"
#SSLCertificateKeyFile "/usr/local/apache/conf/server-dsa.key"
#SSLCertificateKeyFile "/usr/local/apache/conf/server-ecc.key"
重启服务
[root@node2 conf]# apachectl stop
[root@node2 conf]# apachectl start
[root@node2 conf]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 128 *:443 *:*
LISTEN 0 128 *:8080 *:*
LISTEN 0 128 *:80 *:*
[root@node2 conf]#