我有一台 Ubuntu 10 x64 服务器版机器。我获得了第二个 IP 并配置了 /etc/network/interfaces,如下所示(实际 IP 和网关已删除):
auto lo
iface lo inet loopback
#iface eth0 inet dhcp
auto eth0
auto eth0:0
iface eth0 inet static
address [ my first IP ]
netmask 255.255.255.0
gateway [ my first gateway ]
iface eth0:0 inet static
address [ my second IP ]
netmask 255.255.255.0
gateway [ my second gateway ]
/etc/apache2/ports.conf:
Listen 80
NameVirtualHost [ my first IP ]:80
NameVirtualHost [ my second IP ]:80
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
NameVirtualHost [ my first IP - some site is running SSL successfully using it ]:443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
/etc/apache2/sites-enabled/mysite.conf:
<VirtualHost [my second IP ]:80>
ServerName mysite.com
Include /var/www/mysite.com/djangoproject/apache/django.conf
</VirtualHost>
然后当访问http://[mysite].com:80
或 时http://[mysite].com
,我得到:
An error occurred during a connection to [mysite].com.
SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)
我的猜测是配置文件未被拾取,因此 apache 正在寻找 default-ssl 文件,该文件不在 conf-enabled 中。如果我正确配置该文件,似乎我可以成功连接到 default-ssl 文件中指定的任何默认目录。但我想连接到我的网站。
有任何想法吗?
提前致谢!
答案1
我清除了浏览器缓存。然后我重新访问了该页面,能够正常连接,没有任何问题。看来这是用户错误造成的。