Question

How to create a subdomain of one click Wordpress in same droplet??

Posted November 5, 2018 1.6k views
UbuntuWordPressDigitalOceanOne-Click Install Apps

Its almost been an month I’m researching on how to create a subdomain of one click wordpress install in same droplet, but there are no proper tutorials or guide for it. Some help would be appreciated!!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hey friend!

While I can’t give you a step by step on this, I can help you widen your search. If you’re searching for how to do this on our one-click image, you’re limiting the results too far. Basically, this is the question you’re asking:

“How do I host two Wordpress sites on one LAMP stack?”

What it comes down to are these key points:

  1. You need two separate virtual hosts in Apache.
  2. You need two copies of Wordpress (and two MySQL databases, one for each).

Since you’ll be adding a second virtual host, you need the answer to this question:
“How do I set the ServerName and ServerAlias values in my existing virtual host?”

Because, you see, when you only have one site then you don’t need Apache to know which site to serve when called by a certain URL. Now that you’ll have two sites, you need to edit the virtual host config (should be in /etc/apache2/sites-enabled) and define the ServerName and ServerAlias variables. Perhaps to something like this:

ServerName myfirstdomain.com
ServerAlias www.myfirstdomain.com

After that, it becomes only about answering these questions:
“How do I install Wordpress?”
“How do I create an Apache virtual host?”

If this sounds workable, you can find many tutorials on the subject of those. If it has you scared to death because you don’t want to dive that deeply into Linux and Apache (this is okay, and many people feel this way), then you might consider just using a second droplet instead.

Jarland

Submit an Answer