HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=4)
-   -   nginx - Squirrelmail - 404 Not found - uBuntu 11.10 (http://www.howtoforge.com/forums/showthread.php?t=55342)

sellotape 10th December 2011 22:46

nginx - Squirrelmail - 404 Not found - uBuntu 11.10
 
Hi there.

When I attempt to forward or hit 'Send' to send an e-mail I receive a 404 error message in the right 'mail' frame (the left frame with the folders remains).

I have a feeling it might have something to do with squirrelmail not talking to nginx properly but I am unsure what steps to take to resolve.


Thanks

http://www.doublesidedstickytape.co....relmail404.jpg

sellotape 10th December 2011 23:40

I've done a bit of digging and it would appear that there is a problem in the URL...

http://server1.example.com/squirrelmail/src/compose.php/squirrelmail/src/compose.php?mail_sent=yes

I haven't got the foggiest why it's replicating the directory in the URL... Any thoughts?

falko 11th December 2011 22:10

Use http://server1.example.com:8081/squirrelmail/ to access SquirrelMail.

sellotape 11th December 2011 23:10

Hi Falko - It does the same even when using the link you specified.

I think it has something to do with the way Nginx is handling pgp scripts... It is duplicating the directory it is in when attempting to perform an action..

For instance...

http://server1.example.com:8081/squirrelmail/src/compose.php/squirrelmail/src/compose.php?mail_sent=yes

Not figured it out yet... But if anyone knows what is happening please let me know - or if I find out I will post an update here!


Thanks

falko 12th December 2011 19:23

Can you post your /etc/nginx/nginx.conf?

sellotape 12th December 2011 21:44

Hi Falko.

I gave up and did a fresh install with Apache.
I am no expert using Linux but it's something I like to do in my spare time to enhance my knowledge of running a server!

HowtoForge has been a brilliant support site for me - thank you to all for your support!


Please feel free to delete this thread.


Thanks

wiebew 30th December 2012 17:06

The solution for nginx squirrelmail problems
 
Hi Falko the problem lies with the settings to be pasted mentioned in the (otherwise very thrustworthy) perfect server tutorial for step 21 at the bottom. My guess is that the SCRIPT_FILENAME is set wrong in the original script

The wrong settings are:
Code:

location /squirrelmail {
      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_param HTTPS on; # <-- 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 ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
              root /usr/share/;
      }
}
location /webmail {
      rewrite ^/* /squirrelmail last;
}

The good settings are
Code:

location /squirrelmail {
      root /usr/share/;
      index index.php index.html index.htm;
      location ~ ^/squirrelmail/(.+\.php)$ {
              try_files $uri =404;
              root /usr/share/;
              include /etc/nginx/fastcgi_params;
              # To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
              fastcgi_pass 127.0.0.1:9000;
              fastcgi_index index.php;
              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;
      }
      location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
              root /usr/share/;
      }
}
location /webmail {
      rewrite ^/* /squirrelmail last;
}



All times are GMT +2. The time now is 23:07.

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