Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
can you open mysite.com/checkout on port 80 without any issues ? –  m1k3y02 Apr 12 '12 at 16:40
    
yes, i disabled the secure pages from the magento app I am running and the pages load fine. –  zac Apr 12 '12 at 16:44
add comment

migrated from superuser.com Apr 13 '12 at 3:52

This question came from our site for computer enthusiasts and power users.

2 Answers

below part does not seem to be correct

this is a virtual host for ssl connections on 443,

<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>

you are receiveing error due to inappropriate

DocumentRoot /var/www

change it to the same values as in

<VirtualHost *:443>
share|improve this answer
add comment

A couple of things you can try:

  1. Since you're using <VirtualHost *:443> in /etc/apache2/sites-available/mysite.com, replace both instances of Listen 443 http with

    NameVirtualHost *:443
    Listen 443
    

    in your ports.conf.

  2. 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.

  3. Make sure your newest configuration and SSL are enabled.

    a2ensite mysite.com
    a2enmod ssl
    
  4. After making any changes, remember to reload apache to activate the new configuration:

    service apache2 reload
    
share|improve this answer
    
Thanks, 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 –  zac May 2 '12 at 18:22
    
I am also seeing this error : VirtualHost *:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results –  zac May 2 '12 at 18:31
    
Try removing the NameVirtualHost *:443 lines. –  Dennis May 2 '12 at 18:31
    
hmm 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 –  zac May 2 '12 at 18:38
    
What do the log files say? Also, apache might not even be the culprit. This could have something to do with vmware. –  Dennis May 2 '12 at 18:46
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.