how to change listen port from default 7001 to something different? - weblogic

Can anyone tell me how to change the default listening port of Weblogic 10.3 to something different? I saw some posts on discussion boards which say that change it under ...//config/config.xml. Even I thought so, but surprisingly, there is no mention of word "port" in that file. Here is the file:
<?xml version='1.0' encoding='UTF-8'?>
<domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator/1.0/passwordvalidator.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd">
<name>vistakon</name>
<domain-version>10.3.5.0</domain-version>
<security-configuration>
<name>vistakon</name>
<realm>
<sec:authentication-provider xsi:type="wls:default-authenticatorType"></sec:authentication-provider>
<sec:authentication-provider xsi:type="wls:default-identity-asserterType">
<sec:active-type>AuthenticatedUser</sec:active-type>
</sec:authentication-provider>
<sec:role-mapper xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-role-mapperType"></sec:role-mapper>
<sec:authorizer xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-authorizerType"></sec:authorizer>
<sec:adjudicator xsi:type="wls:default-adjudicatorType"></sec:adjudicator>
<sec:credential-mapper xsi:type="wls:default-credential-mapperType"></sec:credential-mapper>
<sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType"></sec:cert-path-provider>
<sec:cert-path-builder>WebLogicCertPathProvider</sec:cert-path-builder>
<sec:name>myrealm</sec:name>
<sec:password-validator xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator" xsi:type="pas:system-password-validatorType">
<sec:name>SystemPasswordValidator</sec:name>
<pas:min-password-length>8</pas:min-password-length>
<pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-characters>
</sec:password-validator>
</realm>
<default-realm>myrealm</default-realm>
<credential-encrypted>{AES}1NMyZAwXiucj9+d8cj/LGFmw+yhHyIj/YprGOq/PA9Vg0Se2+DkV54N5AwFzW+fN2SWvU5YtojWvVSTnifrUdT6uso4fpO6inAa3LQccOQv59VFxdceHOMv2h1dkngxq</credential-encrypted>
<node-manager-username>weblogic</node-manager-username>
<node-manager-password-encrypted>{AES}tRw5L/hFc8+4J4w1H8uBj3unE0BC06cdk42CyMLR6Pk=</node-manager-password-encrypted>
</security-configuration>
<server>
<name>AdminServer</name>
<ssl>
<name>AdminServer</name>
<enabled>true</enabled>
</ssl>
<listen-port>8080</listen-port>
<listen-port-enabled>true</listen-port-enabled>
<listen-address></listen-address>
<java-compiler>javac</java-compiler>
<client-cert-proxy-enabled>false</client-cert-proxy-enabled>
<server-diagnostic-config>
<wldf-diagnostic-volume>Low</wldf-diagnostic-volume>
</server-diagnostic-config>
</server>
<embedded-ldap>
<name>vistakon</name>
<credential-encrypted>{AES}U6dM6LlDLLUYzefQ3M3NnsqijzWKSOgqLqNdJHVJEmeIU5v0wRZGm3ffumXif/uX</credential-encrypted>
</embedded-ldap>
<configuration-version>10.3.5.0</configuration-version>
<app-deployment>
<name>tbl</name>
<target>AdminServer</target>
<module-type>war</module-type>
<source-path>C:\Documents and Settings\bchitte\Desktop\tbl.war</source-path>
<security-dd-model>DDOnly</security-dd-model>
</app-deployment>
<app-deployment>
<name>DatabaseLoggerService</name>
<target>AdminServer</target>
<module-type>war</module-type>
<source-path>C:\Documents and Settings\bchitte\workspace\DatabaseLoggerService\DatabaseLoggerService.war</source-path>
<security-dd-model>DDOnly</security-dd-model>
</app-deployment>
<app-deployment>
<name>ReadingsProgressLogService</name>
<target>AdminServer</target>
<module-type>war</module-type>
<source-path>C:\Documents and Settings\bchitte\workspace\ReadingsProgressLogService\ReadingsProgressLogService.war</source-path>
<security-dd-model>DDOnly</security-dd-model>
</app-deployment>
<app-deployment>
<name>de</name>
<target>AdminServer</target>
<module-type>war</module-type>
<source-path>C:\Documents and Settings\bchitte\workspace\de.vogella.jersey.first\de.vogella.jersey.first.war</source-path>
<security-dd-model>DDOnly</security-dd-model>
</app-deployment>
<app-deployment>
<name>UpdateWIPQService</name>
<target>AdminServer</target>
<module-type>war</module-type>
<source-path>C:\Documents and Settings\bchitte\workspace\UpdateWIPQService\UpdateWIPQService.war</source-path>
<security-dd-model>DDOnly</security-dd-model>
</app-deployment>
<jms-server>
<name>VistakonJMSServer</name>
<target>AdminServer</target>
<persistent-store>VistakonFileStore</persistent-store>
</jms-server>
<file-store>
<name>VistakonFileStore</name>
<target>AdminServer</target>
</file-store>
<jms-system-resource>
<name>VistakonModule</name>
<target>AdminServer</target>
<sub-deployment>
<name>sdVistakon</name>
<target>VistakonJMSServer</target>
</sub-deployment>
<descriptor-file-name>jms/VistakonModule-jms.xml</descriptor-file-name>
</jms-system-resource>
<admin-server-name>AdminServer</admin-server-name>
<jdbc-system-resource>
<name>jdbc/MSSQL1</name>
<target></target>
<descriptor-file-name>jdbc/jdbc2fMSSQL1-5853-jdbc.xml</descriptor-file-name>
</jdbc-system-resource>
</domain>

Simplest option ...your can change it from AdminConsole.
Login to AdminConsole--->Server-->--->Configuration--->ListenPort (Change it)!

if your port is 7001, since it's the default it might not be mentioned in the config.xml. config.xml only reports stuff which differs from the default, for sake of simplicity.
apart from the config.xml, you should look into a number of other places under your domain-home:
bin/stopWebLogic.sh
bin/stopManagedWebLogic.sh
bin/startManagedWebLogic.sh
config/fmwconfig/servers/osbts1as/applications/em/META-INF/emoms.properties
config/config.xml
init-info/startscript.xml
init-info/tokenValue.properties
servers/osbts1as/data/nodemanager/osbts1as.url
servers/osbts1as/data/ldap/conf/replicas.prop
servers/osbts1ms1/data/nodemanager/osbts1ms1.url
servers/osbts1ms1/data/nodemanager/startup.properties
servers/osbts1ms2/data/nodemanager/osbts1ms2.url
servers/osbts1ms2/data/nodemanager/startup.properties
startManagedWebLogic_readme.txt
sysman/state/targets.xml
And don't forget to update any internal URIs of your deployed code.
See also http://www.javamonamour.org/2013/04/weblogic-change-admin-port-number.html
Especially changing the listen address/port of the admin can be troublesome. If you change only the managed server, it's a lot easier.
The best option is just rebuilding the domain.

The following lines are used to control the listen-port of a server, both are necessary:
<listen-port>7002</listen-port>
<listen-port-enabled>true</listen-port-enabled>

You can change the listen port as per your requirement.
This task can be accomplished in two diffrent ways.
By changing config.xml file
By changing in admin console
Change the listen port in config.xml as per your requirement and bounce the domain.
Admin Console
Login to AdminConsole->Server->Configuration->ListenPort (Change it)
Note:
It is a bad practice to edit config.xml and try to edit in admin console(It's a good practise as well)

As my experience, you can add another domain which listens different port than 7001, and use this domain in to deploy app.
Here's an example:
http://st-curriculum.oracle.com/obe/fmw/wls/10g/r3/installconfig/install_wls/install_wls.htm
HTH.

To update the listen ports for a server:
1.Click Lock & Edit in the Change Center of the webLogic Administration Console
2.expand Environment and select Server
3.click the name of the server and select Configuration > General
4.Find Listen Port to change it
5.click Save and start server.

That file has a listen-port element - that should be what you need to change, although it is currently set to 8080, not 7001.

If you still get the exception in the server startup after changing listen port, you should try changing Pointbase server port and debug port in setDomainEnv.cmd

I solved the issue by Changing the port no. in adrs-instances.xml file:
\JDEV_USER_HOME\system11.1.1.3.37.56.60\o.j2ee\adrs-instances.xml

Related

Wildfly Server local server debug panel shows error "http connector is not enabled for server profile"

I setup a local JBoss/Wildfly server launch configuraiton in Intellij Idea. When I attempt to start the server, the configuration panel pops up and shows following error.
Error: HTTP connector is not enabled for server profile
I could not find anything in the Idea help what this means and how to fix it. The server is a keycloak distro but is just plain wildfly 10 with an extra subsystem.
Has anyone seen this before and knows how to fix the error?
I can't reproduce this with fresh installation of keycloak 3.2.1 from here
IDEA looks for the 2 following xpath's searching for a HTTP connector settings:
"/ns:server/ns:profile/*[local-name()='subsystem']/*[local-name()='server']/*[local-name()='http-listener'][#*[local-name()='socket-binding' and .='http']]",
"/ns:server/ns:profile/*[local-name()='subsystem']/*[local-name()='connector'][#*[local-name()='socket-binding' and .='http']]"};
For me playing with the fresh keycloak distribution the first xpath hits at the following markup:
<subsystem xmlns="urn:jboss:domain:undertow:3.0">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
Please check your configuration around this place.
If this does not help, please attach your standalone.xml or at least the relevant part of it.
In my case changing of 'JRE' from 'Default' to explicit one (Even though it was the same as it was in parentheses in the default version) solved the problem.

JBAS010153: Node identifier property is set to the default value. Please make sure it is unique

I am getting the following WARN message while I start my host which is one of the Host Controller (HC) that is attached to the Domain Controller(DC).
[Server:server-two] 14:06:13,822 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 33) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
And my host-slave.xml has the following config...
<server-identities>
<!-- Replace this with either a base64 password of your own, or use a vault with a vault expression -->
<secret value="c2xhdmVfdXNlcl9wYXNzd29yZA=="/>
</server-identities>
I hope this config is the reason...... maybe I didn't understand..... but I couldn't find node identifier property rather this is the default secret value which I hope could be the cause of this WARN message.
However, I didn't mention HC to lookup host-slave.xml..... the command which I ran to start my HC is.....
[host-~-\-\-\bin]$./domain.sh -Djboss.domain.master.address=nnn.nn.nn.88 -b nnn.nn.nn.89 -bmanagement nnn.nn.nn.89 &
nnn.nn.nn.88 is my DC
Else please advise what's cause of the WARN message.
And please let me know the implication of this WARN message and advise us on the required config to overcome and sort out any consecutive consequences that would've been bound for this WARN.
I'm new to wildfly, and noticed this warning when I started it standalone from eclipse (I'm doing the following tutorial: https://wwu-pi.github.io/tutorials/lectures/eai/020_tutorial_jboss_project.html)
The fix was to add a node-identifier to the core-environment in the subsystem:
<subsystem xmlns="urn:jboss:domain:transactions:2.0">
<core-environment node-identifier="meindertwillemhoving">
<process-id>
<uuid/>
</process-id>
</core-environment>
<recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
</subsystem>
This is in file [wildfly]\standalone\configuration\standalone.xml.
This is the same answer as https://developer.jboss.org/message/880136#880136
According to WFLY-10541 if you are using WildFly v14.0.0 or newer you can pass the following to the startup script to set the transaction node identifier:
-Djboss.tx.node.id=<some-unique-id>
Setting the node identifier to an unique value is only required for proper handling of XA Transactions.
You can set it as follows in your XML configuration:
<subsystem xmlns="urn:jboss:domain:transactions:6.0">
<core-environment node-identifier="${jboss.tx.node.id}">
It needs to be a unique value up to 23 bytes long.
More about this here: http://www.mastertheboss.com/jboss-server/jboss-configuration/configuring-transactions-jta-using-jboss-as7-wildfly
Building on #kaptan's answer I added the following to the bottom of
bin/standalone.conf:
JAVA_OPTS="$JAVA_OPTS -Djboss.tx.node.id=`hostname -f`
This way I don't have to remember to add the "-Djboss.tx.node.id=" when running up wildfly by hand.
For this <server-identities> is not the issue. In fact, it shouldn't be touched at all.
When JBoss is started in domain mode by domain.sh, by default there will be three servers server-one server-two server-three. When you are running one more HC attached to the DC.... the defaulted server which is in auto-start mode will get clash when we start HC attaching to DC,- by the following command.
[host-~-\-\-\bin]$./domain.sh -Djboss.domain.master.address=nnn.nn.nn.88 -b nnn.nn.nn.89 -bmanagement nnn.nn.nn.89 &
Or by having the host configuration at HC (default host.xml... until unless we choose a different one....).
<domain-controller>
<remote host="${jboss.domain.master.address:nnn.nn.nn.88}" port="${jboss.domain.master.port:9999}" security-realm="ManagementRealm"/>
<domain-controller>
In order to solve this, we need to turn auto-start to false..... And we need to create a new server-group...... To that group we need to add dc-created-server and hc-created-server..... we can choose the appropriate same profile either full-ha or full for both created servers across DC and HC.
SO when we start the group by configuring the required HEAP size including permgen space... You could start both DC and HC.... and in DC you could see both of your-created-servers are started in the created server-group.
DC- Domain Controller
HC- Host Controller
To deploy you need to upload .ear or web-archive in the Application Console. You cannot place it in the deployments folder as how you do in standalone mode with .dodeploy file.
If you upload the same .ear next version do the Replace option instead of the Remove & Add option in the upload process.

RavenDB on a port other than 8080

We are trying to install NServiceBus 4.2.0.0 with RavenDB via the following command:-
nserviceBus.host.exe -install serviceName="xxxx.Server" -displayname="xxxx.Server" -username="domainName\serviceAccountName" -password="serviceAccountPassword"
NServiceBus seems to install however the RavenDB install fails - note we are trying to install under a port other than 8080 - as a result we have placed the line:-
<add name="NServiceBus/Persistence" connectionString="Url = http://localhost:9090" />
...in our config
The error message we receive is:-
[1] WARN NServiceBus.ConfigureRavenPersistence [(null)] <(null)> - Raven could not be contacted. We tried to access Raven using the following url: http://localhost:9090.
If I leave at the default port (8080), everything installs correctly, however I need to change the port because 8080 is already in use
Does anyone have any ideas ?
RavenDB installation is separate from NServiceBus host installation.
To install RavenDB either follow the instructions on RavenDB website or you can install Raven server by using the NServiceBus Powershell cmdlets, see http://docs.particular.net/nservicebus/managing-nservicebus-using-powershell for instructions on how to load the cmdlets.
If you choose to use the cmdlets, you need to execute Install-NServiceBusRavenDB -Port 9090
If you just want to change the RavenDB port, you can do the following:
Note: The paths defined here are from the NServiceBus 4.3.2 installer with default paths
To download the installer, you can visit here: https://github.com/Particular/NServiceBus/releases/download/4.3.2/Particular.NServiceBus-4.3.2.exe
Launch the services management window (i.e. Run services.msc)
Stop service RavenDB
Navigate to the following path: "C:\Program Files\NServiceBus.Persistence.v4"
Edit the Raven.Server.exe.config: <add key="Raven/Port" value="<your port here>" />
Save the config
Start the service
Hit localhost on your new port
You should now be able to hit the RavenDB web on the new port!
Maybe try to change local.config in RavenDB folder.
<?xml version="1.0" encoding="utf-8"?>
<LocalConfig Port="9090" />
then restart raven
To change the port of RavenDb,
IIS
Change the port in IIS :)
here's where mine is set (under bindings)
Development Console
Find the config file of the ravenDb exe or dll (depends if you're running it as an IIS website, windows server or just the console window).
<Root RavenDb folder>\Server\RavenDb.server.exe.config
Set the port, manually in the file. Change the following ...
<add key="Raven/Port" value="*"/>
to
<add key="Raven/Port" value="6969"/>
or whatever port you need/require.
Windows Service
No idea! i've never used it.
Good luck!

Getting request and creating HTTP response using Tomcat

I am currently trying to use embeded Tomcat for my application and am trying to set it up to get the URL of the http request.
Some Background:
I am using the same code as in the first answer for the post here : Howto embed Tomcat 6?
The only change I have made is :
private String catalinaHome = "/home/xyz/tomcat"; // This dir is created and has full access permissions
Also , I am looking at: http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/startup/Embedded.html
There are no server.xml and tomcat-users.xml that I could find, so I created a tomcat-users.xml since I was getting an exception :Memory database file /home/xyz/tomcat/conf/tomcat-users.xml cannot be read .
tomcat-users.xml:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
The code uses container.setRealm(new MemoryRealm());
It appears from here : http://tomcat.apache.org/tomcat-4.1-doc/catalina/funcspecs/fs-memory-realm.html that I should have a server.xml file and there should already be one created by default.
1] Do I need to create a server.xml, what should be the default in it ?
I have put a file with default from here : http://www.akadia.com/download/soug/tomcat/html/tomcat_server_xml.html , but just want to know what is the right thing to do ?
2]When I access http://localhost:8089/mywebapp/index.html, all i get is The requested resource () is not available, though I have an index.html page at the "webappDir" in the code
3] My only need from the embedded tomcat is to intercept so as to get the URL passed to tomcat in my code. I can then parse the URL [do my stuff] and then create a http payload and send an http response back.
I would appreciate any pointers, especially for 3] ?
Thanks!
Ok, for your first question, yo do not need server.xml. If you check the code of your initial post they are setting the parameters there. So that is what server.xml would encapsulate. In reality what happens is that Tomcat will parse server.xml for the properties you are defining on your java file where you instanciate the catalina call to start. But since it is embedded you are setting all those parameters on you class instead.
For your second question, check your logs directory and see what is being parsed. Something is happening after your service starts because it should already redirect you once you call the port. either way, just try http://localhost:8089 and see what you get back in return from tomcat. It should give you some kind of response back from the server itself.
if you do it like this "http://localhost:8089/mywebapp/index.html" you are trying to access a created context, and that might not be configured correctly, but that is just a guess right now.
Try this first and tell me what you get back. we can troubleshoot from this point and see if I can help more in that sense.
Quick question, is this windows or linux you are installing on?
If it is linux the configurations filea are located usually on /etc/tomcat6. (at least on ubuntu they are). Reply back with the version you have installed. I might be able to help you out.
I guess I should also elaborate here a little more. Tomcat is a service in linux as well, so in ubuntu you have to start tomcat in order to access it.
$: sudo service tomcat6 start
then it starts tomcat on port 8080 (usually if not changed) of your localhost. hence you type localhost:8080 to access the website for configuration of tomcat that gives you a It works prompt for you.
Let me know if you have more questions, I will try to respond to the best of my knowledge

Restrict access to specific URL (Apache Tomcat)

How can I restrict access to a specific URL (it is a Tomcat Application Server)? e.g. http://localhost:8081/application cannot be accessed by an user except a specified IP (that is the calling service)
Quote:
The Remote Address filter, org.apache.catalina.valves.RemoteAddrValve, allows you to compare the IP address of the requesting client against one or more regular expressions to either allow or prevent the request from continuing based on the results of this comparison. A Remote Address filter can be associated with a Tomcat Engine, Host, or Context container.
org.apache.catalina.valves.RemoteAddrValve.
http://www.oxxus.net/tutorials/tomcat/tomcat-valve.htm
So, you'd need something along the lines of
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="<your-ip-here>"/>
For possible values, see
http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Remote_Address_Filter
You should be able to set this in the WEB-INF/web.xml for your application, see
http://oreilly.com/java/archive/tomcat.html
Goto following path: C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina\localhost\
Under this path you find "manager.xml" file.
Edit "manager.xml" file, with following content:
<Context path="/manager" debug="0" privileged="true">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.0.0.1,10.100.1.2"/>
<!-- Link to the user database we will get roles from
<ResourceLink name="users" global="UserDatabase" type="org.apache.catalina.UserDatabase"/>
-->
</Context>
Save and run server. You got it.
NOTE :
127.0.0.1 MEANS YOUR SYSTEM IP
10.100.1.2 -THIS IS YOUR FRIENDS IP.