我正在尝试使用vmware workstation,ubuntu 11.10和apache2来build立一个站点。 该网站工作正常,但现在的https页面不显示。 例如,如果我试图去https://www.mysite.com/checkout我只看到消息
未find请求的URL /结帐/在此服务器上找不到。
我真的不知道我在做什么,并已经尝试了很多东西,以获得在那里的SSL证书。
我在那里有几件事,在我的httpd.conf我只有:
ServerName localhost
在我的ports.conf我有:
NameVirtualHost *:80 Listen 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 http </IfModule> <IfModule mod_gnutls.c> Listen 443 http </IfModule>
在/ etc / apache2 / sites-available / default-ssl中:
<IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> .... truncated
在网站的可用/默认我有:
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www #DocumentRoot /home/magento/site/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> #<Directory /home/magento/site/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </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 # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/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> </VirtualHost> <virtualhost *:443> SSLEngine on SSLCertificateFile /etc/apache2/ssl/server.crt SSLCertificateKeyFile /etc/apache2/ssl/server.key ServerAdmin webmaster@localhost <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> #<Directory /home/magento/site/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </virtualhost>
我也有网站 – 可用的文件设置为我的网站的url,www.mysite.com所以在/etc/apache2/sites-available/mysite.com
<VirtualHost *:80> ServerName mysite.com DocumentRoot /home/magento/mysite.com <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /home/magento/mysite.com/ > Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /home/magento/logs/apache.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn </VirtualHost> <VirtualHost *:443> ServerName mysite.com DocumentRoot /home/magento/mysite.com <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /home/magento/mysite.com/ > Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /home/magento/logs/apache.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn </VirtualHost>
感谢您获取此设置的任何帮助! 从这个post可能很明显,我在这一点上相当迷茫。
你可以尝试几件事情:
由于您在/etc/apache2/sites-available/mysite.com使用<VirtualHost *:443> ,因此将Listen 443 http
NameVirtualHost *:443 Listen 443
在你的ports.conf 。
据我所知,你没有使用默认configuration来实际服务的网站。
如果我是对的,请禁用它们:
a2dissite default default-ssl
在这种情况下,你也应该删除这一行
ServerName localhost
从你的httpd.conf 。
确保您的最新configuration和SSL已启用。
a2ensite mysite.com a2enmod ssl
进行任何更改后,请记住重新加载apache以激活新的configuration:
service apache2 reload
下面的部分似乎并不正确
这是443上的ssl连接的虚拟主机,
<IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory>
您因不适当而收到错误
DocumentRoot /var/www
将其更改为与在中相同的值
<VirtualHost *:443>