in Debian, Linux, Wordpress

How to install and configure WordPress hosted on Nginx with PHP-FPM on Debian based distros

Nginx is an open source web server. Users have been moving to Nginx because of the high performance and stability and as of February 2014, Nginx is hosting around 15% of all web servers according to Netcraft’s Web Server Survey. Nginx is a great option for hosting WordPress sites.

It’s assumed that you have already installed Nginx with PHP-FPM. If you haven’t already done that, you can use this tutorial: How to install Nginx with PHP and MySql support on wheezy

1. Create the database for WordPress

mysql -u root -p
CREATE DATABASE {database};
CREATE USER {username}@localhost;
GRANT ALL PRIVILEGES ON {username}.* TO {database}@localhost IDENTIFIED BY '{password}';
FLUSH PRIVILEGES;
exit

Replace {database}, {username} and {password} with the database name and credentials you want to use. You will use this in the WordPress installer.

2. Download the latest version of WordPress

cd /usr/share/nginx/www
wget http://wordpress.org/latest.tar.gz

In this tutorial, I’m using /usr/share/nginx/www/wordpress but you probably want to change that into something else.

3. Extract WordPress

cd wordpress
tar zxvf latest.tar.gz

4. Make wp-content writable and the root directory temporarily writable to allow WordPress to create the config file

chmod o+w ./
chmod 777 wp-content -R

5. Change the directory owner and group to www-data

chown www-data.www-data ./ -R

6. Create a Nginx virtual host (pico /etc/nginx/sites-available/wordpress)

The contents should be similar to the text below, you may need to adjust the root and host name

server {
        listen 80;
 
        root /usr/share/nginx/www/wordpress;
        index index.php;
 
        server_name {domain};
 
        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }
 
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }
}

Change {domain} to the domain or host that you want to use for the new WordPress site

7. Enable the new virtual host

ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/wordpress

8. Restart Nginx

/etc/init.d/nginx restart

9. Run the WordPress installer by opening this location in a web browser. You will have to provide the database credentials and some more information for the setup.

http://{domain}

Change {domain} to the server name used in the Nginx virtual host file

10. When the installer has completed, change the permissions of the root directory

chmod o-w ./

Write a Comment

Comment

Webmentions

  • best memphis dentist May 21, 2014

    … [Trackback]

    […] Information on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • youtube.com/watch?v=1uz6PrxIF5c May 21, 2014

    … [Trackback]

    […] Find More to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • Wren May 21, 2014

    … [Trackback]

    […] Here you will find 66303 additional Information on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • http://www.warnetqq1.site/ May 21, 2014

    … [Trackback]

    […] There you will find 76879 additional Information to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • utah May 21, 2014

    … [Trackback]

    […] There you can find 51116 additional Information on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • gomovies-online.me May 21, 2014

    … [Trackback]

    […] Find More to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • https://new-solarmovie.com/ May 21, 2014

    … [Trackback]

    […] Info on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • best-123movies.com May 21, 2014

    … [Trackback]

    […] Information to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • wire qwest May 21, 2014

    … [Trackback]

    […] Read More on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • elangqq login May 21, 2014

    … [Trackback]

    […] Here you can find 43191 additional Info on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • wedeqq May 21, 2014

    … [Trackback]

    […] Find More Information here on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • kompas qq May 21, 2014

    … [Trackback]

    […] There you will find 79631 additional Info to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • http://199.188.200.53 May 21, 2014

    … [Trackback]

    […] Find More on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • Moon May 21, 2014

    … [Trackback]

    […] Info to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • printed cornhole boards May 21, 2014

    … [Trackback]

    […] Here you can find 36823 more Information to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • Half Marathon 2012 Results May 21, 2014

    … [Trackback]

    […] There you will find 14604 more Info on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • video review May 21, 2014

    … [Trackback]

    […] Information to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • Digital Marketing Tips May 21, 2014

    … [Trackback]

    […] Find More on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • Royal Online May 21, 2014

    … [Trackback]

    […] Find More Info here on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • luxmobleh.com/ May 21, 2014

    … [Trackback]

    […] There you will find 54073 more Info to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • https://electricmotors.wpengine.com May 21, 2014

    … [Trackback]

    […] Here you will find 26168 additional Information to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • Buy CBD Products May 21, 2014

    … [Trackback]

    […] Info on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • how to use clickfunnels for affiliate marketing without a clickfunnels paid account May 21, 2014

    … [Trackback]

    […] Read More Information here to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • www.rajaqq77.com May 21, 2014

    … [Trackback]

    […] Read More Info here on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • situs judi online May 21, 2014

    … [Trackback]

    […] Info on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • www.vipbandarq1.site May 21, 2014

    … [Trackback]

    […] Find More Information here on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • wayangpoker1.club May 21, 2014

    … [Trackback]

    […] Find More on to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • vape carts for sale May 21, 2014

    … [Trackback]

    […] Read More Info here on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • Elizabeth May 21, 2014

    … [Trackback]

    […] Find More Info here to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • Klik Dokter May 21, 2014

    … [Trackback]

    […] Information on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • news May 21, 2014

    … [Trackback]

    […] Info to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • Best Accident lawyers in Raleigh NC May 21, 2014

    … [Trackback]

    […] Read More on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • fowling las vegas May 21, 2014

    … [Trackback]

    […] Info to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • pasar poker May 21, 2014

    … [Trackback]

    […] Information on that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • mejaqq May 21, 2014

    … [Trackback]

    […] Find More on to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • qiuqiu99 May 21, 2014

    … [Trackback]

    […] Find More Info here to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • www.cialisis.org May 21, 2014

    … [Trackback]

    […] Information to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • sahabatqq May 21, 2014

    … [Trackback]

    […] Info to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]

  • quesos saludables May 21, 2014

    … [Trackback]

    […] Read More on to that Topic: aip.im/2014/03/how-to-install-and-configure-wordpress-hosted-on-nginx-with-php-fpm-on-debian-based-distros/ […]