By silverace
So 2 days ago I created a droplet with the automated wordpress builder digitalocean has. Looking at the future I might want to host multiple wordpress site on 1 droplet, and I’m trying to figure out how to go about this.
First, can I safely create a domain.com folder in var/www/ and move all the files there without breaking anything? Or are the databases configured in a way that make this impossible?
And second, after succeeding in step 1, with what putty commands would I redirect the domain to it’s new path at var/www/domain.com?
Thanks in advance!
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!
This comment has been deleted
First, can I safely create a domain.com folder in var/www/ and move all the files there without breaking anything?
You can do that, but you will need to modify the site.conf file which is located in /etc/apache2/sites-available. It might be named 000-default.conf
On that file, there will be a section for DocumentRoot:
DocumentRoot /var/www/html
and possibly for the directory
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
so change those sections from /var/www/html to whatever the new directory is you created. Restart and you should be good to go.
The database does not know, as Wordpress is looking for the database at localhost, regardless of what folder the website is installed in.
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.