Monday, May 25, 2015



In this post I'll explain you how to change the defalut ports of WSO2 Products to system default ports 443 and 80.
You can change the ports used for services (i.e. APIs , proxies) by changing the http and https transport receivers declared in
 <PRODUCT>/repository/conf/axis2/axis2.xml  as shown below.

HTTP Receiver


<transportReceiver name="http" class="org.apache.synapse.transport.passthru.PassThroughHttpListener">
<parameter name="port" locked="false">80</parameter>
<parameter name="non-blocking" locked="false">true</parameter>
<!-parameter name="bind-address" locked="false">hostname or IP address</parameter->
<!-parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter->
<parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.PassThroughNHttpGetProcessor</parameter>
<!-<parameter name="priorityConfigFile" locked="false">location of priority configuration file</parameter>->
</transportReceiver>

HTTPS Receiver


<transportReceiver name="https" class="org.apache.synapse.transport.passthru.PassThroughHttpSSLListener">
<parameter name="port" locked="false">443</parameter>
<parameter name="non-blocking" locked="false">true</parameter>
<!-
parameter name="bind-address" locked="false">hostname or IP address</parameter
->
<!-
parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter
->
<parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.PassThroughNHttpGetProcessor</parameter>
<parameter name="keystore" locked="false">
<KeyStore>
<Location>repository/resources/security/wso2carbon.jks</Location>
<Type>JKS</Type>
<Password>wso2carbon</Password>
<KeyPassword>wso2carbon</KeyPassword>
</KeyStore>
</parameter>
<parameter name="truststore" locked="false">
<TrustStore>
<Location>repository/resources/security/client-truststore.jks</Location>
<Type>JKS</Type>
<Password>wso2carbon</Password>
</TrustStore>
</parameter>
<!--<parameter name="SSLVerifyClient">require</parameter>
supports optional|require or defaults to none -->
</transportReceiver>

And if you need to configure the ports used by carbon admin console and other apps (i.e. APIStore, Publisher) you need to change the HTTP and HTTPS connector protocol configurations of catalina-server.xml file in

 <PRODUCT>/repository/conf/tomcat/catalina-server.xml.


<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
port="80"
redirectPort="443"
bindOnInit="false"
maxHttpHeaderSize="8192"
acceptorThreadCount="2"
maxThreads="250"
minSpareThreads="50"
disableUploadTimeout="false"
connectionUploadTimeout="120000"
maxKeepAliveRequests="200"
acceptCount="200"
server="WSO2 Carbon Server"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg"
URIEncoding="UTF-8"/>

<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
port="443"
bindOnInit="false"
sslProtocol="TLS"
maxHttpHeaderSize="8192"
acceptorThreadCount="2"
maxThreads="250"
minSpareThreads="50"
disableUploadTimeout="false"
enableLookups="false"
connectionUploadTimeout="120000"
maxKeepAliveRequests="200"
acceptCount="200"
server="WSO2 Carbon Server"
clientAuth="false"
compression="on"
scheme="https"
secure="true"
SSLEnabled="true"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/javascript,application/x-javascript,application/javascript,application/xml,text/css,application/xslt+xml,text/xsl,image/gif,image/jpg,image/jpeg"
URIEncoding="UTF-8"/>

This is all and Please drop a comment if you have any queries. 

9 comments:

Subscribe to RSS Feed Follow me on Twitter!