Carl
Carl

Reputation: 86

Changing the default ports on WSO2 API manager

Hi there I hope you can help.

We are currently investigating the use of WSO2 API Manager and we have spun up the AMI image on a EC2 instance. The product works fine for carbon and store on the default port on 9443, however our security guys would rather us try and move it on to more standard ports that they have already have configured.

I have found a previous article WSO2 Api Manager - Deploy in EC2 and change default ports and followed the instructions but it fails.

I have tried modifying the API MANAGER HOME/am160/wso2am-1.6.0/repository/conf/tomcat/catalina-server.xml and changed the port from 9443 to either 8443 or 443 (this would be perfect if it is possible).

If I set the port to 8443, restart the instance and issue a netstat -a I do see the port 8443 listening but I am unable to connect. If I set the port to 443 then I see nothing listening.

If I set the port back to 9443 it still fails. I have to replace the catalina-server.xml with a copy of the untouched version. I have checked permissions and they look fine to me, but to be fair I am not an Linux expert by any means.

I have checked the security group in EC2 and even set one that had all TCP ports open but still no luck.

Any help/advice or a starter for 10 would be much appreciated.

Regards and thanks

Carl.

Upvotes: 2

Views: 3567

Answers (1)

Carl
Carl

Reputation: 86

OK, I have managed to figure this one out myself, so for anyone else faced with the same problem this is what i did.

Firstly I modified the WSO2 HOME/am160/wso2am-1.6.0/repository/conf/tomcat/catalina-server.xml file. In the section that contains port="9443" I modified this to port="8443" and also added the proxyport="443" to the line below.

I restarted WSO2 using sh ../../../bin/wso2server.sh --restart

I then added a port redirection using IPTABLES. The command I ran was sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443

Now I can access WSO2 API manager on either port 8443 or 443. I could have even left it on port 9443 if I wanted.

As this is a ami image hosted on EC2 make sure the security group for the instance allows https on port 443.

Hope this helps anyone else.

Carl.

Upvotes: 2

Related Questions