[horde] trean: 404 when deleting or saving after edit - FIXED
Andy Dorman
adorman at ironicdesign.com
Wed Dec 17 19:47:21 UTC 2014
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.
- I also had to set AllowOverride All for the /usr/share/horde/ dir in
Apache so the .htaccess file would be enabled.
- 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.
=== /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
More information about the horde
mailing list