Setting up apache to view https pages
A couple of things you can try:
Since you're using
<VirtualHost *:443>
in/etc/apache2/sites-available/mysite.com
, replace both instances ofListen 443 http
withNameVirtualHost *:443 Listen 443
in your
ports.conf
.As far as I can tell, you are not using the default configurations to actually serve a website.
If I'm right, disable them:
a2dissite default default-ssl
In this case, you should also delete the line
ServerName localhost
from your
httpd.conf
.Make sure your newest configuration and SSL are enabled.
a2ensite mysite.com a2enmod ssl
After making any changes, remember to reload apache to activate the new configuration:
service apache2 reload
Related videos on Youtube
transcedentalia
Updated on September 18, 2022Comments
-
transcedentalia over 1 year
I am trying to set up a site using vmware workstation, ubuntu 11.10, and apache2. The site works fine but now the https pages are not showing up. For example if I try to go to https://www.mysite.com/checkout I just see the message
Not Found The requested URL /checkout/ was not found on this server.
I dont really know what I am doing and have tried a lot of things to get the ssl certificates in there right.
A few things I have in there, in my
httpd.conf
I just have :ServerName localhost
In my
ports.conf
I have :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>
In the /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
in the sites-available/default I have :
<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>
I also have in sites-availabe a file setup for my site url, www.mysite.com so in /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>
Thanks for any help getting this setup! As is probably obvious from this post I am pretty lost at this point.
-
m1k3y02 about 12 yearscan you open mysite.com/checkout on port 80 without any issues ?
-
transcedentalia about 12 yearsyes, i disabled the secure pages from the magento app I am running and the pages load fine.
-
-
transcedentalia almost 12 yearsThanks, I followed everything but now I get a SSL connection error when I try to go to https:// Also when I restart apache2 I see errors like
[warn] NameVirtualHost *:443 has no VirtualHosts
-
transcedentalia almost 12 yearsI am also seeing this error :
VirtualHost *:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
-
Dennis almost 12 yearsTry removing the
NameVirtualHost *:443
lines. -
transcedentalia almost 12 yearshmm i tried and it was still giving me those errors. I removed /conf.d/virtual.conf and error went away, but now I am back to a 404 on https pages
-
Dennis almost 12 yearsWhat do the log files say? Also, apache might not even be the culprit. This could have something to do with vmware.
-
transcedentalia almost 12 yearsack.. hmm this sux. Logs no help... I dont think.. it does say client denied by server configuration (the local.xml of this magento install) but I dont think that is it