温馨提示×

debian中weblogic如何启

小樊
41
2026-10-14 04:08:36
栏目: 智能运维

在 Debian 系统中启动 WebLogic(通常指 Oracle WebLogic Server),一般步骤如下。以 WebLogic 12c / 14c 为例(其他版本类似)。


一、前提条件

  1. 已安装 JDK(WebLogic 需要)
    java -version
    
  2. 已安装 WebLogic(知道安装目录,例如 /opt/weblogic)
  3. 已创建 Domain(域,例如 /opt/weblogic/user_projects/domains/base_domain)

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

1️⃣ 进入域目录

cd /opt/weblogic/user_projects/domains/base_domain

2️⃣ 使用启动脚本

./startWebLogic.sh

✅ 默认会启动 AdminServer
访问控制台:

http://localhost:7001/console

如果是远程服务器,把 localhost 换成服务器 IP


三、后台启动(不占用终端)

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

查看日志:

tail -f admin.log

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

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

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

后台运行:

nohup ./startManagedWebLogic.sh Server-1 http://localhost:7001 > server1.log 2>&1 &

五、使用 WLST 启动(可选)

cd /opt/weblogic/oracle_common/common/bin
./wlst.sh
connect('weblogic','password','t3://localhost:7001')
start('AdminServer')

六、Debian 系统服务方式(推荐生产环境)

可写成 systemd 服务(示例):

/etc/systemd/system/weblogic.service

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

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

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start weblogic
systemctl enable weblogic

七、常见问题

  • 端口被占用:修改 config/config.xml
  • 内存不足:调整 setDomainEnv.sh 中 Xms/Xmx
  • 权限问题:确保用户有目录权限

如果你能告诉我:

  • WebLogic 版本
  • 是否已创建 Domain
  • 是本地还是服务器环境

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

0 踩