Set up nginx in server pilot

April 12, 2018 80 views
Apache Nginx Ubuntu 16.04

Does any one know how to run Wordpress site using only Nginx wihtout apache in server pilot? I tried following the tutorial given in https://serverpilot.io/community/articles/how-to-create-a-lemp-stack-only-nginx-no-apache.html and everything seems to be fine but I cant access my site.

Thank you.

2 Answers

Can you clarify what happens when you attempt to access your site?

One thing to note is that WordPress makes heavy use of rewrites in order to support easy to read URLs. On Apache this is done via .htaccess files and you only need to ensure that Apache is set to use them. On Nginx you need to manually configure your rewrite definitions in your configuration file.

We also offer a LEMP one-click image which comes with the stack all installed and ready to go. To use it with WordPress (for a new site) you would only need to:

  1. use the mysql command with the MySQL root password shown the in message when you log in to create a new database create database mywpsite

  2. Download WordPress and place the files in /var/www/html (make sure to remove the index.html file that is there)

  3. Using the Nginx link above set up your rewrites

  4. Restart nginx so the changes that effect sudo service nginx restart

  5. Navigate to your site in a browser and complete the setup.

Have another answer? Share your knowledge.