http与https虚拟主机

我正在尝试移动trac以确保连接。 我想使用https。

虚拟主机文件工作正常,当我把*:80和注释掉ssl引擎。 每当我将其更改为ssl时,它不会通过443进行响应。

有任何想法吗?

我试过这个:

<VirtualHost *:443> ServerAdmin [email protected] ServerName trac.domain.com DocumentRoot /var/www/trac/repos SSLEngine On SSLCertificateFile /etc/ssl/certs/trac.domain.com.crt SSLCertificateKeyFile /etc/ssl/private/trac.domain.com.key <Directory /var/www/trac/repos> Order allow,deny allow from all </Directory> <Location /> AuthType Basic AuthName "Trac" AuthUserFile /etc/apache2/passwords Require valid-user </Location> <Location /> SetHandler mod_python PythonInterpreter main_interpreter PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /var/www/trac PythonOption TracUriRoot / </Location> </VirtualHost> 

但是当我使用它时,trac是无法访问的

确保Apache正在侦听端口443,并确保您的防火墙允许该端口上的入站stream量。

在你的Apacheconfiguration的某处你需要这个,

 Listen 443 

在Debian上(你没有提到你的操作系统)在ports.conf中是这样的,

 <IfModule mod_ssl.c> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> 

另外,别忘了你还需要在Apache中加载正确的模块(这取决于你的发行版)。

最后,确保你的防火墙已经打开了443端口。

首先在linux命令中检查,

 # netstat -atnp | grep LISTEN 

结果必须:

 0.0.0.0:443 

如果没有,你必须检查configuration文件。

在顶部的configuration文件,添加:

 Listen *:443 

然后重新启动httpd。