210 # Include conf.d/*.conf
1033 <VirtualHost *:80>
1034 servername www1.shncompany.net
1035 documentroot /var/shnwwwv1
1036 </VirtualHost>
1037
1038 <VirtualHost *:80>
1039 servername www2.shncompany.net
1040 documentroot /var/shnwwwv2
1041 <Directory "/var/shnwwwv2">
1042 Options Indexes MultiViews
1043 AllowOverride all
1044 Order allow,deny
1045 Allow from all
1046 </Directory>
1047 </VirtualHost>
210: 关闭SSL加密 在使用HTTPS时在打开
1034: ServerName 域名
1035: documentroot 资源目录路径
1043: AllowOverride All 允许 .htaccess 覆盖配置。
创建证书
bash复制代码
# openssl req -x509 -days 365 -newkey rsa:2048 -nodes -keyout /etc/httpd/conf.d/shnserver.key -out /etc/httpd/conf.d/shnserver.crt // 创建 SSL
Generating a 2048 bit RSA private key
.............................................+++
....+++
writing new private key to '/etc/vsftpd/vsftpd.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:cn // 国家
State or Province Name (full name) [Berkshire]:ln // 省
Locality Name (eg, city) [Newbury]:ltu // 城市
Organization Name (eg, company) [My Company Ltd]:soft // 组织
Organizational Unit Name (eg, section) []:network // 单位名称
Common Name (eg, your name or your server's hostname) []:localhost // 主机名称
Email Address []: