RedHat 8.0配置本地dnf源与控制台方式最小化安装运行WinCC OA 3.17
挂载点/media/cdrom
mkdir /media/cdrom
加载光驱ISO文件
mount -o loop rhel-8.0-x86_64-dvd.iso /media/cdrom
或挂载光驱
mount /dev/cdrom /media/cdrom
编辑/etc/yum.repos.d/cdrom.repo
vi /etc/yum.repos.d/cdrom.repo
[InstallMedia-BaseOS]
name=Red Hat Enterprise Linux 8 - BaseOS
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///media/cdrom/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[InstallMedia-AppStream]
name=Red Hat Enterprise Linux 8 - AppStream
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///media/cdrom/AppStream/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
修改文件权限
chmod 644 /etc/yum.repos.d/cdrom.repo
测试
dnf clean all
subscription-manager clean
dnf repolist
禁用redhat8 的subscription manager
vi /etc/yum/pluginconf.d/subscription-manager.conf
enabled = 0
dnf安装WinCC OA软件,同时会自动安装依赖
dnf install WinCC_OA_3.17-base-rhel-0-2.x86_64.rpm
如果有如下的结果,证明已经安装成功。
[root@asus-redhat-1 WinCC_OA_3.17_linux_rhel_x86_64_P002]# dnf install WinCC_OA_3.17-base-rhel-0-2.x86_64.rpm
Last metadata expiration check: 1 day, 1:31:20 ago on Wed 18 Mar 2020 10:19:31 PM CST.
Dependencies resolved.
===========================================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================================
Installing:
WinCC_OA_3.17-base-rhel x86_64 0-2 @commandline 777 M
Installing dependencies:
SDL x86_64 1.2.15-32.el8 InstallMedia-AppStream 217 k
tcsh x86_64 6.20.00-9.el8 InstallMedia-AppStream 452 k
ttmkfdir x86_64 3.0.9-54.el8 InstallMedia-AppStream 62 k
xorg-x11-fonts-Type1 noarch 7.5-19.el8 InstallMedia-AppStream 522 k
xterm x86_64 331-1.el8 InstallMedia-AppStream 528 k
xterm-resize x86_64 331-1.el8 InstallMedia-AppStream 38 k
Installing weak dependencies:
xorg-x11-fonts-misc noarch 7.5-19.el8 InstallMedia-AppStream 5.8 M
Transaction Summary
===========================================================================================================================================================================
Install 8 Packages
Total size: 785 M
Installed size: 1.1 G
Is this ok [y/N]: Y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : xterm-resize-331-1.el8.x86_64 1/8
Installing : xorg-x11-fonts-misc-7.5-19.el8.noarch 2/8
Running scriptlet: xorg-x11-fonts-misc-7.5-19.el8.noarch 2/8
Installing : xterm-331-1.el8.x86_64 3/8
Installing : ttmkfdir-3.0.9-54.el8.x86_64 4/8
Installing : xorg-x11-fonts-Type1-7.5-19.el8.noarch 5/8
Running scriptlet: xorg-x11-fonts-Type1-7.5-19.el8.noarch 5/8
Installing : tcsh-6.20.00-9.el8.x86_64 6/8
Running scriptlet: tcsh-6.20.00-9.el8.x86_64 6/8
Installing : SDL-1.2.15-32.el8.x86_64 7/8
Running scriptlet: SDL-1.2.15-32.el8.x86_64 7/8
Installing : WinCC_OA_3.17-base-rhel-0-2.x86_64 8/8
Running scriptlet: WinCC_OA_3.17-base-rhel-0-2.x86_64 8/8
Using registry file: /etc/opt/pvss/pvssInst.conf
Using registry file: /opt/WinCC_OA/DesktopUI/pvssInst.conf
Using registry file: /etc/opt/pvss/pvssInst.conf
Using registry file: /etc/opt/pvss/pvssInst.conf
Using registry file: /etc/opt/pvss/pvssInst.conf
Using registry file: /etc/opt/pvss/pvssInst.conf
Using registry file: /etc/opt/pvss/pvssInst.conf
Using registry file: /etc/opt/pvss/pvssInst.conf
Using registry file: /etc/opt/pvss/pvssInst.conf
Using registry file: /etc/opt/pvss/pvssInst.conf
Verifying : SDL-1.2.15-32.el8.x86_64 1/8
Verifying : tcsh-6.20.00-9.el8.x86_64 2/8
Verifying : ttmkfdir-3.0.9-54.el8.x86_64 3/8
Verifying : xorg-x11-fonts-Type1-7.5-19.el8.noarch 4/8
Verifying : xorg-x11-fonts-misc-7.5-19.el8.noarch 5/8
Verifying : xterm-331-1.el8.x86_64 6/8
Verifying : xterm-resize-331-1.el8.x86_64 7/8
Verifying : WinCC_OA_3.17-base-rhel-0-2.x86_64 8/8
Installed products updated.
Installed:
WinCC_OA_3.17-base-rhel-0-2.x86_64 xorg-x11-fonts-misc-7.5-19.el8.noarch SDL-1.2.15-32.el8.x86_64 tcsh-6.20.00-9.el8.x86_64 ttmkfdir-3.0.9-54.el8.x86_64
xorg-x11-fonts-Type1-7.5-19.el8.noarch xterm-331-1.el8.x86_64 xterm-resize-331-1.el8.x86_64
Complete!
除了必须安装的上述的基础安装包WinCC_OA_3.17-base-rhel-0-2.x86_64.rpm,其他可选的安装包:
CodeMeter-6.90.3699-501.x86_64.rpm
WinCC_OA_3.17-help-en-rhel-0-2.x86_64.rpm
WinCC_OA_3.17-rdb-oracle-libs12-rhel-0-2.x86_64.rpm
WinCC_OA_3.17-specialfunctions-rhel-0-2.x86_64.rpm
WinCC_OA_3.17-sqldrivers-rhel-0-2.x86_64.rpm
修改项目注册表文件
/etc/opt/pvss/pvssInst.conf
添加下面字段到末尾,并注意修改高亮字。
[Software\ETM\PVSS II\Configs\demoproj]
InstallationVersion = "3.17"
proj_path = "/home/leee/WinCC_OA_Proj/demoproj"
pvss_path = ""
PVSS_II = "/home/leee/WinCC_OA_Proj/demoproj/config/config"
InstallationDir = "/home/leee/WinCC_OA_Proj/demoproj"
设置环境变量,新建全局环境变量文件 /etc/profile.d/env_user.sh
vi /etc/profile.d/env_user.sh
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/lib:/opt/WinCC_OA/3.17/bin
export PATH=$PATH:/opt/WinCC_OA/3.17/bin
export LC_ALL=zh_CN.utf8
export TZ='Asia/Shanghai'
umask 022
重新加载环境变量
source /etc/profile.d/env_user.sh
验证是否已经生效
export | grep LD_LIBRARY_PATH
export | grep PATH
export | grep TZ
locale | grep zh_CN
新建一个语言为zh_CN.utf8的项目, 拷贝Windows或其他系统下开发的project 到/home/leee/WinCC_OA_Proj
修改<proj>/config/config文件,适配Linux的路径
[general]
pvss_path = "/opt/WinCC_OA/3.17"
proj_path = "/home/leee/WinCC_OA_Proj/demoproj"
proj_version = "3.17"
langs = "zh_CN.utf8"
使用systemctl创建Linux服务
systemctl enable winccoa@demoproj
[root@asus-redhat-1 system]# systemctl enable winccoa@demoproj
Created symlink /etc/systemd/system/multi-user.target.wants/winccoa@demoproj.service → /etc/systemd/system/winccoa @.service.
启动项目
systemctl start winccoa@demoproj
诊断项目运行
[root@asus-redhat-1 system]# systemctl status winccoa@demoproj
winccoa@demoproj.service - WinCC OA project 'demoproj'
Loaded: loaded (/etc/systemd/system/winccoa@.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2020-03-20 01:00:06 CST; 10s ago
Main PID: 11466 (WCCILpmon)
Tasks: 7 (limit: 23938)
Memory: 32.8M
CGroup: /system.slice/system-winccoa.slice/winccoa@demoproj.service
├─11466 /opt/WinCC_OA/3.17/bin/WCCILpmon -proj demoproj
├─11469 /opt/WinCC_OA/3.17/bin/lm_ip -a lockmgr -f 600
├─11470 /opt/WinCC_OA/3.17/bin/WCCILdata -PROJ demoproj -pmonIndex 1
├─11520 /opt/WinCC_OA/3.17/bin/WCCILevent -PROJ demoproj -pmonIndex 8
└─11522 /opt/WinCC_OA/3.17/bin/WCCILproxy -PROJ demoproj -pmonIndex 9
Mar 20 01:00:06 asus-redhat-1 systemd[1]: Started WinCC OA project 'demoproj'.
全部项目管理指令:
systemctl start winccoa@demoproj
systemctl stop winccoa@demoproj
systemctl enable winccoa@demoproj
systemctl disable winccoa@demoproj
systemctl restart winccoa@demoproj
systemctl status winccoa@demoproj
查看进程运行情况
ps -ef | grep WCC
[root@asus-redhat-1 system]# ps -ef | grep WCC
root 11466 1 0 01:00 ? 00:00:00 /opt/WinCC_OA/3.17/bin/WCCILpmon -proj demoproj
root 11470 11466 0 01:00 ? 00:00:01 /opt/WinCC_OA/3.17/bin/WCCILdata -PROJ demoproj -pmonIndex 1
root 11520 11466 0 01:00 ? 00:00:01 /opt/WinCC_OA/3.17/bin/WCCILevent -PROJ demoproj -pmonIndex 8
root 11522 11466 0 01:00 ? 00:00:00 /opt/WinCC_OA/3.17/bin/WCCILproxy -PROJ demoproj -pmonIndex 9
root 11525 11466 0 01:00 ? 00:00:01 /opt/WinCC_OA/3.17/bin/WCCOActrl -PROJ demoproj -pmonIndex 10 -f pvss_scripts.lst
root 11527 11466 0 01:00 ? 00:00:04 /opt/WinCC_OA/3.17/bin/WCCILsim -PROJ demoproj -pmonIndex 11
root 11560 11470 0 01:01 ? 00:00:00 /opt/WinCC_OA/3.17/bin/WCCILdatabg -bgSyncPipeDesc 20 -PROJ demoproj
查看TCP端口启动情况
ss -lntpd | grep WCC
[root@asus-redhat-1 system]# ss -lntpd | grep WCC
tcp LISTEN 0 5 [::1]:4897 [::]:* users:(("WCCILdatabg",pid=11560,fd=5),("WCCILdata",pid=11470,fd=5))
tcp LISTEN 0 5 [::1]:4998 [::]:* users:(("WCCILevent",pid=11520,fd=10))
tcp LISTEN 0 5 [::1]:4999 [::]:* users:(("WCCILpmon",pid=11466,fd=5))
tcp LISTEN 0 5 *:5678 *:* users:(("WCCILproxy",pid=11522,fd=6))
关闭防火墙
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
cat /etc/selinux/config | grep 'SELINUX=disabled'
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
getenforce
若时间不同步, 设置时钟
执行tzselect命令-->选择Asia-->选择China-->选择China -->选择 Beijing Time -->然后输入1
hwclock --set --date="03/25/2020 7:15" //(月/日/年时:分:秒)
远程控制pmon
安全机制方法一:使用IP地址白名单
添加以下代码到config文件,仅允许192.168.8.130的IP地址通过IE浏览器进行访问,端口号默认是4999。
[pmon]
localAddress = ""
ip_allow = "-empty list-"
ip_deny = "-empty list-"
ip_deny = "*"
ip_allow = "localhost"
ip_allow = "192.168.8.130"
ip_allow = "::1"
ip_allow = "127.0.0.1"
ip_allow = "::ffff:127.0.0.1"
ip_allow = "::ffff:192.168.8.130"
安全机制方法二:使用pmon管理器的用户名, 密码进行访问保护
WCCILpmon -proj "<Project Name>" -auth "<olduser>" "<oldpassword>" "<user>" "<password>"
设置一个没有用户名和密码的项目,新用户名admin密码123:
WCCILpmon -proj "demoproj" -auth "" "" "admin" "123"
方法一与方法二可以进行叠加。
对移植过来的项目的数据库进行修复
WCCILdata -proj demoproj -check
远程诊断
修改<project>/config/prog 启用web Desktop UI 服务器:将下行添加到
WCCOActrl | always | 30 | 3 | 1 |webclient_http.ctl
修改<project>/config/prog 启用web诊断 服务器:将下行添加到
WCCOActrl | always | 30 | 3 | 1 |rs_http.ctl
用其他的任意联网的OA的项目,启动一个UI, 临时用Option -data 192.168.8.108 -event 192.168.8.108连接到服务器, 修改root账号密码。
然后在任意浏览器用192.168.8.108:80端口进行登陆。