Monday, March 9, 2020

How to change tomcat port number

Tomcat will be by default configured to run on port 8080, sometimes our system/machine may already using port 8080. so that time we need to change the port.

Following simple steps help to change the tomcat port. but before changing make sure a new port is in used.

check used ports from machine/system: netstat –aon ( run this from command prompt) then choose which is not used from range.
For example, if 9090 is not in use.

Updation steps:
  •       Go to tomcat_home>conf folder
  •       Edit server.xml
  •       Search for "Connector port"

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
 redirectPort="8443" />
  •       Replace "8080" by your port number ex: 9090
               <Connector port="9090" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

  •       Restart tomcat server

Happy learningJ

Tuesday, March 3, 2020

Accessing a CentOS 7 server running on Virtual Box from outside

Recently while I am pursuing DevOps, I did CentOS 7 to practice Jenkins.
After the installation of  Tomcat, I wanted to access tomcat or other applications from outside of VM(my local machine).

These are the commands I executed in CentOS to access servers from outside of the VM.

1.      In the VM network settings, using 'Bridged Adapter'.
2.      Turn on the port of CenOS7: using the following command in terminal(for example port 8080): 
$ firewall-cmd --permanent --add-port=8080/tcp
$ firewall-cmd --reload

This solved my issue and I am able to access the servers/application URLs from outside of the CentOS


Happy learning ☺