SMF Support > Server Performance and Configuration

Converting to https, step-by-step...

<< < (11/11)

helpplease:
I need a general themes support, the same error comes when I change to the default SMF themes.

And where is it please?

Vincenz0:
Hey guys!

I wish to leave another tip of information.

After switching to https, naturally many things stopped to work especially images (mixed content.. ;) )

The image proxy SMF provided was not working for me, and returning error 500, but nothing in php logs and I had no clue what was wrong, I checked everything, turned on apache2 logging for all errors, even turned on display errors but no still nothing to see..

Turns out in the proxy.php file errors get disabled..... :D

--- Code: ---                // Turn off all error reporting; any extra junk makes for an invalid image.
                error_reporting(0);

--- End code ---

After commenting out that line I found out the simple problem and if others have it, I recommend this fix.

Turns out it uses the CURL apache module.. which is not standard installed on apache2.

Simple fix:

--- Code: ---sudo apt-get install php-curl
--- End code ---

Hope it helps someone with image proxy problems.


Also the redirect was not working, not in apache2 config files or in .htaccess.. turns out in the new apache it is not recommended to make a rewrite for redirects.

instead do the folowing:
In your /etc/apache2/sites-enabled/
Modify your site config something like this:

--- Code: ---<VirtualHost *:80>
    ServerName www.yourforumsite.com
    Redirect permanent "/" "https://www.yourforumsite.com/"
</VirtualHost>

<VirtualHost *:443>
    ServerName www.yourforumsite.com
    # ... SSL configuration goes here
</VirtualHost>

--- End code ---
This is always working and more safe than any rewrites.


Because of my rewrite problems I was already manually updating http to https a simple trick to update all old URL's for your site people posted or used in signatures:


--- Code: ---UPDATE smf_messages
     set body = REPLACE(body, 'http://www.yourforumsite.com', 'https://www.yourforumsite.com')
     WHERE body like '%http://www.yourforumsite.com%';

UPDATE smf_members
     set signature = REPLACE(signature, 'http://www.yourforumsite.com', 'https://www.yourforumsite.com')
     WHERE signature like '%http://www.yourforumsite.com%';
--- End code ---

This can also be used to update for instance images posted with hxxp:i.imgurl [nonactive] to https.
And thus avoid caching images on your server when not needed. Most image hosts support https nowadays (some exceptions like tinypic)

MadCityKaren:
Thanks for this step-by-step list, shawnb61! 

I'd realized my forum/website was having an issue of some sort with SSL after receiving some feedback from a member, but found the problem wasn't so much not having the certificate (SSL checker showed all was well), but that the .htaccess file in order to redirect is somehow missing ... (trusting that will indeed solve the issue; I'm asking the webhost to deal with it -- it's not as though I'd removed the file; they should be apprised of such things to maintain the integrity of all they serve.) 

Navigation

[0] Message Index

[*] Previous page

Go to full version