Horde 5 - Error when communicating with server

Discussion in 'Server Operation' started by johnnygear, Nov 8, 2012.

  1. johnnygear

    johnnygear New Member

    Hi All,

    Really hoping someone has more experience with Horde than I do :)

    Current server setup:
    - ISPConfig3 with Dovecot and Nginx
    - Debian 6

    I installed Horde 5 and I think the install went okay.

    I just have a feeling that my nginx configuration might be a little off as I get 'Error when communicating with server' whenever I go to check mail or do other IMAP related tasks in Horde.

    Please see errors from nginx logs below:
    Code:
    2012/11/08 16:24:18 [error] 28297#0: *1 open() "/var/www/horde/services/ajax.php/imp/viewPort" failed (20: Not a directory), client: MY.IP.ADD.RESS, server: example.com, request: "POST /horde/services/ajax.php/imp/viewPort HTTP/1.1", host: "example.com", referrer: "https://example.com/horde/imp/dynamic.php?page=mailbox"
    2012/11/08 16:24:18 [error] 28297#0: *6 open() "/var/www/horde/services/ajax.php/imp/listMailboxes" failed (20: Not a directory), client: MY.IP.ADD.RESS, server: example.com, request: "POST /horde/services/ajax.php/imp/listMailboxes HTTP/1.1", host: "example.com", referrer: "https://example.com/horde/imp/dynamic.php?page=mailbox"
    2012/11/08 16:30:06 [error] 28297#0: *12 open() "/var/www/horde/services/ajax.php/imp/viewPort" failed (20: Not a directory), client: MY.IP.ADD.RESS, server: example.com, request: "POST /horde/services/ajax.php/imp/viewPort HTTP/1.1", host: "example.com", referrer: "https://example.com/horde/imp/dynamic.php?page=mailbox"
    2012/11/08 16:30:06 [error] 28297#0: *17 open() "/var/www/horde/services/ajax.php/imp/listMailboxes" failed (20: Not a directory), client: MY.IP.ADD.RESS, server: example.com, request: "POST /horde/services/ajax.php/imp/listMailboxes HTTP/1.1", host: "example.com", referrer: "https://example.com/horde/imp/dynamic.php?page=mailbox"
    
    some of my nginx server config (let me know if anymore is required):
    Code:
    [...]
     location ~ \.php$ {
                    fastcgi_pass                                    127.0.0.1:9000;
                    fastcgi_index                                   index.php;
                    include                                         /etc/nginx/fastcgi_params;
                    fastcgi_param                                   HTTPS on;
                    fastcgi_param                                   SCRIPT_FILENAME $document_root$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 {
                    fastcgi_split_path_info         ^(.+\.php)(/.+)$;
                    fastcgi_param   PATH_INFO       $fastcgi_path_info;
                    fastcgi_param   PATH_TRANSLATED $document_root$fastcgi_path_info;
    
                    fastcgi_param   PHP_VALUE       "include_path=.:/usr/share/php";
                    fastcgi_param   PHP_VALUE       "open_basedir=none";
                    fastcgi_param   PHP_VALUE       "upload_tmp_dir=/var/www/horde/phptmp/";
            }
    [...]
    
    I added the top 3 lines in the horde location after doing some reading on horde / nginx issues someone else had posted about, but it has not rectified the issue.

    If anyone needs any other outputs or configs from my server please let me know.

    Thanks,

    JG
     
  2. johnnygear

    johnnygear New Member

    I have been trying to figure this out some more tonight.

    What seems odd to me is that when I log into horde, on the summary page, it lists how many emails I have, so it must be accessing my imap account.

    Yet, when I look in at the Mail tab of horde, I still get the "Error when communicating with server".

    JG
     
  3. pvanthony

    pvanthony Active Member HowtoForge Supporter

    Hi,

    Here is my nginx config for Horde. It is working for me. Try it out. Please note that I am not an expert and also please check if the settings are ok for security.

    ----------------- start ------------------------
    location /horde {
    root /var/www/apps/;
    index index.php index.html index.htm;

    location ~ \.php {
    fastcgi_param PHP_VALUE "cgi.fix_pathinfo=1";
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    #fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
    #try_files $uri =404;
    root /var/www/apps/;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param HTTPS on;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;

    # pvanthony added this because of timeout problem when
    # importing addressbook.
    fastcgi_connect_timeout 300s;
    fastcgi_send_timeout 300s;
    fastcgi_read_timeout 300s;

    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))$ {
    root /var/www/apps/;
    }
    }

    ------------------ end ------------------------

    P.V.Anthony
     
  4. the_matrix

    the_matrix New Member

    Thanks its worked like a charm.

    I have searched so many threads and this one worked very well

    Regards.
     
  5. Qetf5343

    Qetf5343 New Member

    Thanks, works great!

    I succeeded to reduce it only to:
    location ~ \.php {
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param HTTPS on; # if nginx not uses SSL, but behind SSL load balancer proxy
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;
    }

    Actually fastcgi_split_path_info ^(.+\.php)(/.+)$; can be added to default nginx php location, with one change: default php location is ~ \.php$ (in means .php is at the and of uri), you can delete $ symbol and add this fastcgi_split_path_info directive.
     

Share This Page