在 CentOS 上“管控 WebLogic”通常指安装、启动/停止、监控、权限与安全管理、自动化运维等方面。下面从系统层 → WebLogic 层 → 运维管控三个维度给你一套可落地的方案。
不要使用 root 运行 WebLogic
groupadd weblogic
useradd -g weblogic weblogic
passwd weblogic
chown -R weblogic:weblogic /opt/weblogic
原则:
weblogic 用户运行visudo
weblogic ALL=(ALL) NOPASSWD:/opt/weblogic/bin/startWebLogic.sh
WebLogic 常用端口:
firewall-cmd --permanent --add-port=7001/tcp
firewall-cmd --permanent --add-port=7002/tcp
firewall-cmd --reload
✅ 建议:
编辑 /etc/security/limits.conf
weblogic soft nofile 65536
weblogic hard nofile 65536
weblogic soft nproc 4096
JVM 依赖文件句柄,必须调高。
前台启动(调试)
su - weblogic
cd /opt/weblogic/user_projects/domains/base_domain
./startWebLogic.sh
后台启动
nohup ./startWebLogic.sh > server.log 2>&1 &
停止
./stopWebLogic.sh
/etc/systemd/system/weblogic.service
[Unit]
Description=WebLogic Server
After=network.target
[Service]
Type=forking
User=weblogic
Group=weblogic
ExecStart=/opt/weblogic/user_projects/domains/base_domain/startWebLogic.sh
ExecStop=/opt/weblogic/user_projects/domains/base_domain/stopWebLogic.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable weblogic
systemctl start weblogic
✅ 好处:
config.xml 示例:
<listen-address>127.0.0.1</listen-address>
再通过 Nginx 反向代理 + IP 白名单访问。
ps -ef | grep weblogic
netstat -tunlp | grep 7001
WebLogic 支持 WLST:
connect('admin','password','t3://localhost:7001')
state('AdminServer')
可集成:
关键日志:
servers/AdminServer/logs/AdminServer.logdomains/base_domain/servers/AdminServer/logs/access.log建议:
✅ 必须做:
weblogic 默认账号CentOS 管控 WebLogic = 非 root 用户运行 + systemd 管理 + 防火墙限制 + 控制台收敛 + 监控告警
如果你需要:
可以直接告诉我你的使用场景。