I am trying to implement a second domain within an existing digitalocean droplet.
Because I'm on DO, I followed the answer by ryanpq on this thread: https://www.digitalocean.com/community/questions/is-it-possible-to-install-another-wordpress-on-droplet
Similar to the commenters on that thread, my newer site redirects to my existing site (even after changing the DocumentRoot and Directory appropriately).
Here are my configs:
Within /etc/apache2/sites-enabled
, I have 4 files: 000-default-le-ssl.conf 000-default.conf example1.conf example2.conf
000-default.conf
and example1.conf
are copies.
example1.conf
looks like so:
# Added to mitigate CVE-2017-8295 vulnerability
UseCanonicalName On
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example1.io
ServerAlias www.example1.io
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.example1.io [OR]
RewriteCond %{SERVER_NAME} =example1.io
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
example2.conf
looks like so:
<VirtualHost *:80>
ServerAdmin webmaster@example2.com
ServerName example2.com
ServerAlias www.example2.com
DocumentRoot /var/www/example2
<Directory /var/www/example2/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
my directory structure looks like /var/www/html
and /var/www/example2
Within the DNS control panel, I created new A and CNAME records. The A record points to the IP address of the older, existing, site (so, example2.com directs to 128....)
Going to example2.com redirects me to example1.io.
What am I missing?