How we can deploy 2 domains with 2 Cpanel on single CentOS server?

techinfozone

New Member
Credits
46
I have a client who want to deploy 2 domain on a centOS server i search for the solution but not a good answer.
He want to run JDK on both domain with SSL.
I want to know if I install JDK (by the way java version is 8) and SSL on server, how I can install JDK on same server with different port?
He need 2 JDK one test purpose and 1 for live site.
Please help a little..
 


CptCharis

Well-Known Member
Credits
550
Apache offer virtual hosts.
You have to made two new folders under
/etc/http/
1. Sites available
2. Sites enabled
Then you will add a file for each domain in sites available for example
domain1.com.conf
And you will enter the below code
Code:
# Ensure that Apache listens on port 80
Listen 80
<VirtualHost *:80>
    DocumentRoot "/www/example1"
    ServerName www.example.com

    # Other directives here
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/www/example2"
    ServerName www.example.org

    # Other directives here
</VirtualHost>
of course you have to rectifieas per your domain names.
Then you will make two soft links in site enable folder.

finally restart your Apache.
Everything goes well you should be able to reach both sites on the same server.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top