Please refer to my previous post on how to setup nginx + php5 + mysql on Ubuntu Lucid 10.04 LTS. This tutorial is based on the setup of that tutorial.
First, you need to grab WordPress
$ cd ~/Sites $ wget http://wordpress.org/latest.zip $ unzip latest.zip
WordPress package will be extracted to $HOME/Sites/wordpress. Next create a virtual host rule for WordPress:
$ sudo nano /etc/nginx/sites-available/wordpress
Paste following rules into the file:
server{ listen 80; #or change this to your public IP address eg 1.1.1.1:80 server_name wordpress; #change this to the domain name, for example www.myblog.com access_log /var/log/wordpress.access_log; error_log /var/log/wordpress.error_log; location / { root /home/your-user-name/Sites/wordpress; index index.php index.html index.htm; # this serves static files that exist without running other rewrite tests if (-f $request_filename) { expires 30d; break; } # this sends all non-existing file or directory requests to index.php if (!-e $request_filename) { rewrite ^(.+)$ /index.php?q=$1 last; } } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/your-user-name/Sites/wordpress$fastcgi_script_name; include fastcgi_params; } }
Make sure you replace ‘your-user-name’ with your home folder user. Now we need to enable this vhost
sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/wordpress
sudo nano /etc/hosts
Append the ‘wordpress’ into 127.0.0.1 line
127.0.0.1 localhost phpmyadmin wordpress
Now restart the nginx server
sudo service nginx start
Then after you configure your WordPress wp-config.php, WordPress is ready for raw-serve. Fire up your Firefox and type in http://wordpress. Enjoy!
how to configure wp-config.php ? I still confused …
Please refer to http://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install
Do you know how to get the wordpress 3.0 rc autoupdate to work. I’ve tried some of the way I found on the internet but nothing has worked.
content of folder with wordpress should owned by web server user.
Thank you!!!
Just found a little correction that might help others:
sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/wordpress
cheers!!!
Hi,
I think your tutorial is outdated. PHP-fastcgi can be replaced with PHP-FPM which has this built in. PHP-FPM is also built in PHP 5.3. I’ve written a tutorial on it too:
http://tutspundit.com/howto-install-nginx-php-fpm-mysql-php533-wordpress-ubuntu-part-1/
Regards,
Pranav
Hi,
I Tried with multiple virtual servers with nginx and found that all the http://www.wordpress.com were replaced by ip.. and thus not working (as I have multiple virtual servers). I can no longer login, although i can see the blog.
My site is http://www.frenchoverture.me
I’m with previous commenter. On my install, I get to WP config/install page, I enter details, enter. I get no error page but return to the very same installation page. No fun at all.
I followed the instructions, but it seems that I’m only getting to phpmyadmin… any ideas?
How to working with nginx cache?
Anybody knows how to handle nginx work with joomla?
For Joomla,
http://wiki.nginx.org/Joomla
Then in the Joomla administration, turn on mod_rewrite rules. Nevermind what it says about Apache and .htaccess
In case anyone else has the problem of getting this error message: “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”, i did a reboot and it was fine after that.
Thx for this!
My site is running nginx now too
This is a pathetic configuration, which will work slower than Apache. The “IF” conditions are idiotic.
I’d recommend you to read the Wiki a little more closely, and there are many resources now (google for them) that show how, in much fewer lines, the WP rules can be set. No need for any rewrite at all.
Pingback: ¿Cómo configurar wordpress en ubuntu con nginx? « Tomas Zulberti
Pingback: Howto: Debian Squeeze+Nginx+WordPress
Pingback: Installation et Configuration de Nginx avec php-fpm | Notes !
Pingback: Setup nginx + wordpress + ubuntu shortest in Ubuntu | TurboLinux Blog
Pingback: Setup nginx + wordpress + ubuntu | Nginx Lighttpd Tutorial
Pingback: Wordpress + Nginx | fabian.lenczewski
Pingback: What issues would you face if you use Nginx | CL-UAT
Pingback: Configuring Routing Rules for WordPress Nginx and WP-SuperCache? | CL-UAT
Pingback: » wordpress:What issues would you face if you use Nginx