Question

LEMP on CentOS 6 returns 404 errors

  • Posted on February 28, 2014
  • paspaAsked by paspa

I have created a CentOS 6.5 x64 droplet with LEMP installed as described here: https://www.digitalocean.com/community/articles/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-6

It is working fine, http://vps.eletter.gr/info.php. I have ported a sample CodeIgniter application (https://github.com/scoumbourdis/grocery-crud/archive/v1.4.1.zip) under http://vps.eletter.gr/gc141/ but when I try to click to any of the links it returns 404 error.

I also tried to install FUEL CMS http://vps.eletter.gr/fuel/install but again it comes up with a 404 error where when on http://vps.eletter.gr/fuel works fine.

Obviously it has to do with the nginx conf file but I have tried many options without luck!

The /etc/nginx/conf.d/default.conf file is:

server { listen 80; server_name vps.eletter.gr;

location / {
    root   /usr/share/nginx/html;
    index index.php  index.html index.htm;
}

error_page  404              /404.html;
location = /404.html {
    root   /usr/share/nginx/html;
}

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

# pass the PHP scripts to FastCGI server 
#
location ~ \.php$ {
    root           /usr/share/nginx/html;
    fastcgi_pass    unix:/tmp/php5-fpm.sock;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

}


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

It’s gone! <br>I am installing LAMP along with varnish.

<blockquote>Kamal your suggestion returns a “No file is specified.” </blockquote>Good, that means we’re getting there :] <br> <br>If you haven’t wiped your droplet yet, can you pastebin the output of <pre>tail -30 /var/log/nginx/error.log</pre>

Correction: I couldn’t…