一、Debian系统网络基础配置
Debian系统的网络接口配置需根据版本选择对应方法:
/etc/network/interfaces文件,设置静态IP(推荐)或DHCP。静态IP示例如下:auto eth0
iface eth0 inet static
address 192.168.1.100 # 替换为你的实际IP
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4 # 可选:指定DNS服务器
DHCP配置则将iface eth0 inet static改为iface eth0 inet dhcp。netplan工具,编辑/etc/netplan/01-netcfg.yaml(文件名可能不同):network:
renderer: networkd
ethernets:
eth0:
dhcp4: false # 关闭DHCP
addresses: [192.168.1.100/24] # IP/子网掩码
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
保存后执行sudo netplan apply应用配置。sudo systemctl restart networking;Debian 11及以上用sudo netplan apply(无需重启服务)。ip addr show eth0或ifconfig eth0(需安装net-tools)。ping www.google.com(需联网)。二、WebLogic特定网络配置
WebLogic的核心网络配置位于域目录的config/config.xml中(如/u01/domains/mydomain/config/config.xml)。找到<server>节点,设置以下参数:
<server>
<name>myserver</name> <!-- 服务器名称 -->
<ip-address>192.168.1.100</ip-address> <!-- 绑定IP(必须为Debian系统IP) -->
<port>7001</port> <!-- 监听端口(默认7001,可修改) -->
</server>
修改后需重启WebLogic使配置生效。
若需通过环境变量覆盖默认配置,可编辑$DOMAIN_HOME/bin/startWebLogic.sh(如/u01/domains/mydomain/bin/startWebLogic.sh),在文件开头添加JVM参数:
export JAVA_OPTIONS="$JAVA_OPTIONS -Dweblogic.ListenPort=7001" # 确认端口与config.xml一致
export JAVA_OPTIONS="$JAVA_OPTIONS -Dweblogic.management.server=http://192.168.1.100:7001" # 管理服务器地址
这些参数会覆盖config.xml中的部分设置。
确保Debian防火墙允许WebLogic端口(默认7001)通过。若使用ufw(Uncomplicated Firewall),执行:
sudo ufw allow 7001/tcp # 允许TCP协议的7001端口
sudo ufw enable # 启用防火墙(若未启用)
sudo ufw status # 验证规则
若使用iptables,需添加对应规则(如iptables -A INPUT -p tcp --dport 7001 -j ACCEPT)。
三、验证WebLogic网络连通性
ps -ef | grep weblogic查看是否有startWebLogic.sh进程。telnet 192.168.1.100 7001或nc -zv 192.168.1.100 7001(需安装netcat),若显示“Connected”则表示端口开放。http://192.168.1.100:7001/console,输入管理员账号密码,若能登录则说明配置成功。