Abdo
By:
Abdo

How to create two sites on the same digitalocean wordpress image droplet?

March 25, 2017 207 views
WordPress Ubuntu 16.04

I created a wordpress droplet, and I have wordpress installed on my website.
It is working perfectly.
in www/html/ folder.
I followed a tutorial in here.
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04#step-five-—-enable-the-new-virtual-host-files

I created a folder in www.
I did all the other things.
When I reached to enabling and disabling the default folder.
1: disabling default folder in the sites enabled. the default site still working.
2: enabling my new site. i cannot enable it.
3: i disabled the default, I cannot run the new one.

WHAT i need please help:
I have to domains name.
for example 1.com and 2.com
the 1.com is connected with the wordpress website. it works fine.

I added new file in the sites available and I added everything like the tutorial above. by when I want to enable it I get this error.

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -s

How i can connect my new website 2.com to a folder in var/www/html/public_html to my new domain.

information
1: i added site 1.com and 2.com to the same droplet both of them directing to 1.com.
2: hosts file i found my original domain there 1.com.
3: If I enabled the new site I cannot save. and if I disabled the default my site still working.
Please help.
.

1 comment
  • Can you share your current Apache configuration? Specifically the files in /etc/apache2/sites-enabled. From your description there are a couple possible things that could be the source of the problem but seeing these would allow us to directly identify the problem and help you to resolve it.

3 Answers

Thank you brother I really solve it.
But I have issue I did not find any solution to it.
My websites are working.
mysite1. to www/my1.com/pu...
mysite2 the same.
...............................................................................
I have issues. In xampp my website working perfectly.
moving it to my droplet. I got 500 errors and 404 errors.
..................................................................................
I allowed index.php in some tutorials.
I do not got error 500 always now.
but I am getting 404 errors.
Some people said it is from file permission.
I made all my website 777. just to open it. but I could not view my website.
I just view the home page but other folder I could not.
.....................................................................................
Notes:
M wordpress site and php site.
1: If I want to verify my website by google by putting html tag I cannot google cannot enter my website.
2: most of my folders are 777 but it is not working.
Please help.
I really need it now. I do not no what to do.

these are my sites enabled.

1:

<VirtualHost *:80>
    ServerAdmin realemail@realone.com
    ServerName my1.com
    ServerAlias www.my1.com
    DocumentRoot  /var/www/my1.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

2:


<VirtualHost *:80>
    ServerAdmin realemail@realemail.com
    ServerName my2.com
    ServerAlias www.my2.com
    DocumentRoot  /var/www/my2.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

The problem I cannot explain it.
1:I can discribe it.
cannot read php. ?
or Others like website who needs verification cannot enter my website.
I mean entering my website from their site.
2: I cannot install plugins and themes in wordpress.
But I can install them manually.
Help brother.

Have another answer? Share your knowledge.