Any success installing Craft CMS on LEMP (Ubuntu/Nginx)?

September 22, 2014 3.8k views

Been struggling with getting Craft CMS installed on my droplet. Not sure where I'm failing, but for starters craft isnt even able to find the $craftPath so I'm able to get as far as starting at "Could not find your craft/ folder. Please ensure that $craftPath is set correctly".

Searching all over the internet has yielded nothing so I'm reaching out here in hopes that someone here has run into a similar situation and found a solution.

I'd be eternally grateful if you can share your success.

1 comment
2 Answers

@hokkei I was able to get it working – my issue was 2 parts, the first being permission issues and the 2nd an incorrect nginx virtual host configuration.

To fix the permissions, I ran
sudo chown -R www-data:www-data /var/www/ and then followed the guide below to create a new group to add users to (if you followed the Digital Ocean guide you're probably using a user other than the default root)
https://www.digitalocean.com/community/questions/www-data-as-chown-but-still-remain-write-access-as-other-user-s

Next step was to fix up my config file based off of Brad Bell's recommendation found here:
https://craftcms.stackexchange.com/questions/961/what-is-the-recommended-nginx-configuration-for-craft

the only line you need to change to get it to work on Digital Ocean was the fastcgi_pass value, which I changed to fastcgi_pass unix:/var/run/php5-fpm.sock;

Hope that helps!

  • Thanks for answering. It seems my problems were Apache-related but useful info nonetheless.

Old question but for anybody else who comes across this..

It was a permissions error for me.

root:root owned the craft/ directory. Changing it to the following (insert your user and group that can run Apache):

sudo chown -R user:group craft/
Have another answer? Share your knowledge.