Apache2 site breaking all other sites

Discussion in 'Systems Administration' started by DotRar, May 31, 2017.

  1. Hey all, I have this apache vhost here: https://hastebin.com/orirewamep.apache for distributing assets. However, when I enable it with a2ensite, it works fine but all the other sites (such as panel.perkelle.com or just perkelle.com) give me this error:
    Any ideas? Other sites with similar configurations seem to work fine...
  2. ssamjh


    You need to do a2enmod ssl.

    As well as that you need a SSL certificate for the port 443 vhost. You could use Lets Encrypt, it's free.
    • Agree Agree x 1
  3. ssl is enabled. And I use letsencrypt on my main site. I'm just trying to redirect HTTPS to HTTP on this VHost which I do on other sites.
  4. *main site*
    but not all sites.

    If you have example.com, and you want www.example.com or boo.example.com, you need to cover all.
  5. I use it on everything I need to, e.g. my panel. I don't want SSL on the CDN though since it's just a CDN and sometimes programs have issues with SSL.
  6. You can't embed non ssl content in ssl content. it will break ssl.
    In XenForo, they for example use proxy feature to query and proxy images and links, so the page can be full ssl.
  7. Nothing else touches the CDN. Only stuff like resource packs downloaded by the MC client is on there
  8. When you setup let's encrypt it asks to auto redirect http to https, did you check the conf file for the vhost to see if it added that at teh bottom, forcing a rewrite to https?
  9. It didn't for me. Here's my main site's conf file:
    Code (Text):
    <VirtualHost *:80>
            ServerName perkelle.com
            RewriteEngine On
            RewriteCond %{HTTPS} !=on
            RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

    <VirtualHost *:443>
            ServerName perkelle.com
            DocumentRoot "/var/www/html/"

            SSLEngine on
            SSLCertificateFile    /etc/letsencrypt/live/perkelle.com/cert.pem
            SSLCertificateKeyFile /etc/letsencrypt/live/perkelle.com/privkey.pem
            SSLCertificateChainFile /etc/letsencrypt/live/perkelle.com/fullchain.pem

            AllowEncodedSlashes On
            <Directory "/var/www/html">
                    AllowOverride all
  10. That tells me that url gets forcefully rewritten from http to https
    But you are telling me you want it to go from https to http
  11. They're 2 different sites
  12. ... then why show me the config of the wrong site? O_O
  13. Because that's the one I use letsencrypt with
  14. Then I refer you back to my initial post where I say that every domain requires it's own let's encrypt


    If you have those, then set up a vhost for that sub domain that you use as a cdn.