Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

admin not working with https, only http


Go to End


2 Posts   798 Views

Avatar
pjhartin

Community Member, 2 Posts

27 October 2016 at 3:32am

Edited: 27/10/2016 3:40am

I have been made aware of this issue today by a client, and I'm quite stumped as to why.

You can see that via https://www.graymattersapp.org/admin, the page responds with a server 404 error, whereas the non-ssl version navigates to the page and allows me to login. If you are testing this, please note that chrome has a tendency to force the SSL connection (I had to use Firefox to test).

I assume that removing my ssl cert may fix the issue, but I'd like to understand why it would be causing the issue.
It is as though via https, it is looking for an entirely different directory, or skipping Rewrites?

It may be important to note, that the website has been live for 12 months prior, with no changes made to server or environment, other than renewing SSL certificates via letscenrypt. Which seems to have resulted in this issue. I think it stems from a .htaccess, or apache config issue.

Any help would be much appreciated.

graymatters.app.org.conf

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.

        ServerName graymattersapp.org
        ServerAlias www.graymattersapp.org
        ServerAdmin hartin@gmail.com
        DocumentRoot /{path}/public_html

        <Directory /{path}/public_html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.graymattersapp.org [OR]
RewriteCond %{SERVER_NAME} =graymattersapp.org
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

SSL conf - graymatters.app.org-le-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.

        ServerName graymattersapp.org
        ServerAlias www.graymattersapp.org
        DocumentRoot /{path}/public_html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
SSLCertificateFile /etc/letsencrypt/live/graymattersapp.org/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/graymattersapp.org/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/graymattersapp.org/chain.pem
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
</IfModule>

Avatar
pjhartin

Community Member, 2 Posts

27 October 2016 at 4:03am

Just a heads up. I removed these lines from my the standard .conf file,

RewriteEngine on
RewriteCond %{SERVER_NAME} =www.graymattersapp.org [OR]
RewriteCond %{SERVER_NAME} =graymattersapp.org
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

and restarted apache. In the mean time, I can use http only and still retain functionality.

If anyone has any idea how I can enable with https. Please let me know.

Thanks