本科教学网云端节点系统及软件安装说明
一、安装操作系统
建议安装CentOS 6.0或以上版本,建议选择32位系统进行安装,安装时可以使用最小
化安装,分区时确保/home得到最大独立空间。
二、配置本地 yum源并安装必要插件
由于安装软件之前需要一些系统插件,从互联网或局域网yum源安装均可,这里只介
绍如何使用本地yum源。
1、将操作系统光盘的内容全部拷贝至本机硬盘某目录,然后更改/etc/yum.repo.d/下
CentOS-BASE.repo的扩展名,修改/etc/yum.repo.d/下的CentOS-Media.repo,将以下
字段进行修改:
baseurl=file:///home/CentOS/ ##这里写入光盘文件的存储目录###
gpgcheck=1
enabled=1 ##这里使用1打开本地模式######
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
2、安装nagios与nginx的支持插件
yum -y install wget gcc* pcre* openssl* popt*
三、安装nginx流媒体服务器
1、 将nginx文件夹拷到root用户文件夹下
2、 cd /root/nginx/nginx-1.0.10 , 然后预配置与编译
3、 等待编译完成执行 make && make install
4、 添加nginx服务
5、 用nginx文件夹下的nginx.conf 替换/usr/local/nginx/conf中原有的文件
cp /root/nginx/nginx.conf /usr/local/nginx/conf
./configure --prefix=/usr/local/nginx --user=stream --group=stream
-with-http_stub_status_module --with-http_flv_module
--add-module=./nginx_mod_h264_streaming-2.2.7
--add-module=./nginx-accesskey-2.0.3 --with-http_ssl_module --with-cc-op
t='-O3'
cp /root/nginx/init.d.nginx /etc/init.d/nginx
chmod +x /etc/init.d/nginx
chkconfig --add /etc/init.d/nginx
/etc/init.d/nginx start
四、安装nagios软件
1、 将nagios文件夹拷到root用户文件夹
2、创建nagios用户,密码为usoft123456
useradd nagios
passwd nagios
3、解压插件程序并编译安装
tar zvxf nagios-plugins-1.4.15.tar.gz && cd nagios-plugins-1.4.15
./configure --with-nagios-user=nagios --with-nagios-group=nagios && make && make
install
chown -R nagios:nagios /usr/local/nagios && cd ..
tar -zxvf nrpe-2.13.tar.gz && cd nrpe-2.13
./configure --enable-ssl --with-ssl-lib
make all && make install-plugin && make install-daemon && make install-daemon-config
4、安装完毕后执行
echo '/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d' >> /etc/rc.local
5、 检查nrpe是否安装正常
/usr/local/nagios/libexec/check_nrpe -H localhost
正确显示
NRPE v2.13
五、修改ssh的默认端口
打开/etc/ssh/sshd_config ,找到#Port 22 修改为Port 8899
/etc/init.d/sshd restart
六、配置防火墙
chkconfig iptables on
iptables -t filter –A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t filter –A INPUT -p icmp -m state --state NEW -m icmp --icmp-type any -j
ACCEPT
iptables -t filter –A INPUT -p tcp -m state --state NEW -m tcp --dport 8899 -j ACCEPT
iptables -t filter –A INPUT -p tcp -m state --state NEW -m tcp --dport 5666 -j ACCEPT
iptables -t filter -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
service iptables save
七、复制视频数据
视频数据统一存放在/home/wwwroot 下