已经5天了,我都快疯了。
我正在尝试在我创建的子域上安装一个“让我们加密证书”,但是我无法让它正常工作。
以下是我在网站中的.conf文件:
test.com.conf
ServerAdmin webmaster@localhost
ServerName test.com
ServerAlias www.test.com
DocumentRoot /var/www
Options FollowSymLinks
AllowOverride All
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.test.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [L,NE,R=permanent]因此,这一个工作,我有一个test-le-ssl.conf创建的网站-可用。
这是我的whydoesntitwork.test.com.conf
ServerAdmin webmaster@localhost
DocumentRoot /var/www/whydoesntitwork
Options FollowSymLinks
AllowOverride All
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined当我运行./letsencrypt或add -d test.com -d whydoesntitwork.com时,它会问我是想续订还是尝试重新安装。我重新安装是因为我不想被锁在外面(他们说我们每周可以做5-7次)。
当我试图将SSL放在为什么工作时,我遇到的错误是:
The selected vhost would conflict with other HTTPS VirtualHosts within Apache. Please select another vhost or add ServerNames to your configuration.
VirtualHost not able to be selected.我已经在/etc/apache2/hosts上添加了两个域,如下所示:
127.0.0.1 localhost.localdomain localhost
(myip) test.com test
(myip) whydoesntitwork.test.com whydoesntitwork我做错什么了?
编辑:添加apache版本
Server version: Apache/2.2.22 (Debian)
Server built: Sep 21 2017 20:51:54谢谢
发布于 2018-04-02 22:20:02
在Apache2.2上,您需要设置NameVirtualHost
NameVirtualHost *:80另外,在第二个配置中,您似乎缺少了ServerName指令。
最后,您是否启用了站点中可用的配置?
https://serverfault.com/questions/905687
复制相似问题