在CentOS上启动WebLogic服务,可参考以下方法:
source wlserver/server/bin/setWLSEnv.sh
设置环境变量,最后运行./startWebLogic.sh
启动服务,也可在后台运行nohup ./startWebLogic.sh &
。如果创建了专门的WebLogic用户,需先切换到该用户,再进入安装目录执行启动脚本。/etc/systemd/system/weblogic.service
文件,内容示例为:[Unit]
Description=WebLogic Server
After=network.target
[Service]
Type=simple
User=weblogic
Group=weblogic
WorkingDirectory=/path/to/weblogic/domain
ExecStart=/path/to/weblogic/bin/startWebLogic.sh
ExecStop=/path/to/weblogic/bin/stopWebLogic.sh
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
保存后执行sudo systemctl daemon-reload
,再使用sudo systemctl enable weblogic.service
和sudo systemctl start weblogic.service
启用并启动服务。