librelist archives

« back to archive

Changed HTTP port, links are messed up

Changed HTTP port, links are messed up

From:
Jeremy Rand
Date:
2013-02-03 @ 06:00
I was running Friendica on port 80 without HTTPS, but decided to setup 
HTTPS.  Unfortunately I already have a service running on port 443, so I 
changed the port in the nginx config to 444.  I also changed the HTTP 
port to 81, because my ISP doesn't seem to allow incoming port 80 
traffic.  Friendica is working, except that a bunch of URL's seem to 
still point to http://[mysite] rather than https://[mysite]:444, which 
breaks the links.  I notice that most profile and album pics are 
affected, as are the links to my friends on the same Friendica server. 
Is there any way to fix this without a complete re-install?

Thanks.

Re: [friendica] Changed HTTP port, links are messed up

From:
Mike Macgirvin
Date:
2013-02-03 @ 07:27
This could be a bit problematic, but I think there's a way out. It 
*might* take a small bit of code hacking. There's an option in the admin 
panel to use SSL only or self-signed cert or "don't care". If you set 
this to ssl only from one of the other settings it will go through the 
database and try and fix as many links as it can. This isn't perfect, 
but it should be able to get you going. Assuming you are visiting the 
admin panel from https://xxxxxxxx:444, it may do the right thing. If it 
neglects to set the port you might have to edit that section of 
mod/admin.php where we change all the links to ssl and edit in the port 
number to make it work. If ssl only was already turned on, turn it to 
self-signed and then back again. It will take a few minutes because it's 
replacing a lot of links.

If you actually do have a self-signed cert, I would encourage you to 
upgrade it. The self-signed setting only marginally works and turns out 
to be very anti-social in a decentralised network.

> I was running Friendica on port 80 without HTTPS, but decided to setup
> HTTPS.  Unfortunately I already have a service running on port 443, so I
> changed the port in the nginx config to 444.  I also changed the HTTP
> port to 81, because my ISP doesn't seem to allow incoming port 80
> traffic.  Friendica is working, except that a bunch of URL's seem to
> still point to http://[mysite] rather than https://[mysite]:444, which
> breaks the links.  I notice that most profile and album pics are
> affected, as are the links to my friends on the same Friendica server.
> Is there any way to fix this without a complete re-install?
>
> Thanks.

Re: [friendica] Changed HTTP port, links are messed up

From:
Jeremy Rand
Date:
2013-02-03 @ 23:17
Okay, so that partially helped.  I did have to edit the PHP to replace 
the port number.  It fixed some of the issues, but the links to contacts 
on the same Friendica server are still broken.  I've even tried 
unfriending them, and re-friending them with the correct URL, but the 
link to their profile is still broken on the Contacts page.  There also 
seem to still be issues with profile pics in some cases.  (Both of these 
issues aren't a problem on the Directory page, though....)

Am I correct in gathering that that PHP file only replaces certain 
fields/tables in the database?  If so, is there a way to do a 
search/replace on the whole database?

Thanks for your help!

On 2/3/2013 1:27 AM, Mike Macgirvin wrote:
> This could be a bit problematic, but I think there's a way out. It
> *might* take a small bit of code hacking. There's an option in the admin
> panel to use SSL only or self-signed cert or "don't care". If you set
> this to ssl only from one of the other settings it will go through the
> database and try and fix as many links as it can. This isn't perfect,
> but it should be able to get you going. Assuming you are visiting the
> admin panel from https://xxxxxxxx:444, it may do the right thing. If it
> neglects to set the port you might have to edit that section of
> mod/admin.php where we change all the links to ssl and edit in the port
> number to make it work. If ssl only was already turned on, turn it to
> self-signed and then back again. It will take a few minutes because it's
> replacing a lot of links.
>
> If you actually do have a self-signed cert, I would encourage you to
> upgrade it. The self-signed setting only marginally works and turns out
> to be very anti-social in a decentralised network.
>
>> I was running Friendica on port 80 without HTTPS, but decided to setup
>> HTTPS.  Unfortunately I already have a service running on port 443, so I
>> changed the port in the nginx config to 444.  I also changed the HTTP
>> port to 81, because my ISP doesn't seem to allow incoming port 80
>> traffic.  Friendica is working, except that a bunch of URL's seem to
>> still point to http://[mysite] rather than https://[mysite]:444, which
>> breaks the links.  I notice that most profile and album pics are
>> affected, as are the links to my friends on the same Friendica server.
>> Is there any way to fix this without a complete re-install?
>>
>> Thanks.
>

Re: [friendica] Changed HTTP port, links are messed up

From:
Mike Macgirvin
Date:
2013-02-03 @ 23:36
> If so, is there a way to do a
> search/replace on the whole database?

We've done this for real stubborn cases. You should be able to use 
phpmyadmin or mysql to dump the DB, search/replace with a text editor 
and re-import it.