after installing iRedMail my nginx 404 error

February 20, 2015 2.8k views
Email Nginx

i tried to install iRedMail and now all my domains are down. I didnt touch any blocks configuration files. i follow this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-iredmail-on-ubuntu-12-04-x64

the issue is i dont have /var/www/html folder at all. why its looking for "html" folder ? thanks

my error log

2015/02/20 11:57:59 [error] 2549#0: *3 open() "/var/www/html/html/phpmyadmin" failed (2: No such file or directory), client: 86.47.32.32, server: _, request: "GET /html/phpmyadmin HTTP/1.1", host: "95.85.39.84"
2015/02/20 12:02:15 [error] 2549#0: *4 "/var/www/html/index.php" is not found (2: No such file or directory), client: 86.47.32.32, server: _, request: "GET / HTTP/1.1", host: "qbfweb.com"
2015/02/20 12:03:27 [error] 2549#0: *5 "/var/www/html/index.php" is not found (2: No such file or directory), client: 86.47.32.32, server: _, request: "GET / HTTP/1.1", host: "qbfweb.com"
2015/02/20 12:07:37 [error] 2549#0: *6 "/var/www/html/index.php" is not found (2: No such file or directory), client: 86.47.32.32, server: _, request: "GET / HTTP/1.1", host: "qbfweb.com"
2015/02/20 12:09:33 [error] 2549#0: *7 "/var/www/html/index.php" is not found (2: No such file or directory), client: 86.47.32.32, server: _, request: "GET / HTTP/1.1", host: "qbfweb.com"
2015/02/20 12:10:10 [error] 2739#0: *1 "/var/www/html/index.php" is not found (2: No such file or directory), client: 86.47.32.32, server: _, request: "GET / HTTP/1.1", host: "qbfweb.com"
2015/02/20 12:10:42 [error] 2739#0: *2 "/var/www/html/index.php" is not found (2: No such file or directory), client: 180.76.4.18, server: _, request: "GET / HTTP/1.1", host: "95.85.39.84"
2015/02/20 12:11:10 [error] 2739#0: *1 "/var/www/html/index.php" is not found (2: No such file or directory), client: 86.47.32.32, server: _, request: "GET / HTTP/1.1", host: "qbfweb.com"
2015/02/20 12:18:34 [error] 2819#0: *3 "/var/www/html/index.php" is not found (2: No such file or directory), client: 86.47.32.32, server: _, request: "GET / HTTP/1.1", host: "qbfweb.com"
2015/02/20 12:23:05 [error] 2898#0: *1 "/var/www/html/index.php" is not found (2: No such file or directory), client: 86.47.32.32, server: _, request: "GET / HTTP/1.1", host: "richmondgardens.ie"

here is my configuration block file :

server {
        listen   80;


        root /var/www/richmondgardens.ie;
        index index.php index.html index.htm;

        server_name richmondgardens.ie;

        location / {
                try_files $uri $uri/ /index.php?q=uri$args;
        }

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
              root /usr/share/nginx/www;
        }

        # pass the PHP scripts to FastCGI server listening on the php-fpm socket
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;

        }

}

i dont understand everything was working fine till now. I dont think installation of mail server can broke something.

8 comments
  • The iRedMail installer expects that you are running it on a new clean server and not one you have already configured services on. The webmail and phpmyadmin portions of iRedMail will install and use apache and not nginx by default. The default web root for Apache is /var/www/html on Ubuntu 14.04. I would recommend setting up a separate droplet for your mail services.

    I cannot say for sure but the installer may have simply set up apache and started it. Have you tried stopping the apache service and starting your nginx service to see if this helps?

    service apache2 stop
    service nginx start
    
  • i did and its still the same. can you please help me

  • not working .so how can i uninstall iRedMail

  • This guide will help you to use the iRedMail uninstall tool. It should remove the components iRedMail installed but I cannot say whether it will resolve the issues you are having with your nginx configuration due to the install.

  • please provide a link to the guide

  • can somebody help me ?

  • please somebody help me. digital ocean suggest to install new fresh droplet

  • I faced same problem and found here. But i couldn't find any solution. I checked and changed /etc/nginx/nginx.conf and /etc/conf.d/default.conf because it was changed when installing iRedMail.
    Php socket and server name was changed so it was wrong then i changed it as old one. I tried a few change according to error.log of nginx. Finally solved. Now i could understand why iRedMail should be installed on new droplet :)

1 Answer

This question was answered by @ryanpq:

The iRedMail installer expects that you are running it on a new clean server and not one you have already configured services on. The webmail and phpmyadmin portions of iRedMail will install and use apache and not nginx by default. The default web root for Apache is /var/www/html on Ubuntu 14.04. I would recommend setting up a separate droplet for your mail services.

I cannot say for sure but the installer may have simply set up apache and started it. Have you tried stopping the apache service and starting your nginx service to see if this helps?

service apache2 stop
service nginx start

View the original comment

Have another answer? Share your knowledge.