AWS Marketplace
2. Accessing the Instance
2.2. Apache Tomcat 8
To host the 4insights web services Apache Tomcat is used in version 8, all the settings are Tomcat installation defaults, you can access the Tomcat application manager by using this address in your browser:
http://<public-dns>:8080/manager
You will be required to inform a user and password, the user name (nome do usuário) is "admin" and the password (senha) is "admin".
After entering the user and password click on Login (Entrar), the tomcat management page will be displayed.
Note: 4insights services will be the top 3 in the application listing.
Changing the Default Tomcat User
1. You can change the tomcat user and password by changing the tomcat-users.xml file, which is inside the /usr/share/tomcat8/conf directory, to change the file use the following command:
$ sudo vi /usr/share/tomcat8/conf/tomcat-users.xml
2. Identify the <user> element and change the "name" and "password" properties.
3. Save and exit the file using the command:
$ :wq!
4. For the changes to take effect it is required to restart the tomcat service, to restart the service please use the following command:
$ sudo service tomcat8 restart
5. Wait for the service to start and the user will be changed.
Changing the Default Tomcat Port
1. By default the port used by Tomcat is 8080, to change this port you must change the server.xml file, which is inside the /usr/share/tomcat8/conf directory, to change the file, please use the following command:
$ sudo vi /usr/share/tomcat8/conf/server.xml
2. Identify the <Connector> element and change the "port" property and add the new port.
3. Save and exit the file using the following command:
$ :wq!
4. For the changes to take effect it is required to restart the tomcat service, to restart the service please use the following command:
$ sudo service tomcat8 restart
5. Wait until the service starts and the port will be changed.
Note: You can also add a new port, by adding another <Connector> element instead of changing the existing one, so the server will respond to all configured ports.
6. In the creation of the instance a Security Group has been associated with the purpose of controlling which ones are the inbound and the outbound ports, in order for its new port to be available it is required to add the new port in this group on its AWS console, get in the EC2 service and identify the instance.
7. When selecting the instance, your information will be displayed in an area below, in the "Description" tab, identify the "Security Groups" field.
8. Click the Security Group link and you will be redirected to the information for this group.
9. With Security Group selected click the "Inbound" tab and then the "Edit" button.
10. If you have added a new port in the server.xml file, click "Add Rule" and type in the "Port Range" field with the number in the new port and in the "Source" field, select "Anywhere".
11. Click Save and try to access tomcat by using the new port.