温馨提示×

debian上weblogic如何启

小樊
43
2026-10-02 10:18:50
栏目: 智能运维

在 Debian 上启动 WebLogic(通常基于 Oracle WebLogic Server),一般步骤如下:


一、前提条件

  1. 已安装 JDK(WebLogic 需要 Oracle JDK 或兼容 JDK)
  2. 已安装 WebLogic Server
  3. 已创建 Domain(域)

常见目录结构示例:

/opt/weblogic/
└── user_projects
    └── domains
        └── base_domain

二、启动 WebLogic(最常见方式)

1. 切换到域目录

cd /opt/weblogic/user_projects/domains/base_domain

2. 启动 Admin Server

./startWebLogic.sh

如果是前台启动,终端会一直占用
按 Ctrl+C 会停止 WebLogic


三、后台启动(推荐生产环境)

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

查看日志:

tail -f startWebLogic.log

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

如果创建了 Managed Server(如 Server-1):

cd /opt/weblogic/user_projects/domains/base_domain/bin
./startManagedWebLogic.sh Server-1 http://localhost:7001

五、使用系统服务方式(可选)

示例:systemd(Debian 8+)

创建服务文件:

sudo nano /etc/systemd/system/weblogic.service

内容示例:

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

[Service]
Type=simple
User=weblogic
ExecStart=/opt/weblogic/user_projects/domains/base_domain/startWebLogic.sh
ExecStop=/opt/weblogic/user_projects/domains/base_domain/bin/stopWebLogic.sh

[Install]
WantedBy=multi-user.target

启用并启动:

sudo systemctl daemon-reload
sudo systemctl start weblogic
sudo systemctl enable weblogic

六、常见问题

1. 端口被占用

默认 Admin Server 端口是 7001

2. 启动卡住

查看日志:

domains/base_domain/servers/AdminServer/logs/AdminServer.log

3. Debian 上注意

  • 使用 bash 而不是 sh
  • 确保 JAVA_HOME 已配置
echo $JAVA_HOME

如果你能告诉我:

  • WebLogic 版本
  • 是否已建域
  • 是 Admin Server 还是 Managed Server

我可以给你更精确的启动命令。

0 踩