Problem with mod_rewrite and AllowOverride
hatter
![]()
Joined: 2009-07-22
Posts: 10 |
![]() |
I *think* I have this setup correctly, but I'm still getting the following error message when I try to edit the permissions on an album. Is anyone else having this problem? Quote:
Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to enable mod_rewrite and set AllowOverride FileInfo Options to fix this. The following is from my .htaccess file: Quote:
<IfModule mod_rewrite.c> and the following is from my httpd.conf Quote:
<VirtualHost *:80> I have also installed the latest apache and made sure to enable the rewrite module. Any ideas? Thanks! |
|
DrLou
Joined: 2008-11-14
Posts: 55 |
![]() |
hatter, I'm getting the same error about mod_rewrite, and also have it and AllowOverride FileInfo Options set in my .conf file (not in .htaccess, by the way). But my configuration doesn't look quite the same as yours; it's a vestige of the Gallery2 days. Where did you find documentation on this? Lou |
|
hatter
![]()
Joined: 2009-07-22
Posts: 10 |
![]() |
I also upgraded from Gallery2. I've successfully imported my userbase and photos. I've even made some progress customizing the theme. (By the way Gallery team, excellent work on the reorganization of the themes!) All looks good except for the error I'm getting. The snippet from my .htaccess was created by gallery3 I believe. The "AllowOverride FileInfo Options" was a part of my gallery2 installation and I just copied that section into the new subdomain. I think I'm going to do a fresh install and see if the error persists. |
|
DrLou
Joined: 2008-11-14
Posts: 55 |
![]() |
Quote:
The snippet from my .htaccess was created by gallery3 I believe If so, that would be most interesting, as I have no .htaccess file at all - for security reasons, we don't use them as a policy - and the Rewrite Engine section of my conf file looks nothing like yours! |
|
hatter
![]()
Joined: 2009-07-22
Posts: 10 |
![]() |
That is odd. Perhaps it would be prudent to wait for beta 3 to see if this clears up on its own. Other than that, everything seems to look great. |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
DrLou, I already responded to you once about this. G3 ships with a .htaccess file in the root gallery. Gallery never has and very most likely never will ever edit your conf file. If the .htaccess file isn't there, that really sounds like you are using Yahoo or some other host that doesn't allow .htaccess files on the server. Download the current beta to your local computer and unzip it, you'll see the .htaccess file sitting right there. |
|
DrLou
Joined: 2008-11-14
Posts: 55 |
![]() |
Nikekiam, Yes, you did - and thank you again for your hard work. I had cross-posted this item here as a response to hatter, as we were having the same error message. And first, to acknowledge my error: G3 does indeed write an .htaccess file. But we have a long-standing aversion to .htaccess files, so I copied all the rewriting rules to the Apache conf file's Directory section for Gallery3, set AllowOverride to none, and the rewriting rules work great! Nice work, guys! |
|
pcmike
Joined: 2002-10-12
Posts: 36 |
![]() |
I'm having the same problem as described and I can't seem to fix it either. =\ |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
pcmike, do you have access to httpd.conf or what ever your server config file is named? http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride |
|
hatter
![]()
Joined: 2009-07-22
Posts: 10 |
![]() |
Does it matter that I'm using a virtual host, by chance? I've gone through my settings a number of times, and everything seems to be in order. Is there another way to test that these options are enabled? |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
hatter
![]()
Joined: 2009-07-22
Posts: 10 |
![]() |
I have shell access to my server. I've been using gallery2 for quite some time now and it had AllowOverride FileInfo Options enabled. I have it setup the same thing for my gallery3 installation. I'm using modrewrite on another part of my site, so I'm not sure what the problem could be. Could you be more specific about what I should verify? |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
AllowOverride can only be set in the Directory section of httpd.conf If you haven't set this for the server config, make sure you've set this for the VirtualHost container for your site and that the Directory directive does indeed specify the directory for your G3 install. Or just set AllowOverride FileInfo Options for the entire server first and make sure that's working. <Directory /> AllowOverride FileInfo Options </Directory> ____________________________________________ |
|
hatter
![]()
Joined: 2009-07-22
Posts: 10 |
![]() |
I'll check everything again. I think it's time to reorganize all of my sites. I thought I had everything setup correctly, but there's probably a typo somewhere. Thanks for the reply. I'll report back any findings. |
|
tallthom
Joined: 2008-02-04
Posts: 6 |
![]() |
Apologies for hashing up an older thread, but was there ever a resolution to this issue? I'm seeing the same error when I try to Edit Permissions on an album. My .htaccess file: My virtual server setup: I've enabled rewrite through Webmin and restarted apache, but still see this message. Could someone guide me as to what I could look for next in my setup? Thanks in advance for the help. Love the new look-n-feel of G3, by the way. |
|
x3m.es
Joined: 2009-12-25
Posts: 1 |
![]() |
hatter wrote:
I *think* I have this setup correctly, but I'm still getting the following error message when I try to edit the permissions on an album. Is anyone else having this problem? Hi, Sample if G3 is http://your_host/ you must add to /etc/hosts 127.0.0.1 your_host |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
Quote:
if G3 is http://your_host/ you must add to /etc/hosts If and only if you don't have a DNS setup properly. Hosting on a local, non-public server is by far not the majority of the users out there. If your site is public OR your domain names (or host names) resolve correctly you'll not have any problems with this. |
|
rkillcrazy
![]()
Joined: 2007-08-11
Posts: 30 |
![]() |
I'm still having trouble with this error. I've been messing with this for a few hours and I'm now at wit's end.... I've done all the tweaks that I could find and understand. I'm not new to Linux per se` but I'm no web-dev guy so knowing how to tweak Apache was never my strong point. I'm certainly not a noob with Linux but I'm no wizard either. I'm afraid, if I tweak much else, I may break it to the point that I can't recall what I've done in order to undo it! Any help would be great! Ubuntu Linux 10.04.1 What I have: <IfModule mod_php5.c> php_flag short_open_tag On php_flag magic_quotes_gpc Off php_flag magic_quotes_sybase Off php_flag magic_quotes_runtime Off php_flag register_globals Off php_flag session.auto_start Off php_flag suhosin.session.encrypt Off php_value upload_max_filesize 20M php_value post_max_size 100M </IfModule> # Try to disable the parts of mod_security that interfere with the Flash uploader # <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> # Increase security by uncommenting this block. It keeps browsers # from seeing support files that they shouldn't have access to. We # comment this out because Apache2 requires some minor configuration # in order for you to use it. You must specify "AllowOverride Limit" # in your Apache2 config file before you uncomment this block or # you'll get an "Internal Server Error". # # <FilesMatch "(\.(class|fla|inc|sql|txt|gitignore)|(README|LICENSE))$"> # Order allow,deny # </FilesMatch> # Improve performance by uncommenting this block. It tells the # browser that your images don't change very often so it won't keep # asking for them. If you get an error after uncommenting this, make # sure you specify "AuthConfig Indexes" in your Apache config file. # # <IfModule mod_expires.c> # ExpiresActive On # # Cache all files for a month after access (A). # ExpiresDefault A2678400 # # Do not cache dynamically generated pages. # ExpiresByType text/html A1 # </IfModule> # You can use the mod_rewrite Apache module to get rid of the # "index.php" from your Gallery 3 urls. Uncomment the block below # inside the <IfModule> ... </IfModule> lines and then edit the # RewriteBase line to match your Gallery 3 URL. # # Here are some RewriteBase values: # Gallery 3 URL RewriteBase line # ============= ==================== # http://example.com/gallery3 RewriteBase /gallery3 # http://example.com/~bob/photos RewriteBase /~bob/photos # http://gallery3.example.com/ RewriteBase / # # Then just use your Gallery 3 without the index.php in the url. # # NOTE: future upgrades of Gallery 3 will overwrite this file! If you # want these changes to be persistent, talk to your system admin about # putting this block into your Apache config files. # <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L] RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L] </IfModule> /etc/apache2/sites-available/default <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride All AllowOverride FileInfo Options </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride All Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost> Running modules user@apache:/etc/apache2/sites-available$ sudo apache2ctl -M apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName Loaded Modules: core_module (static) log_config_module (static) logio_module (static) mpm_prefork_module (static) http_module (static) so_module (static) alias_module (shared) auth_basic_module (shared) authn_file_module (shared) authz_default_module (shared) authz_groupfile_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) cgi_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) mime_module (shared) negotiation_module (shared) php5_module (shared) reqtimeout_module (shared) rewrite_module (shared) setenvif_module (shared) ssl_module (shared) status_module (shared) Syntax OK user@apache:/etc/apache2/sites-available$
2010-09-03 |
|
inposure
![]()
Joined: 2010-04-23
Posts: 304 |
![]() |
This problem has arisen on all setups I have encountered. That includes two shared hosting environments, one VPS and my own machine at home. In all cases, it has been a cosmetic error, that is, there is an error message but there is no problem with the setup or actually hiding items. Therefore it is a bug, and it is a SERIOUS bug. Does anyone know where this code is executed in Gallery? I am curious as to how it determines the server setup. |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
This is one of the very few remaining bugs that's keeping us from launching the 3.0 final release. https://sourceforge.net/apps/trac/gallery/ticket/1209 I am very motivated to fix it, but I have not been able to reproduce it and it seems to be very related to Apache configurations. If it would be possible to give me direct access to your system, I bet I can figure it out but it's super hard to diagnose remotely. I'll need ssh access, so if you're willing to share please send me a PM and I'll give it a shot. |
|
bromide
![]()
Joined: 2010-08-20
Posts: 28 |
![]() |
There is a possible solution to this problem at the end of this thread. |
|
inposure
![]()
Joined: 2010-04-23
Posts: 304 |
![]() |
That solution works with my Mac OS X test installation, but not with my Ubuntu VPS installation. |
|
rkillcrazy
![]()
Joined: 2007-08-11
Posts: 30 |
![]() |
According to the ticket: http://sourceforge.net/apps/trac/gallery/ticket/1335 the issue has been fixed in the latest release. Where is the latest release? I have RC2 running on my Ubuntu 10.04.1 LTS install. |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Upgrade to the latest experimental release; see my signature for upgrade links. |
|
rkillcrazy
![]()
Joined: 2007-08-11
Posts: 30 |
![]() |
bharat wrote:
Upgrade to the latest experimental release; see my signature for upgrade links. Nope, upgrading didn't fix the issue. Should I assume you still want access to my install? If so, I'll leave it alone and you already have my PM with the details. If not, I'll blow out the user. Furthermore, do you also need a login for the gallery admin pages - so you can see the screen/error I keep getting? 2010-09-06 |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
@rkillcrazy: I'm confused as to what your issue is. Ticket #1335 is about you getting an error message when you go to Album > Edit Permissions -- but when I do that on your site I don't see any error message and your permissions all work. Can you please describe the problem you're seeing? |
|
rkillcrazy
![]()
Joined: 2007-08-11
Posts: 30 |
![]() |
I still get it. |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Wacky. It works for me on your site. Are you using the same url that you gave me? If you use a different url, it will confused mod_rewrite. |
|
rkillcrazy
![]()
Joined: 2007-08-11
Posts: 30 |
![]() |
Wait!!! I just noticed something... I was going to HTTPS - not HTTP. My Apache answers to HTTPS as well and I have a habit of using it - like using HTTPS is a bad habit So, the issue only seems to show up when I use HTTPS. Is that by design or some other quirk we need to look into? Good call on the URL though! I would've never suspected that would make a difference. |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Ah ha! Check your SSL vhost and make sure that it has the right settings. I just verified on my own site that the verification code works just fine with https as long as the permissions are set properly. |
|
rkillcrazy
![]()
Joined: 2007-08-11
Posts: 30 |
![]() |
bharat wrote:
Ah ha! Check your SSL vhost and make sure that it has the right settings. I just verified on my own site that the verification code works just fine with https as long as the permissions are set properly. Understood. I'll see what I can find. I'm not overly Apache-savvy though. |
|
thegrue
Joined: 2010-09-17
Posts: 9 |
![]() |
Hello, I cloned galley3 from your git repository and have this error, too I have this in my apache config: Quote:
<Directory /srv/www/gallery3/> Quote:
markus@benji (git)-[master] % pwd Quote:
rgrep FollowSymLinks . I have mod_rewrite activated for gallery2 where it works fine. I'm fulltime linux user and do some administration but know next to nothing about apache... TIA |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
@thegrue, would you please start a new topic? Please include any relevant info from your gallery3/var/logs error logs and your apache2 error logs. |
|
malavka
![]()
Joined: 2010-09-21
Posts: 5 |
![]() |
Hi, everybody! I also have a problem with the AllowOverride Fileinfo Options, like the hatter. I put the G3 (gallery-gallery3-3.0-rc-2-346-g93d1a81.zip)in the gallery folder - site.ru/gallery/ How to modify a file .htaccsess, to edit right on the album? mod_rewrite on my ho ON, I learned this moment with my hoster. I tried to modify .htaccsess from instructions, but get an error 500. Thanks in advance! |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
@malavka: what's in your apache2 error logs when you get the 500 error? |
|
malavka
![]()
Joined: 2010-09-21
Posts: 5 |
![]() |
bharat Thank you for your work and answer! Сan I somehow find itself without requiring a hosting provider? I have a suggestion: Maybe should make an example of properly written .htaccess file for those newbies like me? Or generates it automatically, as in Joomla? From the beginner just want to rename Htaccess.txt в .htaccess. This will greatly simplify the task. |
|
rkillcrazy
![]()
Joined: 2007-08-11
Posts: 30 |
![]() |
malavka wrote:
bharat Thank you for your work and answer! The .htaccess file comes with the package. Bharat would know, better than I, about its defaults but it's there by default. Just look at the zip file.... |
|
malavka
![]()
Joined: 2010-09-21
Posts: 5 |
![]() |
I probably did not properly expressed. |
|
rkillcrazy
![]()
Joined: 2007-08-11
Posts: 30 |
![]() |
malavka wrote:
I probably did not properly expressed. Again, Bharat would know better than I, but I think the defaults that are built into that file should work for most vanilla installs. I've only ever had to tweak it for special occasions. |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
The error logs are on the server, there is no way for Gallery to access them. You'll need to either know where they are at and how to access them, most hosts allow access to your error logs through your control panel, some do not. You'll need to contact your host. |
|
malavka
![]()
Joined: 2010-09-21
Posts: 5 |
![]() |
ОК! I got rid of the index.php, I made a mistake last time just did not correct the 71 line .htaccess 8) . I will write again 2 my hoster about this message . Look snapshot - http://averuga.org/Snap1.jpg |
|
malavka
![]()
Joined: 2010-09-21
Posts: 5 |
![]() |
bharat, check PM, plz. |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Hi, Malavka. Thanks for the PM -- I will be happy to dig into this if you can give me ssh access to your account so that I can reproduce the problem. Send me another PM with the details, thanks! |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
@malavka: do you, by any chance, have two different URLs that you use to access your Gallery 3 install? If so, do you get this warning when you use one url but not the other? |
|
Bobses
Joined: 2010-08-15
Posts: 3 |
![]() |
Well, after upgrade to G3 final release, I receive this error: Quote:
Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to enable mod_rewrite and set AllowOverride FileInfo Options to fix this. Until to upgrade, my gallery works fine. LE: my gallery - http://www.feroviarul.ro/galerie-foto/ |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
What did you upgrade from? It's possible that we were incorrectly thinking that it was working before, and now we're properly detecting that it doesn't... |
|
Bobses
Joined: 2010-08-15
Posts: 3 |
![]() |
Upgrade from 3.0 RC2 to 3.0. Gallery 3.0 RC2 has worked well until upgrade. Now, I cannot set album's cover, etc. |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
Anything in your var/logs? Same here bharat or similar (regarding album covers): If the host isn't restricting hidden files then I'm not sure what's going on. |
|
rachely476
Joined: 2010-10-06
Posts: 1 |
![]() |
pcmike wrote:
I'm having the same problem as described and I can't seem to fix it either. =\ Thanks for sharing the link! |
|
Bobses
Joined: 2010-08-15
Posts: 3 |
![]() |
nivekiam wrote:
Anything in your var/logs? That is the file which is in var/logs: Quote:
<?php defined('SYSPATH') or die('No direct script access.'); ?> |
|
umbralechoes
Joined: 2010-03-15
Posts: 7 |
![]() |
I get this error as well. I'm using BlueHost as my hosting provider, not sure if that makes a difference or not. I'm using a default/vanilla Gallery 3 (final) installation. mod_rewrite is enabled on my server -- Wordpress seems to be able to use it fine. Let me know if any of you debugger-types want more info about my server. I unfortunately don't have an SSH login to give you though. I do notice that when I uncheck the option for people to see the fullsize versions of pictures, that still "takes" regardless of this warning, and that was my main concern. |
|