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


New Member
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..


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

    # Other directives here

<VirtualHost *:80>
    DocumentRoot "/www/example2"

    # Other directives here
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

Latest posts