I'm a designer and want to serve some static sites with Jekyll.

So I grabbed a VPS (ubuntu 12.04) and installed nginx, ruby and jekyll.

I work from a few different computers throughout the day, so I wanted to use GitHub for ease of its client. Hence I installed git, php5fpm(fastcgi) and set up two basic scripts, one for handling the webhook (webhook.php) and one for compiling and deploying the site (build.sh)

With some help, I was able to progress to the point that I can run the build script, but the build script stops when running the Jekyll command and throws an error saying:

bash: command not found

That is not the case when running my regular user, so I'm thinking this has something to do with the .bash_profile of the user running the nginx workers (which is www-data).

So to summarize, my question is: How can I make the Jekyll command available to the www-data user?


Don't try to make Jekyll available to www-data user. A cleaner and better approach will be this:

  1. Create a new user, dedicated to running your Jekyll site
    • Make Jekyll available to this user, test that it has everything it needs
  2. Create a virtual host, dedicated to running your Jekyll site
    • Make it to run as the new dedicated user
    • Make its document root owned by the new dedicated user

This setup should be easier to test, debug and replicate, and more secure too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.