• Layer Domain


 #1930  by gasak
 29 Aug 2018 16:31
Hi,

I have some question that could be a suggestion if not available. Is there any way we can do layer domain in vpssim like we do in serverpilot or runcloud? So with only 1 database of wordpress site we can connect many domains into it. If you aware about serverpilot/runcloud you would understand what I mean. Please advice.

Thank you.
Get 25 USD Free To USE VPSSIM
 #1931  by nguyenoanh
 29 Aug 2018 18:48
Hello !
Sorry because i do not use serverpilot & runcloud so i do not know about your question.
You means, use 1 database for many wordpress websites ?
Yes, you can setup many wp websites using 1 database as you want if you use the different prefix for every domains.
 #1934  by nguyenoanh
 30 Aug 2018 08:18
i have read your email.
You means add parked domain with exited domain on VPS.
Yes, you can do it very easy in VPSSIM and in any other VPS using nginx too.

to add domainA.com, domainB.com, domainC.com using the same database and root folder (same code) with domainZ.com, you must edit the vhost of domainZ.com

Using nano or any text editor to edit /etc/nginx/conf.d/domainZ.com.conf

find:
Code: Select all
........
server_name domainZ.com;

.........
change it to:
Code: Select all
........
server_name domainZ.com domainA.com domainB.com domainC.com;

.........
Then save it, check nginx service
Code: Select all
nginx -t
if it show:
Code: Select all
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
you can restart nginx to save your config
Code: Select all
service nginx restart 
Because you are using wordpress code, you must edit the wp-config.php using many others domain with the same database and code

Add the code below to the top of wp-config.php, next to <?php
Code: Select all
 <?php
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME',    'http://' . $_SERVER['HTTP_HOST']);
save you wp-config.php then restart PHP
Code: Select all
service php-fpm restart
Now, you can have what you want :)
 #1935  by gasak
 30 Aug 2018 08:33
So we don't need to add domainABC.com to vpssim using vpssim menu 1) Add Website & Code?
 #1936  by nguyenoanh
 30 Aug 2018 08:37
gasak wrote:
30 Aug 2018 08:33
So we don't need to add domainABC.com to vpssim using vpssim menu 1) Add Website & Code?
Yes. You do not need add them to VPS.
We have added it by edit the vhost of domainA.com

You can try to add it but VPSSIM will not allow to do that and will exit when you do it because domainABC.com exited in VPS :mrgreen:
 #1940  by gasak
 30 Aug 2018 09:23
How about the SSL implementation? When try to setup freessl from vpssim menu 23 it only detect the main domainZ.com. How to add ssl as well to domainABC.com?
 #1941  by nguyenoanh
 30 Aug 2018 09:25
gasak wrote:
30 Aug 2018 09:23
How about the SSL implementation? When try to setup freessl from vpssim menu 23 it only detect the main domainZ.com. How to add ssl as well to domainABC.com?
If you want to use ssl for all domains, you do not use as this post.
You should read this: viewtopic.php?f=7&p=1939#p1939
 #1943  by gasak
 30 Aug 2018 10:31
This is awesome!! Work like a charm!! Thank you so much @nguyenoanh .. VPSSIM is the best!
nguyenoanh liked this
 #1945  by gasak
 30 Aug 2018 10:51
nguyenoanh wrote:
30 Aug 2018 10:35
You're wellcome.
I will try to make an update for VPSSIM about this.
everything auto maybe better :)
This is really cool. Can't wait for the update :D
Thank you so much @nguyenoanh
nguyenoanh liked this
Get 25 USD Free To USE VPSSIM