How to Start Weblogic on Port 80

Situation

On Unix based system, only privileged user (root) can start process with port number less than 1025 but if the owner of Weblogic process is a non-privileged user, how to let the user start Weblogic with port 80?

Solution

Step 1. Log in Weblogic Admin Console.

Step 2. Create Machine. Lock & Edit→Environment→Machines→New→Name:[MachineName], Machine OS:[Unix]→OK.

Step 3. Enable Post-Binding. Open machine configuration→General→Click “Enable Post-Bind UID”, Post-Bind UID:[non-privileged user id]→”Enable Post-Bind GID”, Post-Bind GID:[non-privileged user group id].

Step 4. Assign Server to Machine.  Open machine configuration→Servers→Add→[Select the Server you want to assign to the machine]→Finish.

Step5. Change the port number of the Server. Open server configuration→General→Listen Port:[80]→Save→Active Changes.

Stop Weblogic and use “root” to start Weblogic. Although “root” start the Weblogic process, the process owner will be switched to the non-privileged user.

Step6. If we only can use the non-privileged user to start the Weblogic process, we should add the non-privileged user to sudo file and allow the user to execute sudo command. Execute “su – root” to switch to root user→Execute “visudo”→Add “[the non-privileged user id]  ALL=(ALL)  ALL” to the file.

Stop Weblogic, switch to the non-privileged user, and execute “sudo ./startWebLogic.sh” and insert the password of the non-privileged user to start the process.

If we use background execution to start Weblogic and have no chance to enter the password, then add “NOPASSWD:” in the sudo file.

[the non-privileged user id] ALL=(ALL) NOPASSWD: ALL

Restrict the privilege to execute the commands under /opt/bea/user_projects/domains/base_domain/

[the non-privileged user id] ALL=(ALL) NOPASSWD: /opt/bea/user_projects/domains/base_domain/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s