Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I installed postfix, dovecot and squirrelmail on a centos 6.4 VPS based on instructions here. I created a sub-domain bounce.mydomain.co.uk (incase you are wondering why I choose "bounce" - This is a server that sends system generated mails and I want to monitor the bounces and hence the name) and my nginx vhost configuration has the following entries

server {
listen  bounce.mydomain.co.uk;
server_name bounce.mydomain.co.uk;

keepalive_timeout 70;
access_log /home/sridhar/public_html/mydomain/000/log/access.log;
error_log /home/sridhar/public_html/mydomain/000/log/error.log;

location / {
   root /usr/share/;
   index index.php index.html index.htm;
   location ~ ^/squirrelmail/(.+\.php)$ {
      try_files $uri =404;
      root /usr/share/;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index index.php;
      include fastcgi_params;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
       root /usr/share/;
    }
}
location = /plugins/squirrelspell/modules {
   return 403;
}

location = /favicon.ico {
   log_not_found off;
   access_log off;
}
location = /robots.txt {
   allow all;
   log_not_found off;
   access_log off;
}
   # Make sure files with the following extensions do not get loaded by nginx because nginx would display the source code, and these files can con$
location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Templat$
   deny all;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
   deny all;
   access_log off;
   log_not_found off;
}
location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
   expires max;
   log_not_found off;
}
location ~ \.php$ {
   try_files $uri =404;
   include /etc/nginx/fastcgi_params;
   fastcgi_pass 127.0.0.1:9000;
   include fastcgi_params;
   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 }
}

I have two issues that I would like to solve

  1. Visiting bounce.mydomain.co.uk throws a 404 forbidden error though the location / is mapped.I see the following entry in the error log 2014/02/25 07:10:47 [error] 22436#0: *8 directory index of "/usr/share/" is forbidden, client: 122.164.100.194, server: bounce.mydomain.co.uk, request: "GET / HTTP/1.1", host: "bounce.mydomain.co.uk" However visiting http://bounce.mydomain.co.uk/squirrelmail/src/login.php displays the login page. I would like the login page displayed with just the domain name

  2. On login I get an error Error opening ../data/default_pref Default preference file not found or not readable! Please contact your system administrator and report this error. In the error logs I find the following entries 2014/02/25 07:14:52 [error] 22436#0: *53 FastCGI sent in stderr: "PHP message: PHP Warning: Illegal string offset '' in /usr/share/squirrelmail/functions/imap_general.php on line 708" while reading response header from upstream, client: 122.164.100.194, server: bounce.mydomain.co.uk, request: "POST /squirrelmail/src/redirect.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "bounce.mydomain.co.uk", referrer: "http://bounce.bookingwire.co.uk/squirrelmail/src/login.php"

Tried all resources at my disposal but seems its beyond me. Looking forward to some pointers on resolving this.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.