Can i install a new WordPress in this way?

December 15, 2013 1.2k views
I have a running WordPress site,Followed this tutorial to install it https://www.digitalocean.com/community/articles/how-to-install-wordpress-with-nginx-on-ubuntu-12-04 Now i wish to install a New WordPress site in the same Droplet(Don't wish to use Multisite). Is it possible to install a new WordPress site by following the above tutorial in same way(Changing the directory address) and all other things as needed? My Concern is actually about IP address,I can visit my site currently using the IP address, as in the NGINX config i am using IP address instead of domain. In the above Tutorial of NGINX,I don't think there is anything to change in the NGINX config files. In the step 6 we are copying the default and making changes in the copied file. So,I just wanted to know,Just changing the IP address in the previous installation and pointing the previous and new installation to the domains will work?
1 Answer

  1. rm /etc/nginx/sites-enabled/wordpress

  2. mv /etc/nginx/sites-available/{wordpress,currentdomain.com}

  3. Edit /etc/nginx/sites-available/currentdomain.com, set server_name to currentdomain.com, and set root to /var/www/currentdomain.com

  4. Copy it and modify it accordingly (e.g. seconddomain.com instead of currentdomain.com)

  5. Link both to the sites-enabled directory:
    ln -s /etc/nginx/sites-available/currentdomain.com /etc/nginx/sites-enabled/currentdomain.com
    
    ln -s /etc/nginx/sites-available/seconddomain.com /etc/nginx/sites-enabled/seconddomain.com

  6. Follow step 3 of https://www.digitalocean.com/community/articles/how-to-install-wordpress-with-nginx-on-ubuntu-12-04 replacing wordpress and wordpressuser with the second domain's name e.g. seconddomain.
  7. Move the current site to its own directory:
    mkdir /var/www/currentdomain.com
    
    mv /var/www/* /var/www/currentdomain.com
    mv /var/www/.* /var/www/currentdomain.com

  8. Download wordpress for the second site:
    mkdir /var/www/seconddomain.com
    
    cd /var/www/seconddomain.com
    wget http://wordpress.org/latest.tar.gz
    tar xf latest.tar.gz
    mv wordpress/* .
    mv wordpress/.* .
    rm -r wordpress

  9. Finally, restart nginx:
    service nginx restart



Replace all occurrences of currentdomain.com with the website that you're hosting currently on your droplet.

Let me know if that works :]
by Etel Sverdlov
Wordpress is a free and open source website and blogging tool that uses php and MySQL. It was created in 2003 and has since then expanded to manage 22% of all the new websites created and has over 20,000 plugins to customize its functionality. This tutorial shows how to install Wordpress on a server with LEMP (with nginx instead of apache). It is written for Ubuntu 12.04.
Have another answer? Share your knowledge.