温馨提示×

debian中weblogic如何启动

小樊
51
2026-09-29 12:05:42
栏目: 智能运维

在 Debian 系统中启动 WebLogic(通常指 Oracle WebLogic Server),一般有以下几种常见方式,取决于你使用的是 开发模式 还是 生产模式,以及是否配置了 域(Domain)。


一、前提条件

  1. 已安装 JDK(WebLogic 需要)
  2. 已创建 WebLogic 域(Domain)
  3. 知道域目录位置,例如:
    /home/weblogic/user_projects/domains/base_domain
    

二、启动 WebLogic 管理服务器(Admin Server)

1️⃣ 进入域目录

cd /home/weblogic/user_projects/domains/base_domain

2️⃣ 启动 Admin Server

./startWebLogic.sh

✅ 默认监听端口:

  • http://localhost:7001/console

如果是生产模式,启动时会要求输入:

  • 用户名
  • 密码

三、后台启动(推荐)

nohup ./startWebLogic.sh > start.log 2>&1 &

查看日志:

tail -f start.log

四、使用 boot.properties 免密码启动(常用)

避免每次输入用户名密码:

cd /home/weblogic/user_projects/domains/base_domain/servers/AdminServer/security

创建或编辑 boot.properties:

username=weblogic
password=你的密码

⚠️ 第一次启动后,WebLogic 会自动加密该文件。


五、启动受管服务器(Managed Server)

如果有受管服务器(如 Server1):

cd /home/weblogic/user_projects/domains/base_domain/bin
./startManagedWebLogic.sh Server1 http://localhost:7001

六、使用 systemd 管理(Debian 推荐)

示例 systemd 服务文件

[Unit]
Description=WebLogic Admin Server
After=network.target

[Service]
Type=simple
User=weblogic
WorkingDirectory=/home/weblogic/user_projects/domains/base_domain
ExecStart=/home/weblogic/user_projects/domains/base_domain/startWebLogic.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target

启用:

systemctl daemon-reload
systemctl start weblogic
systemctl enable weblogic

七、常见问题

❌ 端口被占用

netstat -tunlp | grep 7001

❌ JDK 未配置

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH

如果你能提供:

  • WebLogic 版本
  • 是否已建域
  • 是开发模式还是生产模式

我可以给你更精确的启动方式。

0 踩