2007/10/15
15 Oct, 2007

How to change the HTTP & HTTPS ports of WSO2 WSAS?

  • Afkham Azeez
  • VP - Cloud - WSO2

Answer: There may be several cases in which the user wants to change the WSAS HTTP & HTTPS ports, such as when running multiple instances of WSAS on the same machine or to switch to standard ports such as 8080 or 8443.

WSAS can run in two modes; standalone mode & servlet container mode. In standalone mode, WSAS runs as a standalone server, and owns the entire runtime. In servlet container mode, WSAS runs within the control of a servlet container as a Web application.

Standalone Mode

In the case of the standalone mode, the HTTP & HTTPS ports can be simply changed by editing the WSAS server.xml file.

Servlet Container Mode

But in the case of servlet container mode, changing these ports will be specific to the servlet container or application server WSAS is deployed on. e.g. in Apache Tomcat, these ports can be changed in the TOMCAT_HOME/conf/server.xml.

The rest of this article shows how to change the HTTP & HTTPS ports when WSAS is running in standalone mode.

For the purpose of this article, let's assume that you want to change the HTTP & HTTPS ports to 8080 & 8443 respectively.

Follow these steps to change the ports when WSAS is running in standalone mode:

  1. Locate {WSAS home directory}/conf/axis2.xml
  2. To change the HTTP port, locate the following section in the above file

    <transportReceiver name="http"
    class="org.wso2.wsas.transport.http.HttpTransportListener">
    <parameter name="port">9762</parameter>
    <!--Uncomment the following to enable Apache2 mod_proxy. The port on the
    Apache server is 80 in this case.-->
    <!--<parameter name=proxyPort &gt;80></parameter>80="">-->
    </transportReceiver>
  3. In the above segment, change <parameter name="port">9762</parameter> to <parameter name="port">8080</parameter>
  4. To change the HTTPS port, locate the following section in the above file
    <transportReceiver name="https"
    class="org.wso2.wsas.transport.http.HttpsTransportListener">
    <parameter name="port">9443</parameter>
    <!--Uncomment the following to enable Apache2 mod_proxy. The port on the
    Apache server is 443 in this case.-->
    <!--<parameter name="proxyPort">443</parameter>-->
    <parameter name="sslProtocol">TLS</parameter>
    <parameter name="maxHttpHeaderSize">8192</parameter>
    <parameter name="maxThreads">150</parameter>
    <parameter name="minSpareThreads">25</parameter>
    <parameter name="maxSpareThreads">75</parameter>
    <parameter name="enableLookups">false</parameter>
    <parameter name="disableUploadTimeout">false</parameter>
    <parameter name="clientAuth">false</parameter>
    <parameter name="acceptCount">100</parameter>
    <parameter name="keystore">
    <wso2wsas:KeyStore
    xmlns:wso2wsas="https://www.wso2.org/products/wsas">
    <!-- Keystore file location-->
    <wso2wsas:Location>conf/wso2wsas.jks</wso2wsas:Location>
    <!-- Keystore type (JKS/PKCS12 etc.)-->
    <wso2wsas:Type>JKS</wso2wsas:Type>
    <!-- Keystore password-->
    <wso2wsas:Password>wso2wsas</wso2wsas:Password>
    </wso2wsas:KeyStore>
    </parameter>
    </transportReceiver>
  5. In the above segment, change <parameter name="port">9443</parameter> to <parameter name="port">8443</parameter>
  6. Restart WSO2 WSAS

Applies To

WSO2 WSAS 2.0 & newer versions

More Information

Rest of the WSO2 WSAS HOWTO series

 

 

About Author

  • Afkham Azeez
  • VP - Cloud
  • WSO2