Apache 是用 lnmp1.5 一键安装包配置的
vhost 里的 a.example.com.conf 配置如下
<VirtualHost *:80>
ServerAdmin [email protected]
php_admin_value open_basedir "/var/www/html/a:/tmp/:/var/tmp/:/proc/"
DocumentRoot "/var/www/html/a"
ServerNamen a.example.com
ErrorLog "/home/wwwlogs/a.example.com-error_log"
CustomLog "/home/wwwlogs/a.example.com-access_log" combined
<Directory "/var/www/html/a">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin [email protected]
php_admin_value open_basedir "/var/www/html/a:/tmp/:/var/tmp/:/proc/"
DocumentRoot /var/www/html/a
ServerName a.example.com:443
ErrorLog "/home/wwwlogs/a.example.com-error_log"
CustomLog "/home/wwwlogs/a.example.com-access_log" combined
SSLEngine on
SSLCertificateFile /usr/local/apache/conf/ssl/a.example.com/a.example.com.cer
SSLCertificateKeyFile /usr/local/apache/conf/ssl/a.example.com/a.example.com.key
SSLCertificateChainFile /usr/local/apache/conf/ssl/a.example.com/ca.cer
Protocols h2 h2c http/1.1
<Directory "/var/www/html/a">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
</Directory>
</VirtualHost>
1
also24 2018-11-08 02:11:46 +08:00
先贴个配置出来嘛~
|
2
xmlf 2018-11-08 07:38:11 +08:00 via Android
我最近也遇到这样奇怪的事
|
3
PressOne 2018-11-08 08:24:55 +08:00 via Android
应该是证书的问题,是免费的证书吗?
|
5
Mayuri OP @also24 aa.com 不太好看 我换成 example.com 。。
```httpd-vhost.conf ``` 配置如下 ``` <VirtualHost *:80> ServerAdmin [email protected] #php_admin_value open_basedir "/var/www/html/a:/tmp/:/var/tmp/:/proc/" DocumentRoot "/var/www/html/a" ServerName a.example.com ErrorLog "/home/wwwlogs/a.example.com-error_log" CustomLog "/home/wwwlogs/a.example.com-access_log" combined <Directory "/var/www/html/a"> SetOutputFilter DEFLATE Options FollowSymLinks AllowOverride All Order allow,deny Allow from all DirectoryIndex index.html index.php </Directory> </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] #php_admin_value open_basedir "/home/wwwroot/example.com:/tmp/:/var/tmp/:/proc/" DocumentRoot "/home/wwwroot/example.com" ServerName example.com ErrorLog "/home/wwwlogs/example.com-error_log" CustomLog "/home/wwwlogs/example.com-access_log" combined <Directory "/home/wwwroot/example.com"> SetOutputFilter DEFLATE Options FollowSymLinks AllowOverride All Order allow,deny Allow from all DirectoryIndex index.html index.php </Directory> </VirtualHost> ``` |
8
imdong 2018-11-08 09:10:25 +08:00 1
http 和 https 对 nginx 来说 其实可以是两个不同的网站。
所以,检查下 nginx 和 apache 里面 https 和 http 对应的目录是否是同一个吧。 apache 不是很懂。 配置没看到 https 的配置啊,等熟悉 apache 的人来吧。 你贴的事两个网站? |
9
Mayuri OP @imdong 嗯,也不知道是配置哪里出现了错误,继续等待大神
不能在每个回复发外链也不能插图。。一个是主域名另一个是子域名 |
10
Mayuri OP |
12
Vhc 2018-11-08 19:38:34 +08:00
@Mayuri #10 话说,你犯这种常识性的错误是很不应该的
拿 nginx 举例说吧,你应该检查 httpd-vhosts.conf 文件里是否有这么一行代码 include /etc/apache/vhost/*.conf; |
14
Mayuri OP @Vhc 然而 Apache 里的 httpd.conf 里面有一句 IncludeOptional conf/vhost/*.conf。。
|
15
Mutoo 2018-11-08 20:02:42 +08:00
80 配置里的 ServerName 写成 ServerNamen 了。
|