[horde] trean: 404 when deleting or saving after edit - FIXED

Vilius Sumskas/LNK vilius at lnk.lt
Wed Dec 17 21:51:53 UTC 2014


Hi,

>On 12/16/2014 02:59 PM, Vilius Sumskas/LNK wrote:
>> Hi,
>>
>>> This is from the browser Firebug
>>> ==========================
>>> Request URL:http://beta.mail.comehome.net/trean/b/save
>>> Request Method:POST
>>> Status Code:404 Not Found
>>>
>>
>> <...>
>>
>>
>>> === /etc/apache2/conf-available/php-horde.conf ===
>>> Alias /horde /usr/share/horde
>>>
>>> <Directory /usr/share/horde>
>>>     Options Indexes FollowSymLinks
>>>     AllowOverride All
>>>     Require all granted
>>>     <IfModule mod_rewrite.c>
>>>       RewriteEngine On
>>>       RewriteBase /horde
>>>       RewriteCond %{REQUEST_FILENAME} !-d
>>>       RewriteCond %{REQUEST_FILENAME} !-f
>>>       RewriteRule ^(.*)$ index.php/$1 [QSA,L]
>>>     </IfModule>
>>> </Directory>
>>
>> You RewriteBase is wrong. It needs to be adjusted according to your
>URL
>> base folder.
>>
>
>Vilius, thank you, you were correct...I did not understand what you
>were 
>telling me until I enabled trace6 debug logging for Apache and saw
>what 
>was happening...
>
>The rewrite would first come up with /usr/share/horde/rampage.php
>based 
>on the URL DocumentRoot (which is correct) BUT then it added the
>Rewrite 
>base, /horde, and tried to find /usr/share/horde/horde/rampage.php
>which 
>of course does not exist.
>
>I removed the RewriteBase and Alias directives and everything works
>now.
>
>So here are the final working configs (Debian/Apache 2.4/PHP 
>5.6/php5-fpm) using the .htaccess for config instead of the 
>php-horde.conf file above in case it will help anyone...
>
>Some caveats:
>- I have the apache compatibility module enabled so the .htaccess
>file 
>with the "allow from all" directive will work.

You could probably fill an enchancement request for this. I don't remember if .htaccess allows <If> statements but it should be possible to make provided .htaccess compatible with both 2.2 and 2.4 versions of Apache. RPM package for phpMyAdmin does this in .conf file.

>- I also had to set AllowOverride All for the /usr/share/horde/ dir
>in 
>Apache so the .htaccess file would be enabled.

That's true. I've noticed that default config for 2.4 is to deny everything and AllowOverride is only enabled under main DocumentRoot which is probably not the /usr/share/ directory in most systems. Could be mentioned in Horde documentation.

>- the configs below do not have the rewrites needed for ActiveSync
>that 
>were discussed here http://wiki.horde.org/ActiveSync
>- As Vilius says, your RewriteBase depends on your base URL (Apache 
>DocumentRoot).  In my case my DocumentRoot is complete and I do not
>need 
>a RewriteBase at all.

Also check your cookie_path in Horde configuration. It could be also incorrect if you left the default.

>=== /usr/share/horde/.htaccess ===
># IMPORTANT: DO NOT EDIT THIS FILE!
># It will be overwritten with any future upgrade.
>
>allow from all
>
><IfModule mod_rewrite.c>
>     RewriteEngine On
>     RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
>     RewriteCond   %{REQUEST_FILENAME}  !-d
>     RewriteCond   %{REQUEST_FILENAME}  !-f
>     RewriteRule ^(.*)$ rampage.php [QSA,L]
></IfModule>
>
>=== /etc/apache2/sites-available/z.anydomain.anymail.com.conf ===
><VirtualHost *:80>
>   ServerName mail.fanmail.com
>   DirectoryIndex index.php
>   DocumentRoot /usr/share/horde/
>   IPCCommTimeout 120
>   SuexecUserGroup antespam antespam
>   Redirect permanent /.well-known/caldav /rpc.php
>   ProxyPassMatch ^/(.*\.php(/.*)?)$ 
>fcgi://127.0.0.1:9000/usr/share/horde/$1
></VirtualHost>
>
>
>-- 
>Andy Dorman

-- 
   Vilius


More information about the horde mailing list