Edit Permission Problem

danjoh
danjoh's picture

Joined: 2009-01-17
Posts: 21
Posted: Sun, 2009-06-07 09:41

When I click on Edit Permissions for a Album I am getting tho following message:
** Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to set AllowOverride FileInfo Options to fix this. ** I have checked my vhost config and the I have this (from server-info):
41: <VirtualHost *:80>
42: ServerAdmin

43: ServerName g3.dev.dmj.nu
49: DocumentRoot "/var/www/g3.dmj.nu/htdocs"
54: <Directory "/var/www/g3.dmj.nu/htdocs">
70: Options -Indexes -FollowSymLinks
78: AllowOverride FileInfo Options
: </Directory>
107: ErrorLog /var/log/apache2/g3.dmj.nu/error_log
: </VirtualHost>

As you can see the options are enabled but I still get the error message. Any suggestions?
--Dan

 
User007

Joined: 2009-06-07
Posts: 2
Posted: Sun, 2009-06-07 14:47

I have the same problem with Gallery 3b1 on Ubuntu. No luck with resolving that.

 
bgriffiths
bgriffiths's picture

Joined: 2002-07-17
Posts: 15
Posted: Mon, 2009-06-08 10:05

watching for suggestions
Gallery 3b1 on Centos5, lighttpd rather than apache (my Gallery 2 installation does not work under apache I think due to forced move without disabling short urls from a host who turned safe mode on and refused to turn it off even temporarily to allow me to migrate properly)
Brian

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2009-06-09 04:20

Gallery 3 determines this by creating a .htaccess file in gallery3/var/tmp, putting mod_rewrite rules in it and making sure that they actually work to protect your data files. In my testing, "AllowOverride FileInfo Options" was enough to cause Apache2 to look at the .htaccess files there. Sounds like either that's not the case for you, or you're editing the wrong config. Did you restart Apache? Can you check your /server-info to make sure that the settings took? You can try "AllowOverride All". Oh and do you have mod_rewrite installed?

---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest zip: http://github.com/gallery/gallery3/zipball/master
Latest git: http://codex.gallery2.org/Gallery:Using_Git

 
danjoh
danjoh's picture

Joined: 2009-01-17
Posts: 21
Posted: Tue, 2009-06-09 17:57

My Server-Info looks like this for mod_rewrite:

Module Name: mod_rewrite.c
Content handlers: yes
Configuration Phase Participation: Create Directory Config, Merge Directory Configs, Create Server Config, Merge Server Configs
Request Phase Participation: Translate Name, Fixups, Content Handlers
Module Directives:
RewriteEngine - On or Off to enable or disable (default) the whole rewriting engine
RewriteOptions - List of option strings to set
RewriteBase - the base URL of the per-directory context
RewriteCond - an input string and a to be applied regexp-pattern
RewriteRule - an URL-applied regexp-pattern and a substitution URL
RewriteMap - a mapname and a filename
RewriteLock - the filename of a lockfile used for inter-process synchronization
RewriteLog - the filename of the rewriting logfile
RewriteLogLevel - the level of the rewriting logfile verbosity (0=none, 1=std, .., 9=max)
Current Configuration:
In file: /etc/apache2/vhosts.d/35_g3.dmj.nu.conf
41: <VirtualHost *:80>
108: RewriteEngine On
: </VirtualHost>

Are the some other Rewrite Option that needs to be set?
--Dan

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2009-06-10 02:13

@danjoh: in Server-Info, check the settings for core.c for your vhost. My default vhost looks like this. Note that you can see that AllowOverride is specified properly:

In file: /etc/apache2/sites-enabled/000-default
   1: <VirtualHost *:80>
   2:   ServerAdmin webmaster@localhost
   4:   DocumentRoot /var/www/
 ...
  24:   <Directory /home/bharat/public_html>
  26:     AllowOverride FileInfo Options
    :   </Directory>
 ...
    : </VirtualHost>

---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest zip: http://github.com/gallery/gallery3/zipball/master
Latest git: http://codex.gallery2.org/Gallery:Using_Git

 
danjoh
danjoh's picture

Joined: 2009-01-17
Posts: 21
Posted: Wed, 2009-06-10 17:51

This is the core.c output for my G3 Dev vhost.

    In file: /etc/apache2/vhosts.d/35_g3.dmj.nu.conf
      41: <VirtualHost *:80>
      42:   ServerAdmin 
      43:   ServerName g3.dev.dmj.nu
      49:   DocumentRoot "/var/www/g3.dmj.nu/htdocs"
      54:   <Directory "/var/www/g3.dmj.nu/htdocs">
      70:     Options -Indexes FollowSymLinks
      78:     AllowOverride FileInfo Options
        :   </Directory>
     112:   ErrorLog /var/log/apache2/g3.dmj.nu/error_log
        : </VirtualHost>

What is the "standard" content of .htaccess?
Mine looks like this

<IfModule mod_php5.c>
  php_value short_open_tag      1
  php_value magic_quotes_gpc    0
  php_value register_globals    0
  php_value session.auto_start  0
  php_value upload_max_filesize 20M
  php_value post_max_size       100M
</IfModule>

--Dan

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2009-06-12 08:21

I don't see anything wrong with your setup. Unfortunately, getting your server config right is a deep rabbit hole and I don't have time to go down it all the way. Best thing you can do is to keep trying to get mod_rewrite working in your gallery3 directory-- once mod_rewrite is working and is configurable by .htaccess then Gallery3's permissions will work. If you figure out what's broken now, please report back and we can add that as a hint in Gallery3 so that others won't suffer similarly.
---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest zip: http://github.com/gallery/gallery3/zipball/master
Latest git: http://codex.gallery2.org/Gallery:Using_Git

 
bgriffiths
bgriffiths's picture

Joined: 2002-07-17
Posts: 15
Posted: Sat, 2009-06-13 20:09

ok - mine is now working.

Switched my server from lighttpd to apache, managed to re-install my G2.3 and get my old gallery data working (at last). Permissions seem to work, although I have not yet managed to work out the permissions hierarchy - eventually I always lock everyone out from all albums except admin. I'm sure it's simple really and I am just being dumb; and I don't think there's a per album password option

Brian

 
danjoh
danjoh's picture

Joined: 2009-01-17
Posts: 21
Posted: Sun, 2009-06-14 09:05

I found what my problem was, it was a "simple" DNS issue.

In the function htaccess_works you create an URL like this

    list ($response) = remote::do_request(url::abs_file("var/tmp/security_test/verify"));

which for my system would end up in

http://g3.dev.dmj.nu/var/tmp/security_test/verify

The problem was that my development host was not able to resolve my alias g3.dev.dmj.nu and hence the response from remote::do_request would end up empty.

Thanks for you support & a great piece of software.
--Dan

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2009-06-14 14:53

Ah ha! Thanks for reporting back @danjoh-- I hadn't thought about that requirement, but yes your server needs to be able to resolve its own hostname for this test to work. I'll see if I can figure out some way to check for that also.
---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest code/upgrading: http://codex.gallery2.org/Gallery3:Upgrading
Latest git: http://codex.gallery2.org/Gallery:Using_Git

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2009-06-14 14:55

I filed http://sourceforge.net/apps/trac/gallery/ticket/402 for this
---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest code/upgrading: http://codex.gallery2.org/Gallery3:Upgrading
Latest git: http://codex.gallery2.org/Gallery:Using_Git

 
talmdal

Joined: 2006-12-06
Posts: 358
Posted: Mon, 2009-06-15 00:15

I had the same problem when mod rewrite was not enabled. Thought I had opened a ticker, but can't seem to find it.
http://www.timalmdal.com

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2009-06-16 03:36

talmdal you're thinking about http://sourceforge.net/apps/trac/gallery/ticket/372 (which is closed, and has a nondescript summary both of which make it hard to find). That's a different issue..
---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest code/upgrading: http://codex.gallery2.org/Gallery3:Upgrading
Latest git: http://codex.gallery2.org/Gallery:Using_Git

 
klim_

Joined: 2009-08-26
Posts: 1
Posted: Wed, 2009-08-26 16:04
danjoh wrote:
I found what my problem was, it was a "simple" DNS issue.

In the function htaccess_works you create an URL like this

    list ($response) = remote::do_request(url::abs_file("var/tmp/security_test/verify"));

which for my system would end up in

http://g3.dev.dmj.nu/var/tmp/security_test/verify

The problem was that my development host was not able to resolve my alias g3.dev.dmj.nu and hence the response from remote::do_request would end up empty.

Thanks for you support & a great piece of software.
--Dan

Hi, someone finds solution for this problem? this problem is only ofr third level domain?

Thanks all

 
nothing_identifiable

Joined: 2009-11-01
Posts: 1
Posted: Sun, 2009-11-01 07:50

If you are sure your config is correct and still receiving the error the following advise worked for me from the open ticket ref'd above.

Would like to request the advise be included in the error message displayed for this dreamy issue.

http://sourceforge.net/apps/trac/gallery/ticket/402

Quote:
Some sort of override here would be nice. To work around I put a file in var/tmp/security_test/verify and permissions work fine here.

So do the following from your gallery root to bypass this test - only recommended if you are certain your server config is correct - cannot speak to any further effects this might have for you:

$ mkdir var/tmp/security_test
$ touch var/tmp/security_test/verify

 
fireman87

Joined: 2009-10-28
Posts: 15
Posted: Tue, 2009-11-24 20:22

One last gotcha. I checked and rechecked mod_rewrite and AllowOverride options, but still kept getting the error message when trying to set album permissions. I also found that creating the security_test directory and verify file worked, but it would only work once and would be deleted. My apache server runs as user wwwrun and group www. If I change the owner and the group to reflect that with rights 644, the file and directory are deleted after the permissions check for setting album rights. If I leave the owner as root and the group as wwwrun with rights 644, the file and directory remain and are not deleted. Hope this is helpful.

Carl