Prerequisites
Before deploying WebLogic on Ubuntu, ensure your system meets the following requirements:
java -version
; if missing, install via sudo apt update && sudo apt install openjdk-11-jdk
.fmw_14.1.1.0.0_wls_lite_generic.jar
) from Oracle’s official website. Ensure the package matches your WebLogic version.Step 1: Install and Configure Java
WebLogic depends on Java for execution. If not already installed, use the following commands to install OpenJDK 11:
sudo apt update
sudo apt install openjdk-11-jdk
Verify the installation:
java -version
Ensure the output displays the correct Java version (e.g., “openjdk version 11.0.xx”).
Step 2: Create a Dedicated WebLogic User
For security, run WebLogic as a non-root user. Create a weblogic
group and user:
sudo groupadd weblogic
sudo useradd -g weblogic weblogic
sudo passwd weblogic # Set a strong password
This user will own all WebLogic-related files and directories.
Step 3: Download and Extract WebLogic
Move the downloaded WebLogic package to a target directory (e.g., /opt
) and extract it:
sudo mkdir -p /opt/weblogic
sudo mv ~/Downloads/fmw_14.1.1.0.0_wls_lite_generic.jar /opt/weblogic/
cd /opt/weblogic
sudo -u weblogic java -jar fmw_14.1.1.0.0_wls_lite_generic.jar -mode=console
The -mode=console
flag enables text-based installation (no GUI required). Follow the on-screen prompts to complete the installation (accept the license agreement, specify the installation directory, etc.).
Step 4: Configure Environment Variables
Set environment variables for WebLogic in the weblogic
user’s shell profile (~/.bash_profile
):
sudo -u weblogic nano ~/.bash_profile
Add the following lines (adjust paths based on your installation directory):
export WEBLOGIC_HOME=/opt/weblogic/wlserver
export PATH=$WEBLOGIC_HOME/bin:$PATH
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 # Path to your JDK
Save the file and apply changes:
source ~/.bash_profile
Verify the variables:
echo $WEBLOGIC_HOME # Should display the WebLogic home directory
echo $JAVA_HOME # Should display the JDK path
Step 5: Create a WebLogic Domain
A domain is a logically related group of WebLogic resources (servers, applications, etc.). Use the config.sh
script to create a domain:
cd /opt/weblogic/wlserver/server/bin
sudo -u weblogic ./config.sh
Follow the wizard:
mydomain
) and location (e.g., /opt/weblogic/user_projects/domains/mydomain
).weblogicadmin
/StrongPassword123
).Step 6: Start the WebLogic Server
Navigate to the domain’s bin
directory and start the server:
cd /opt/weblogic/user_projects/domains/mydomain/bin
sudo -u weblogic ./startWebLogic.sh
Check the server logs (/opt/weblogic/user_projects/domains/mydomain/servers/AdminServer/logs/AdminServer.log
) for startup messages. If successful, you’ll see “Server started in RUNNING mode.”
Step 7: Access the WebLogic Console
Open a browser and navigate to:
http://<your_server_ip>:7001/console
Log in with the administrator credentials you set during domain creation. The console provides a graphical interface to manage the server, domains, and applications.
Step 8: Deploy a Web Application
To deploy a WAR file (e.g., myapp.war
):
http://<your_server_ip>:7001/myapp # Replace "myapp" with the context root from the WAR file
Alternatively, use the WebLogic Scripting Tool (WLST) for command-line deployment:
cd /opt/weblogic/wlserver/common/bin
./wlst.sh
Enter the following WLST commands (replace paths and names as needed):
connect('weblogicadmin', 'StrongPassword123', 't3://localhost:7001')
deploy(appPath='/path/to/myapp.war', name='myapp', targets='AdminServer')
disconnect()
exit()
Troubleshooting Tips
netstat -tuln | grep 7001
and modify the port in the domain’s config/config.xml
if needed.weblogic
user owns all WebLogic directories (e.g., /opt/weblogic
, /opt/weblogic/user_projects
)./opt/weblogic/user_projects/domains/mydomain/servers/AdminServer/logs/
) for errors during startup or deployment.