News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

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

Started by shawnb61, July 08, 2017, 03:01:04 AM

Previous topic - Next topic

shawnb61

Did you run all the steps in the original post above, in order?

What happened when you ran step 2?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

daverj

The certificate is installed (autoSSL by cPanel) and works fine. I can go to the forum using https:// and it shows up, but with a grey lock and warning that there is mixed content.

I have not set up the rewrite rule yet because I wanted to resolve the issues first. And since the original poster suggested running the repair_settings.php once to fix any other issues before running it again to fix the URLs, I was doing that and hadn't changed any of the URLs yet.

shawnb61

Which issues were you trying to resolve first?  The mixed content?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

daverj

The goal was to find and fix the reasons for the mixed content warning before setting a rewrite rule to move to force https (since some browsers won't show a site with mixed content). I figured the mentioned URL settings could be at least part of the problem.

I ran repair_settings.php and saw the "Value Not Found" warnings mentioned above, so figured I would first change them and save the settings before coming back to change the URLs to use https. But that first pass killed the forum.

shawnb61

OK. 

Some questions:
- What value do you have for $db_type in settings.php right now?
- What mods do you have installed?
- Do you have a redirect in place to map your forum.mydomain.com to mydomain.com/forum?  Is it thru cPanel?  If so, does your cPanel also have an option for an https redirect?  (If so, this part will be easy!)

QuoteIt showed Maintenance Mode: "Value not found" So I set it to OFF.
It showed Queryless URLs: "Value Not Found" so I set it to OFF.
It showed Database Engine: "Value not found" but had MySQL selected in the dropdown box, which is correct. So I left it alone.

You should set Maintenance Mode if you want the 'site is under maintenance' message to appear to visitors.  Not the problem.

Leave the Queryless URLs parameter alone.  Once considered an important feature, it's largely unused now.  Possibly part of this problem???  I'd leave that setting alone.

Regarding the Database Engine parameter, you should probably explicitly set it to MySQL.  Possibly part of this problem. 

Next time you try this, if you experience issues, save the problematic copy of Settings.php before restoring it.  Then you can compare it with your current one & better understand the issue.

Regarding mixed content, different folks have found the mixed content hidden in different places, and you will likely have to hunt those down after converting to https.  Sometimes it's links in mods, sometimes your forum logo, sometimes it's just http:// images shared by folks in posts (the image proxy is designed to assist with this). 

I think all major browsers at the moment do in fact default to showing mixed content sites today. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

daverj

There is no $db_type parameter in the Settings.php file. Which is probably why Repair_settings.php flagged it as "Value not found". When I saved the settings in Repair_settings.php the db was set to MySQL in the dropdown box (by default).

The db is MySQL. On the admin Support and Credits page it shows:

Database Server: MySQL
MySQL version: 5.7.29
PHP: 5.6.40
Server version: Apache

Likewise there is no $maintenance field in the current Settings.php file, also probably why it was flagged as Value not found.

The SSI Username and SSI password were also flagged as Value not found in Repair_settings.php, and are not in the Settings.php file. I left them alone

The forum is installed in a folder called forum. Apache is configured so that folder is a subdomain. So you can reach it either through forum.mydomain.com [nofollow] or through mydomain.com/forum [nofollow]. Since the $boardurl is set as "http://forum.mydomain.com [nofollow]" then if you log in at mydomain.com/forum [nofollow] it will then change the URL to forum.mydomain.com [nofollow] as you log in.

The $boarddir is set to "/home/myaccountname/public_html/forum"

No mods installed.

HusaBob

Converting to https is impossible!! I gave up. We're going to have to go with a different type of forum and lose 12 years of data. There's no way it has to be so difficult that you need a NASA programmer!

shawnb61

Not impossible.  For most, it's just a matter of changing the URLs.  Some environments are a bit more of a challenge for one reason or another.

daverj - Next time you try, I would suggest leaving all unrelated parameters untouched.  If it's working, don't fix it! 

If you have issues, here's something to try...  I attempted to reproduce your environment, and I definitely had issues when the $boardurl set to "forum.mydomain.com" and the $boarddir set to "/home/myaccountname/public_html/forum".  Everything worked perfectly when I set $boardurl to "mydomain.com/forum".   

Hope this helps,
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

lather

I am admin for a 2.0.15 site and converted to https today, following the steps in the original post. testing with the Why No Padlock site shows this:
Mixed Content - Errors
Soft Failure An image with an insecure url of "http://ridemsta.com/mstalogo1.png" was loaded on line: 65 of https://www.ridemsta.com/mstaforums/.
This URL will need to be updated to use a secure URL for your padlock to return.

I assume the message refers to include.php but there is no url at line 65. In fact I have searched the entire contents of the forum folder and sub folders using fileseek search tool by binaryfortress but cannot find this line. Can anyone help? Thanks

shawnb61

That looks like it's your forum logo.  You should change that to https also.  It's one of your theme settings.

Look under Admin | Configuration | Theme Settings.

You will see a list of themes.  For each theme in use, click on the theme header, which is a link where you can see the theme settings.  Take a look at the setting for the logo image URL. 

Hope this helps,
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

HusaBob

I'd like to try converting but am afraid I'd blow up the forum. Trying to find instructions on how to make a working copy of the forum is impossible.

lather

Quote from: shawnb61 on March 15, 2020, 02:50:28 PM
That looks like it's your forum logo.  You should change that to https also.  It's one of your theme settings.

Look under Admin | Configuration | Theme Settings.

You will see a list of themes.  For each theme in use, click on the theme header, which is a link where you can see the theme settings.  Take a look at the setting for the logo image URL. 

Hope this helps,
Yes, that did it. THANKS!

Kindred

Quote from: HusaBob on March 15, 2020, 03:37:41 PM
I'd like to try converting but am afraid I'd blow up the forum. Trying to find instructions on how to make a working copy of the forum is impossible.

https://wiki.simplemachines.org/smf/Backup

https://wiki.simplemachines.org/smf/Hosting_-_How_do_I_move_my_SMF_forum_to_a_different_host


follow the "install on a different host" instructions -- but apply them to your own host, in a new subdomain or subdirectory with a new database
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

HusaBob

Quote from: Kindred on March 16, 2020, 01:07:18 PM
Quote from: HusaBob on March 15, 2020, 03:37:41 PM
I'd like to try converting but am afraid I'd blow up the forum. Trying to find instructions on how to make a working copy of the forum is impossible.

https://wiki.simplemachines.org/smf/Backup

https://wiki.simplemachines.org/smf/Hosting_-_How_do_I_move_my_SMF_forum_to_a_different_host


follow the "install on a different host" instructions -- but apply them to your own host, in a new subdomain or subdirectory with a new database

Thanks - but not simple enough!

shadav

thanks for this
I was able to get 2 of my forums but having issue with one that is one a subdomain, I keep getting 403 errors  :-\
and the only thing I can figure is because it's forum.tld instead of tld/forum

was able to roll the site back and it's at least working again but can't seem to get it to work with https

any ideas/suggestions

shawnb61

Hmmm...  First guess is something with the .htaccess...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

thatjustit

Great guide, I did all the points and it works well, no mixed content.

drewactual

Quote from: shadav on October 25, 2020, 10:32:08 PM
thanks for this
I was able to get 2 of my forums but having issue with one that is one a subdomain, I keep getting 403 errors  :-\
and the only thing I can figure is because it's forum.tld instead of tld/forum

was able to roll the site back and it's at least working again but can't seem to get it to work with https

any ideas/suggestions

Environment?  Fastcgi or php-fpm, or what?

I saw a lot of 403s when I migrated servers and was because fastcgi operates with "nobody" where fpm operates as "user"... there was some sort of conflict somewhere looking for user and discovering nobody on the files served, and which caused a 403... so... running mpm worker with php-fpm and fast-cgi as a service, users were users again instead of nobody and 403s disappeared.

Just a thought...

shadav

Quote from: drewactual on March 15, 2021, 11:10:01 PM
Quote from: shadav on October 25, 2020, 10:32:08 PM
thanks for this
I was able to get 2 of my forums but having issue with one that is one a subdomain, I keep getting 403 errors  :-\
and the only thing I can figure is because it's forum.tld instead of tld/forum

was able to roll the site back and it's at least working again but can't seem to get it to work with https

any ideas/suggestions

Environment?  Fastcgi or php-fpm, or what?

I saw a lot of 403s when I migrated servers and was because fastcgi operates with "nobody" where fpm operates as "user"... there was some sort of conflict somewhere looking for user and discovering nobody on the files served, and which caused a 403... so... running mpm worker with php-fpm and fast-cgi as a service, users were users again instead of nobody and 403s disappeared.

Just a thought...

I have no idea....but thank you for replying....I've given up at the moment
my other forums worked just fine but not this one and they are all on the same server so it has something to do with that this one is a subdomain whereas the others aren't....

as shawn suggested it's probably something to do with the htaccess, but I kind of forgot about it  :laugh:

shawnb61

Another possibility is the cookie settings...  Subdomains sometimes need some special attention.

I just re-learned that lesson again. Again.
https://www.simplemachines.org/community/index.php?topic=577080.0
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: