By theindiman
On an existing wordpress-installed droplet, I am installing a new wordpress instance (two wordpress installs in same droplet).
To do so, 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 control panel of my DO account, I created a new project for my newly acquired domain name.
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…)
Additional: I noticed while following the user ryanpq’s answer, that the wordpress install I did only had a wp-config-sample.php, so I copied that file, named it wp-config.php and filled it in with the database info.
What am I missing?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @theindiman,
The configuration looks all correct. It is possible that the permissions of the /var/www/example2 are not correct. What you need to do is make sure that the Apache user has read and write permissions to that folder:
- sudo chown www-data:www-data /var/www/example2
Also I could suggest checking your Apache error log for more information:
- sudo tail -100 /var/log/apache2/error.log
And one more thing, is the example2com site a copy of the original site or a fresh new WordPress installation?
Regards, Bobby
If you’re running into an issue with your second website redirecting to your first website, just re-setup Let’s Encrypt with the following:
sudo certbot --apache Once you install SSL for each domain then it will no long redirect.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.