我已经尝试解决这个问题 4 天了,但无济于事。请帮忙!
问题很简单 - 我的 SSL 端口 443 正在运行并且正在加载我的 Symfony 网站(https://mysite.com) 但是我的 80 端口不工作并且在所有浏览器中都显示无法连接到 mysite.com 的错误。
我在 Ubuntu 12.04LTS / apache2 / MYSQL / PHP5 上运行 LAMP。
虚拟主机已启用,当我运行“apache2ctl -S”时,我得到:
VirtualHost configuration:
*:80 mysite.com (/etc/apache2/sites-enabled/default.conf:1)
*:443 mysite.com (/etc/apache2/sites-enabled/mysite.conf:1)
我的虚拟主机文件(/etc/apache2/sites-enabled)是:1)default.conf:
<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/mysite.com/public_html/Symfony/web
</VirtualHost>
2)mysite.conf
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/mysite.com/public_html/Symfony/web
<Directory />
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/mysite.com/public_html/Symfony/web>
AllowOverride None
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php [QSA,L]
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/mysite.com/mysite.com.crt
SSLCertificateKeyFile /etc/ssl/mysite.com/mysite.com.key
SSLCertificateChainFile /etc/ssl/mysite.com/mysite.com.ca-bundle
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
答案1
听起来你可能有一个防火墙规则阻止了该端口。