Find the answer to your Linux question:
Results 1 to 8 of 8
Hello all, I had setup an SSL secure server awhile back, such that: https://mysite/page.php works but http://mysite.page.php does not (note the different: in the first, I use HTTPS, whereas the ...
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    59

    [SOLVED] HTTPS works, but HTTP does not?!

    Hello all,

    I had setup an SSL secure server awhile back, such that:

    https://mysite/page.php works but http://mysite.page.php does not (note the different: in the first, I use HTTPS, whereas the second I use HTTP)

    Why is this? Can I only have one or the other? How can I get both to co-exist?

  2. #2
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,392
    Can you please clarify that you're using non-http access by http://site/page.php, not, as you appear to have typed, http://site.page.php.

    If this is how you're accessing that site, then you won't get a response from that second address unless you're running this inside a LAN with your own nameserver that converts 'mysite.page.php' into the web address of your http server.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    If you simply had a typo in your first post, as Roxoff pointed out, the problem could also be with your server setup. It is entirely possible to set up a server so that normal HTTP connections, or simply any traffic on port 80, are dropped and ignored.
    DISTRO=Arch
    Registered Linux User #388732

  4. #4
    Just Joined!
    Join Date
    Jan 2011
    Posts
    59
    sorry guys! Yes it was a typo

    This works: https://mysite/page.php
    This does not: http://mysite/page.php

    How can I check if all requests to port 80 are ignored?

  5. #5
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,298
    Can you post the vhosts file, any relavent .htaccess entries and confirm what you mean by not working?
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  6. #6
    Just Joined!
    Join Date
    Jan 2011
    Posts
    59
    Quote Originally Posted by elija View Post
    Can you post the vhosts file, any relavent .htaccess entries and confirm what you mean by not working?
    By not working it just means I get a 404 page not found error, just as I would if the page didn't exist

    Here is my vhost config for SSL
    Code:
    <VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName localhost
    
        DocumentRoot /var/www/
        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/secure.keydom.net.crt
        SSLCertificateKeyFile /etc/apache2/ssl/secure.keydom.net.key
        SSLCertificateChainFile /etc/apache2/ssl/gd_bundle.crt
        <Directory />
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory /var/www/>
            Options 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 /var/log/apache2/error.log
    
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
    
        CustomLog /var/log/apache2/access.log combined
    
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
    
    </VirtualHost>
    Here is my vhost config for port 80
    Code:
    <VirtualHost *:80>
      ServerName localhost
      DocumentRoot /var/www/
    
      <Directory /var/www/>
        AllowOverride All
        Order Deny,Allow
        Allow from all
      </Directory>
    </VirtualHost>
    Note that the SSL config is in one file, and the port 80 (non-SSL) config is in another file

    Any ideas!? Thanks everyone

  7. #7
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,298
    There's nothing leaping out as obviously wrong (but it's early) and as the port 443 config works, one option is to back up the port 80 file and copy the other one. Then switch it to port 80 and strip out the ssl stuff. and see if that works.
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  8. #8
    Just Joined!
    Join Date
    Jan 2011
    Posts
    59
    Quote Originally Posted by elija View Post
    There's nothing leaping out as obviously wrong (but it's early) and as the port 443 config works, one option is to back up the port 80 file and copy the other one. Then switch it to port 80 and strip out the ssl stuff. and see if that works.
    Thanks elija!

    I was able to narrow this down by trying that... Basically the problem was that my apache.conf file had the line "Include /etc/apache2/sites-enabled/000-default" rather than just "Include /etc/apache2/sites-enabled/". In other words, only my 000-default (the SSL site) was actually being included!

    Problem resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...