Application server
Reading and writing port information is done with the WildFly Command line interface (CLI). For more information on this subject, see WildFly Command line interface.
In WildFly, every port has a base value which can be configured. Also there is one single offset-value, which is applied to all ports. This offset can be configured as well. The port the server listens on is base port + offset.
Below you can find some example CLI commands for reading and writing port values.
Read offset
/socket-binding-group=standard-sockets:read-attribute(name=port-offset)
Read all ports
/socket-binding-group=standard-sockets:read-children-resources(child-type=socket-binding)
Set port offset to 10000
/system-property=pn.socket.binding.port.offset.default:write-attribute(name=value, value="10000")
Set management http base port to 9090 (this is the port you use for connecting with the CLI in on-line mode)
/system-property=pn.management.http.port.default:write-attribute(name=value, value="9090")
Set management https base port to 9093
/socket-binding-group=standard-sockets/socket-binding=management-http:write-attribute(name=port, value=${jboss.management.http.port:9093})
Set http base port to 8080
/socket-binding-group=standard-sockets/socket-binding=http:write-attribute(name=port, value=${jboss.http.port:8080})
Set https base port to 8443
/socket-binding-group=standard-sockets/socket-binding=https:write-attribute(name=port, value=${jboss.https.port:8443})
Set port value using Java system properties
The general format for port-values is ${systemproperty:default-value}. This means that the default value is used, except if the system property is set. You can, for example, change the port offset to 22222 by adding the following to the jboss-wrapperdefault.conf.
wrapper.java.additional.nr=-D jboss.socket.binding.port-offset= 22222
Note  
*In the application server log you can search for the phrase listening on to find out the ports that it is actually listening on.