jlee2081
By:
jlee2081

Installing two wordpress instances on one droplet - problem with second site redirecting to first

July 31, 2017 188 views
WordPress Ubuntu 16.04

Hi - I'm trying to install two instances of wordpress on one one-click droplet Unbuntu Wordpress 4.8 on 16.04.

I've followed the following tutorials and setup a virtual host for my 2nd wordpress site
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-12-04
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-12-04
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts
https://www.digitalocean.com/community/questions/is-it-possible-to-install-another-wordpress-on-droplet

I've now redirected my domains to DO's nameservers, created the virtual host, created a new DB, copied over wordpress into my new 2nd wp web root directory, pointed WP to the new DB, updated the .conf, set permissions and restarted apache.

Now when I goto the 2nd WP domain address, it gets redirected to the 1st WP instance and shows my droplet's IP Address.

I've gone through each of these tutorials several times and have destroyed and rebuilt the droplet 4 times without any luck. I'm stuck and hope someone can point me in the right direction.

Below are my .conf file settings

wordpress 1 (resolves to IP address http://138.197.80.189/)

/etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@leagueoto.com
ServerName leagueoto.com
ServerAlias www.leagueoto.com
DocumentRoot /var/www/html

<Directory /var/www/html/>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

wordpress2 (also resolves to IP address http://138.197.80.189/)
/etc/apache2/sites-enabled/d1p.co
ServerAdmin webmaster@d1p.co
ServerName d1p.co
ServerAlias www.d1p.co
DocumentRoot /var/www/html

<Directory /var/www/html/> 
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

1 Answer

Both domains point to the same root directory. If you want to run two instances of WP you would need each domain to point to different directories.

  • Thanks @iteagle03 I've updated the DocumentRoot and Directory values and restarted. I've also confirmed that this directory contains all of the WP files. I'm still having the same issue. Any other thoughts?

    DocumentRoot /var/www/d1p
    <Directory /var/www/d1p/>

Have another answer? Share your knowledge.