If you want to create a subdomain for your website that is hosted on aws ec2 instance under tomcat 8 server.
Step 1) First you have to create a "create record set" as i mentioned in below image suppoe i want to create a sub-domain under my website www.web-host-master.com like this products.web-host-master.com then you can enter your subdomain name in field of name.
and then you have to select Type of record that is A -IPv4 Address.
then you have to enter your ec2 instance public /elastic ip address in value field.
after enter click on save record set.
Now logged into to your server by ssh like putty. access your server and go to tomcat8 installation directory
in this you have to go conf/server.xml file and you have to edit this file by opening follwoing command.
sudo vi server.xml file
and you have to add these 2 lines under
<Engine name="Catalina" defaultHost="localhost">
<host appbase="products" autodeploy="true" name="product.web-host-master.com" unpackwars="true"></host>
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
after adding this bold line code in your server.xml file take server restart by following command
sudo service tomcat8 start/restar/stop
then you have to create a new folder under tomcat8 and copy your webapps folder under that you can put your ROOT or proejct.war file and rename this project folder as ROOT folder now you are able to access your domain name easly.
Step 1) First you have to create a "create record set" as i mentioned in below image suppoe i want to create a sub-domain under my website www.web-host-master.com like this products.web-host-master.com then you can enter your subdomain name in field of name.
and then you have to select Type of record that is A -IPv4 Address.
How to create subdomain in aws route 53. |
then you have to enter your ec2 instance public /elastic ip address in value field.
after enter click on save record set.
Now logged into to your server by ssh like putty. access your server and go to tomcat8 installation directory
in this you have to go conf/server.xml file and you have to edit this file by opening follwoing command.
sudo vi server.xml file
and you have to add these 2 lines under
<Engine name="Catalina" defaultHost="localhost">
<host appbase="products" autodeploy="true" name="product.web-host-master.com" unpackwars="true"></host>
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
after adding this bold line code in your server.xml file take server restart by following command
sudo service tomcat8 start/restar/stop
then you have to create a new folder under tomcat8 and copy your webapps folder under that you can put your ROOT or proejct.war file and rename this project folder as ROOT folder now you are able to access your domain name easly.
Comments
Post a Comment