HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   How to replace Apache with Nginx on Horde installation? (http://www.howtoforge.com/forums/showthread.php?t=58280)

swehes 15th August 2012 20:39

How to replace Apache with Nginx on Horde installation?
 
So I followed the instructions on "Install Horde 4 Webmail For ISPConfig On Debian Squeeze Through PEAR" on a clients Ubuntu Machine. It worked great (after I realized I needed to go in and point IMP to my email server). However on my own machine I am running Nginx for testing and I have been trying to figure out how to make the Directive work.

I found some samples at http://comments.gmane.org/gmane.comp.horde.user/28055 but even with changing some things to fit more in my server, it still doesn't work. Then I took my Roundcube directives and tried to change the root folder and directory so it would point in the right direction but still get the 404 error.

Does anyone running nginx and Horde have the instructions on how to get it to work?

Also what PHP open_basedir does Horde need in ISPconfig?

falko 16th August 2012 11:56

Where exactly do you get the 404?

Can you post the Apache rewrite rules and the ones you're using for nginx so far?

swehes 17th August 2012 01:51

The 404 comes with I try http://www.domain.com/horde

Directives for Apache I just used the howtoforge instructions on http://www.howtoforge.com/install-ho...e-through-pear

Alias /Microsoft-Server-ActiveSync /var/www/horde/rpc.php
Alias /horde /var/www/horde
<Directory /var/www/horde>
Options +FollowSymLinks
AllowOverride None
order allow,deny
allow from all
AddType application/x-httpd-php .php
php_value include_path ".:/usr/share/php"
php_value open_basedir "none"
php_value upload_tmp_dir "/var/www/horde/phptmp/"
</Directory>

Nginx directives according to http://comments.gmane.org/gmane.comp.horde.user/28055
location ~ \.php {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param HTTPS $php_https;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location /Microsoft-Server-ActiveSync {
alias /var/www/horde/rpc.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param HTTPS $php_https;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

Trying to use Roundcube directives with Horde changes:
location /horde {
root /var/www/;
index index.php index.html index.htm;
location ~ ^/horde/(.+\.php)$ {
try_files $uri =404;
root /var/www/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param HTTPS $fastcgi_https; # <-- add this line
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
location ~* ^/horde/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt|php ))$ {
root /var/www/;
}
}
location /webmail2 {
rewrite ^/* /horde last;
}

falko 18th August 2012 13:25

Does Horde use any .htaccess files with rewrite rules?

swehes 19th August 2012 03:11

Yes. The .htaccess is as follows.

allow from all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ rampage.php [QSA,L]
</IfModule>

falko 19th August 2012 12:16

Quote:

Originally Posted by swehes (Post 283912)
allow from all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ rampage.php [QSA,L]
</IfModule>

This is equivalent to

Code:

      location / {
                try_files $uri $uri/ /rampage.php?$args;
      }

on nginx.


All times are GMT +2. The time now is 01:33.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.