Announcement

#1 2014-01-21 02:31:08

Mark O'Shea
Member
2013-05-27
26

Unable to generate multiple size images when accesing via HTTPS

Hello,

I have configured my Apache server to accept both HTTP and HTTPS requests using the usual ports.

My Piwigo gallery can be used without any obvious issues on both ports but I have been unable to successfully "generate multiple size images" using the button on the Batch Manager page when accessing my gallery via HTTPS.

When I click the button (when accessing the gallery via HTTPS) an orange error triangle appears at the top of the window next to the words, "x photos can not be regenerated" (x is number of photos). If I log in via HTTP I can complete the same action without the error.

Any idea what's going on and how I can fix it?

Cheers
Mark


Piwigo Details

Piwigo version Piwigo 2.5.3
Running on my own server
Operating system: Linux
Apache/2.2.16 (Debian)
PHP: 5.3.3-7+squeeze15  [2014-01-21 00:24:36]
MySQL: 5.1.66-0+squeeze1 [2014-01-21 00:24:36]
Graphics Library: External ImageMagick 6.6.0-4
Database
11446 photos
43 albums including 39 physical and 4 virtual (34873 associations)

Advanced Menu Manager   Version 3.2.5
AStat.2                              Version 2.4.1
Crypto Captcha                  Version 2.0.4
Delete Hit/Rate              Version 2.5.a
Grum Plugins Classes.3      Version 3.5.5
GThumb+                              Version 2.5.b
Header Manager              Version 1.0.6
LocalFiles Editor              Version 2.5.3
Mobile Theme for Tablets      Version 2.5.a
Rotate Image                      Version 2.5.b
SmartAlbums                      Version 2.1.2
UserAdvManager              Version 2.51.1

Offline

 

#2 2014-01-21 10:04:09

flop25
Piwigo Team
2006-07-06
7037

Re: Unable to generate multiple size images when accesing via HTTPS

Hello
you should consult your logs and open a console in your browser to see the resquests and the answers


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2014-01-21 13:45:24

Mark O'Shea
Member
2013-05-27
26

Re: Unable to generate multiple size images when accesing via HTTPS

Thanks for replying to my post. 

I didn't think I'd be able to use the browser to help with this as the error is being generated by Piwigo. I tried hunting for logs entries that would explain why Piwigo could not generate the images on the server but could not find anything that helped. 

I manually upload my photos by SSH to a folder on the server to preserve the file name and then manually get Piwigo to generate the various image sizes. The batch manger works fine in generating the multiple size images when I access the server with my browser by HTTP but when I'm logged with a browser using HTTPS the error occurs.

To me this looks like it's a server-side issue. I would therefore expect some form of notification detailing the error to be in a log file somewhere on the server. Any idea where I can find that?

Cheers
Mark

Offline

 

#4 2014-01-21 16:15:35

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Unable to generate multiple size images when accesing via HTTPS

do you have a link to http and https server ?

Offline

 

#5 2014-01-21 17:55:10

Mark O'Shea
Member
2013-05-27
26

Re: Unable to generate multiple size images when accesing via HTTPS

Hi Rvelices,

I've emailed you some links.

Can also give you admin access if that would help.

Cheers
Mark

Offline

 

#6 2014-01-21 18:08:42

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Unable to generate multiple size images when accesing via HTTPS

Mark O'Shea wrote:

Can also give you admin access if that would help.

I cannot register because the captcha does not work for the same reason...

on admin home page, click show info and copy/paste the "Apache Environment" (make sure you remove cookies and other private stuff)

Offline

 

#7 2014-01-21 18:11:57

Mark O'Shea
Member
2013-05-27
26

Re: Unable to generate multiple size images when accesing via HTTPS

Interestingly I can also delete multiple size images in Batch Manager when accessing via HTTPS but cannot generate them manually when accessing via HTTPS.

The auto generate function works fine when viewing the pictures through the gallery. Any pictures not cached are created as requested by the server.

It appears that the only issue I have is that the manual option in Batch Manger (which I use to pre-cache images) does not work when accessing the gallery over HTTPS.

Offline

 

#8 2014-01-21 18:25:02

Mark O'Shea
Member
2013-05-27
26

Re: Unable to generate multiple size images when accesing via HTTPS

That's interesting. The captcha works on HTTP but not HTTPS.

Here is the Apache Environment section:

Variable    Value
HTTP_HOST    www.x.co.uk
HTTP_CONNECTION    keep-alive
HTTP_ACCEPT    text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT    Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36
HTTP_REFERER    https://www.x.co.uk/admin.php
HTTP_ACCEPT_ENCODING    gzip,deflate,sdch
HTTP_ACCEPT_LANGUAGE    en-GB,en-US;q=0.8,en;q=0.6
HTTP_COOKIE    side-info=visible; pwg_id=7upvrqeehq43t3kar1tjquk6c6; page-menu=visible
PATH    /usr/local/bin:/usr/bin:/bin
SERVER_SIGNATURE    <address>Apache/2.2.16 (Debian) Server at www.x.co.uk Port 80</address>
SERVER_SOFTWARE    Apache/2.2.16 (Debian)
SERVER_NAME    www.x.co.uk
SERVER_ADDR    10.1.1.5
SERVER_PORT    80
REMOTE_ADDR    158.230.x.x
DOCUMENT_ROOT    /var/www/gallery
SERVER_ADMIN    [no address given]
SCRIPT_FILENAME    /var/www/gallery/admin.php
REMOTE_PORT    11954
GATEWAY_INTERFACE    CGI/1.1
SERVER_PROTOCOL    HTTP/1.1
REQUEST_METHOD    GET
QUERY_STRING    action=phpinfo
REQUEST_URI    /admin.php?action=phpinfo
SCRIPT_NAME    /admin.php

Let me know if you want to see any more.

Offline

 

#9 2014-01-21 18:50:04

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Unable to generate multiple size images when accesing via HTTPS

This is when you access it through http. Can I have the same thing through https ?
First feeling is that piwigo always thinks it's http:// and every time it needs to return a full absolute url (emails, rss feeds,  web service returns), it will not do it correctly.
You are not using a reverse proxy? Right ?

Offline

 

#10 2014-01-21 19:24:21

Mark O'Shea
Member
2013-05-27
26

Re: Unable to generate multiple size images when accesing via HTTPS

I actually got the config from the server when logged in via https so I think you are spot on with your thoughts about Piwigo not knowing that it's running as secure. 

As far as I know I'm not running a reverse proxy. I have a firewall that just forwards requests to the relevant web server inside the local network.

Piwigo shares it's server with Horde and that software preconfigured the https server when it was installed. To get to Piwigo I just set up a new virtual host to accept the relevant https requests and configured the firewall to send the requests to the right server. The virtual host configuration on the server that hosts Piwigo was done with Webmin.

I get the feeling now that there is more to configuring a secure server than what I have actually done. What confused me is that most things worked okay. Looks like the Captcha and Batch Manager don't like what I've done. Any idea why these are the only obvious issues?

Last edited by Mark O'Shea (2014-01-21 19:26:00)

Offline

 

#11 2014-01-21 19:49:21

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Unable to generate multiple size images when accesing via HTTPS

The issue is building a full absolute url.
Sometime it is required, sometime a plugin might choose to use it ... Whatever the issue, you should have this fixed by making sure that
$_SERVER['HTTPS'] is either 'on' or 1
$_SERVER['HTTP_HOST'] and $_SERVER['SERVER_PORT'] are correctly filled

Piwigo uses these variables to build the absolute full url.

Offline

 

#12 2014-01-21 23:22:39

Mark O'Shea
Member
2013-05-27
26

Re: Unable to generate multiple size images when accesing via HTTPS

I've finally managed to fix the problem but have been left feeling slightly embarrassed.

My problems were caused by 'someone' forgetting to include the directives that actually turn on the SSL engine and register the keys for the virtual server.  Yes, you guessed it right, that person was me!

This is what I left out from /etc/apache2/apache2.conf at the bottom of the virtual server configuration section:

SSLEngine on
SSLCertificateFile /etc/ssl/localcerts/apache.pem
SSLCertificateKeyFile /etc/ssl/localcerts/apache.key

In Webmin this is configured in the SSL options menu for the virtual server.

It looks so obvious now, I just don't know how I missed it.

It's great to have my server finally working properly. I can now indulge in my latest past-time of generating batches of multiple sized images when logged in with SSL encryption ;-)

I really appreciate all the help I've had with this. I'm another delighted Piwigo user.

Cheers
Mark

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact