I seem to be having some .htaccess trouble

elpablot

Joined: 2009-07-20
Posts: 4
Posted: Tue, 2009-07-21 16:13

Hi.

I have given G3 a try and I seem to be having some trouble. Some background info, I use Dreamhost as the host and the PHP version is 5.2.9

The trouble is, when I change the permissions so that only registered users can see the photos, all photos become blank. If I try to navigate directly to a photo via a direct link it simply says "No input file specified.". It looks to me like the .htaccess file was generated correctly:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule (.*) /gallery3/index.php/file_proxy/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
  Order Deny,Allow
  Deny from All
</IfModule>

Just for kicks I tried to enable short urls in the root .htaccess and this caused even more problems. It is now failing to load the css. If I try to open the URL to the combined css directly it will say "Content Encoding Error" in FF3.5 and it will give me a blank css in chrome, BUT if I use wget to get the file I get the css correctly... Does this give any clues as to what is wrong? I can help debug this process, if I get some help and pointers.

regards
/p

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7934
Posted: Thu, 2009-07-30 18:14

There's probably a clue in your Apache error logs telling you why you're getting an error. Without that clue, it's hard to tell what's going wrong. Can you ask Dreamhost for help here?
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
liujason

Joined: 2007-07-03
Posts: 18
Posted: Sun, 2009-08-02 14:53

I'm having the exact same problem. The full size image doesn't show up. The link is pointing to an exist image which I checked the existence through FTP. If I directly visit the URL, it gave me No input file specified error.
I had permission set for Everyone: no permission to view full size, Registered user: yes. The htaccess is the same as OP posted. I'm with Dreamhost too.

Thanks.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7934
Posted: Mon, 2009-08-03 03:52

I need more info to diagnose this. Can anybody who is having this problem trawl through their Apache error logs to see if there's anything relevant in there?
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
liujason

Joined: 2007-07-03
Posts: 18
Posted: Mon, 2009-08-03 20:39

Hi bharat, Thanks for your reply. I have contacted DH, and found the error.log file, but it doesn't seem to have any relevant information regarding to this issue... From the access.log file, I can see the http request to access the gallery3/var/albums/xxx/xxx.jpg , but at that time stamp, there is no error logged.

 
elpablot

Joined: 2009-07-20
Posts: 4
Posted: Thu, 2009-08-06 19:43
liujason wrote:
Hi bharat, Thanks for your reply. I have contacted DH, and found the error.log file, but it doesn't seem to have any relevant information regarding to this issue... From the access.log file, I can see the http request to access the gallery3/var/albums/xxx/xxx.jpg , but at that time stamp, there is no error logged.

Same thing here, nothing relevant in the apache logs. I'll await your answer from DH.

Edit: Seems like DH must have changed something because now all the problems I had in my initial post are gone and I have done nothing to fix it...

 
slegge

Joined: 2009-08-07
Posts: 6
Posted: Sat, 2009-08-08 00:18

I'm having the same problem too. Installed today, on dreamhost. Nothing comes up in apache error.log or Gallery3 logdir.

Relevant part of access log:

Quote:
[IP] - - [07/Aug/2009:11:37:52 -0700] "GET /gallery3/index.php/quick/pane/26?page_type=album HTTP/1.1" 200 999 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:54 -0700] "GET /gallery3/index.php/album HTTP/1.1" 200 3851 "http://[site.com]/gallery3/index.php/" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:54 -0700] "GET /gallery3/index.php/combined/javascript/9d57ba3441e46c094dd3e2826dc9a5ae.js HTTP/1.1" 304 318 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:55 -0700] "GET /gallery3/index.php/combined/css/d2a2c2064d4bc167f958908cacced9a3.css HTTP/1.1" 304 318 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:55 -0700] "GET /gallery3/themes/default/images/logo.png HTTP/1.1" 304 173 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/var/thumbs/album/photo2008-05-17T13_02_52-000038.jpg?m=1249665888 HTTP/1.1" 200 296 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/var/thumbs/album/photo2008-05-17T13_01_04-000034.jpg?m=1249665888 HTTP/1.1" 200 297 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/var/thumbs/album/photo2008-05-17T13_00_54-000033.jpg?m=1249665888 HTTP/1.1" 200 297 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/var/thumbs/album/photo2008-05-17T13_01_12-000035.jpg?m=1249665888 HTTP/1.1" 200 297 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/var/thumbs/album/photo2008-05-17T13_01_48-000037.jpg?m=1249665888 HTTP/1.1" 200 297 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/var/thumbs/album/photo2008-05-17T13_03_02-000039.jpg?m=1249665888 HTTP/1.1" 200 296 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/themes/default/images/ico-separator.gif HTTP/1.1" 304 171 "http://[site.com]/gallery3/index.php/combined/css/d2a2c2064d4bc167f958908cacced9a3.css" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/lib/themeroller/images/ui-icons_469bdd_256x240.png HTTP/1.1" 304 173 "http://[site.com]/gallery3/index.php/combined/css/d2a2c2064d4bc167f958908cacced9a3.css" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/themes/default/images/ico-view-slideshow.png HTTP/1.1" 304 172 "http://[site.com]/gallery3/index.php/combined/css/d2a2c2064d4bc167f958908cacced9a3.css" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/lib/superfish/images/arrows-ffffff.png HTTP/1.1" 304 171 "http://[site.com]/gallery3/index.php/combined/css/d2a2c2064d4bc167f958908cacced9a3.css" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/lib/themeroller/images/ui-bg_glass_85_dfeffc_1x400.png HTTP/1.1" 304 171 "http://[site.com]/gallery3/index.php/combined/css/d2a2c2064d4bc167f958908cacced9a3.css" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"
[IP] - - [07/Aug/2009:11:37:56 -0700] "GET /gallery3/var/thumbs/album/photo2008-05-17T13_01_22-000036.jpg?m=1249665888 HTTP/1.1" 200 297 "http://[site.com]/gallery3/index.php/album" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11"

 
slegge

Joined: 2009-08-07
Posts: 6
Posted: Mon, 2009-08-10 19:50

I have been in contact with DH customer support, and they say they're using a plain apache and mod_rewrite install.

Is there any inbuilt debugging I could activate to try and narrow down the problem?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22892
Posted: Mon, 2009-08-10 23:46
Quote:
Is there any inbuilt debugging I could activate to try and narrow down the problem?

FAQ: How do I see debug information?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
slegge

Joined: 2009-08-07
Posts: 6
Posted: Tue, 2009-08-11 17:33
floridave wrote:
Quote:
Is there any inbuilt debugging I could activate to try and narrow down the problem?

FAQ: How do I see debug information?

Dave

Thanks :)

 
slegge

Joined: 2009-08-07
Posts: 6
Posted: Tue, 2009-08-11 20:42

I've been trying to do some debugging to find out where this problem occurs.

My basic understanding on how this works is as follows (Please correct me if wrong):

1. Someone tries to load the image using the direct uri (http://site.com/gallery3/var/albums/album/img.jpg)
2. mod_rewirte redirects this to http://site.com/gallery3/index.php/file_proxy/img.jpg
3. modules/gallery/controllers/file_proxy.php should be called trough some magic
4. after checking SERVER_REQUEST_URI for correct dir and file it checks permissions ...
5. ...sets mime type and invokes fpassthru so the browser gets the image.

I have enabled debugging output using local.php (from FAQ)
I have set $config["log_threshold"] = 4; in application/config/config.php
This by itself didn't add anything relevant to the log files, so i added some kohana::log('debug', ''); lines in file_proxy.php. They are before the class statement, after $request_uri is unescaped and before kohana::show_404() statements.

When I load index.php I don't see my own debug statements. Same if I access a image directly. However, if I try to access gallery3/index.php/file_proxy/photo2008-05-17T13_03_02-000039.jpg I get my own debug statements in the log. (It dies on the var/ check).

As it seemed the file was most likely redirected wrongly, I tried adding http://site.com to the mod_rewrite rule. This however will not produce the _SERVER["REDIRECT_SCRIPT_URI"] variable, and will thus not produce images. But it redirects correctly as file_proxy.php is called and i get my debug statements in the log file.

I have tried to test mod_rewrite using with a plain html file, that gets redirected to a php file that just runs phpinfo(). It seems like it behaves properly in my test case. I will see if I'm able to come up with some more advanced test cases later on.

If anyone have any ideas or hints they would be most welcome :)

~Slegge

EDIT: Added forgotten index.php in step two :)

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7934
Posted: Tue, 2009-08-11 20:11

The request should be getting rewritten to http://site.com/gallery3/index.php/file_proxy/img.jpg which does the magic to pass it on to the file_proxy controller. It sounds like that rewrite rule isn't firing properly. What's in the .htaccess file in var/albums/album? Let's see if we can get that right.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
slegge

Joined: 2009-08-07
Posts: 6
Posted: Tue, 2009-08-11 20:40

Edit: typo in my last post, i did indeed mean gallery3/index.php/file_proxy/img.jpg

Seems correct to me. When i try to open a image i get "No input file specified." (And no debug info in the log file at all)(no html, just plain text as far as i can tell). If i change [L] to [R], or adds http://site.com in front of the url, file_proxy gets called. (but wont work ofcourse)

.htaccess file wrote:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule (.*) /gallery3/index.php/file_proxy/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
Order Deny,Allow
Deny from All
</IfModule>

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7934
Posted: Thu, 2009-08-13 18:51

The "No input file specified" error seems to be related to mod_rewrite config issues with PHP as CGI. http://www.google.com/search?q=%22No+input+file+specified%22

I'm not sure what's going wrong for sure, though.. somebody will have to dig into your setup to figure it out. If you can provide me with ssh access, I'll be willing to poke around a bit.

---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
slegge

Joined: 2009-08-07
Posts: 6
Posted: Fri, 2009-08-28 16:57

When changing my PHP options in dreamhost panel from "PHP5 Fastcgi" to "PHP5 cgi" everything seems to be in order.

It seems script_filename isn't set for "PHP5 Fastcgi".

Thanks for all the help :)

 
smashkins
smashkins's picture

Joined: 2009-09-30
Posts: 7
Posted: Sat, 2009-10-03 10:59

I have the same problems on "dreamhost" hosting.

Is this the only solution for this problem? Change PHP options in dreamhost panel from "PHP5 Fastcgi" to "PHP5 cgi" ?

 
sddroog

Joined: 2005-02-01
Posts: 132
Posted: Wed, 2009-10-28 11:02

Same problem here. I cannot find how to change the PHP5 Fastcgi setting. Tried the MultiViews options without any luck.

 
sddroog

Joined: 2005-02-01
Posts: 132
Posted: Wed, 2009-10-28 18:46

Just upgraded to version 16 and the problem disappeared. Thanks!