Rootop 服务器运维与web架构

2015-04-17
发表者 Venus
FMS配置文件说明 flash media server已关闭评论

FMS配置文件说明 flash media server

FMS(flash media server)配置文件说明 ,转自网络。

fms.ini是把各个层级xml配置文件中的关键部分提取出来放到一起,在实际使用时,这些配置是替换到对应的配置文件中的参数位置。

###############################################################
# 该部分包含在 Server.xml 中的配置参数#
###############################################################

# 服务器admin管理用户名
# For example:
# SERVER.ADMIN_USERNAME = foo
#
SERVER.ADMIN_USERNAME = admin

# admin管理用户的密码
# For example:
# SERVER.ADMIN_PASSWORD = bar
#
SERVER.ADMIN_PASSWORD = admin

# Flash Media Admin Server 监听的IP地址和端口
# For example:
# SERVER.ADMINSERVER_HOSTPORT = :1111
#
SERVER.ADMINSERVER_HOSTPORT = :1111

# 运行进程的用户ID(Linux Only)
# For example:
# SERVER.PROCESS_UID = 500
#
SERVER.PROCESS_UID =

# 进程运行的组ID (Linux Only)
# For example:
# SERVER.PROCESS_GID = 500
#
SERVER.PROCESS_GID =

# Flash Media Server的序列号
# For example:
# SERVER.LICENSEINFO = FMD200-XXXXX-XXXXX-XXXXX
#
SERVER.LICENSEINFO = 1373-5465-5574-9110-6240-7230

# LIVE_DIR 表示示例中直播(live)应用目录的完全路径,
# 用来存储所有服务器记录的所有直播流
# For example:
# LIVE_DIR = \applications\live
#
LIVE_DIR = D:\Program Files\Adobe\Flash Media Server 3.5\applications\live

# VOD_COMMON_DIR 表示示例中点播(vod)应用目录的全路径,
# 用于存储流式点播视频和按进度下载的.flv/.mp3文件
# 文件存储在该目录可以按流式也可以按进度下载
# 注意: 如果你使用默认安装的apache作为web服务器,
# 如果你修改 VOD_COMMON_DIR, 请同时修改httpd.conf中的 document root
#
# For example:
# VOD_COMMON_DIR = \webroot\vod
#
VOD_COMMON_DIR = D:\Program Files\Adobe\Flash Media Server 3.5\webroot\vod
MY_COMMON_VOD_DIR=D:\Program Files\Adobe\Flash Media Server 3.5\webroot\myVod

# VOD_DIR 表示点播应用的目录全路径,仅存储流式点播视频,
# 存储在该目录的.flv/.mp3是不能够按进度下载的
#
# For example:
# VOD_DIR = \applications\vod\media
#
VOD_DIR = D:\Program Files\Adobe\Flash Media Server 3.5\applications\vod\media
MY_VOD_DIR = D:\Program Files\Adobe\Flash Media Server 3.5\applications\myVideo\media

# FLV缓存的上限,MB为单位,默认500MB
# The default is 500MB.
#
SERVER.FLVCACHE_MAXSIZE=500

# 是否随FMS一起启动和停止HTTP服务
#
#
SERVER.HTTPD_ENABLED = true

################################################################
# 该部分包含在 Adaptor.xml 中的配置参数#
################################################################

# FMS监听的IP地址和端口
# For example:
# ADAPTOR.HOSTPORT = :1935,80
#
ADAPTOR.HOSTPORT = :1935,8080

# FMS代理未知HTTP请求转发到的IP地址和端口,留空表示禁止代理
# unknown HTTP requests to. Leave empty to disable proxying.
# 如果没有地址,表示为本机端口.
# For example:
# HTTPPROXY.HOST = webfarm.example.com:80
#
HTTPPROXY.HOST = :8134

##############################################################
# 该部分包含在 Vhost.xml 中的配置参数#
##############################################################

# 虚拟机的应用目录
# For example:
# VHOST.APPSDIR = C:\myapps
#
VHOST.APPSDIR = D:\Program Files\Adobe\Flash Media Server 3.5\applications

####################################################################
# 该部分包含在Application.xml 中的配置参数#
####################################################################

# 脚本加载路径,以分号分隔的列表
# For example:
# APP.JS_SCRIPTLIBPATH = C:\scripts;C:\Program Files\Foo\scripts
#
APP.JS_SCRIPTLIBPATH = D:\Program Files\Adobe\Flash Media Server 3.5\scriptlib

###############################################################
# 该部分包括在 Logger.xml 中的配置参数#
###############################################################

LOGGER.LOGDIR =

####################################################################
# 该部分包括在 Users.xml 中的配置参数#
####################################################################

# 开启或者禁止使用HTTP请求来执行管理命令
# true为开启,否则为禁止。实际针对服务器
# 管理员或者虚拟机管理用户的命令配置在Users.xml中设置
#

USERS.HTTPCOMMAND_ALLOW = true

2015-04-14
发表者 Venus
使用autofs自动挂载cifs共享已关闭评论

使用autofs自动挂载cifs共享

自动挂载器是一个监视目录的守护进程,并在目标子目录被引用时,自动执行预定义的挂载。
自动挂载器由autofs服务脚本管理。

安装:
[root@Master ~]# yum install -y autofs
[root@Master ~]# vim /etc/auto.master  #添加红色部分
#
# Sample auto.master file
# This is a ‘master’ automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
/misc /etc/auto.misc

/mnt /etc/auto.nas –timeout 60  #必须以auto.开头
#
# NOTE: mounts done from a hosts map will be mounted with the
# “nosuid” and “nodev” options unless the “suid” and “dev”
# options are explicitly given.
#
/net -hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master

其中第一部分指定一个安装点为/mnt,第二部分指定该挂接点的配置文件为/etc/auto.nas,第三部分指定所挂接的文件系统在空闲60秒后自动被卸载。

编辑/etc/auto.nas:

nas -fstype=cifs,rw,noperm,user=administrator,pass=admin@123 ://192.168.0.241/VKTVOD

参数解释:
其中”nas”列,指将//192.168.0.241/VKTVOD挂载到/mnt/nas。其它为指定文件系统,身份验证。

重启autofs服务:
[root@Master ~]# service autofs restart

输入命令ls /mnt/nas,autofs会自动检测cifs路径,会自动将其挂载到/mnt/nas中,这样ls就会列出其中的内容。如果在60秒内没有再次访问/mnt/nas,autofs会自动将/mnt/nas卸载。

2015-04-13
发表者 Venus
linux下AMS5.0安装及下载地址已关闭评论

linux下AMS5.0安装及下载地址

这里下载的版本为AMS5.07
下载地址:
http://download.macromedia.com/pub/adobemediaserver/5_0_7/AdobeMediaServer5_x64.tar.gz

根据手册支持rhel和centos 6.3_x64位,我这里系统版本为centos6.6_x64

解压安装:
序列号自行百度。
提示信息略过。

———– Install Action Summary ———–

Installation directory = /opt/adobe/ams

Adobe Media Server Port = 1935
Adobe Media Admin Server Port = 1111
Interface (IP address) AMS will listen on = auto-detect

Apache Install = Yes

Administrative username = admin
Administrative password = (suppressed)

service owner = ams

service user = ams
service group = ams

Run as daemon = Yes
Start Adobe Media Server = Yes

Proceed with the installation? (y/n/q): y

管理服务:
[root@Master ~]# service ams start|stop|restart #跟fms4.5一样可以管理主服务、fms管理、apache服务状态

[root@Master ~]# /opt/adobe/ams/amsmgr server ams start #启动主服务、apache服务(1935\80\8134)
[root@Master ~]# /opt/adobe/ams/amsmgr adminserver start #启动mfs管理服务(1111)

默认也是所有ams服务开机启动

fms4.5和ams5.0管理方式一样,只是fms变为ams。

在centos7中也安装成功,只是报平台警告,忽略。测试了一下没发现什么问题。
在centos7中,系统中缺少一个killall命令,ams管理服务脚本中会用到这个命令,单独安装 psmisc 这个包。

ams5.0中apache也是使用的2.2版本。

2015-04-13
发表者 Venus
linux下fms4.5安装及下载地址已关闭评论

linux下fms4.5安装及下载地址

官方下载地址:http://download.macromedia.com/pub/flashmediaserver/updates/4_5_7/Linux_Release_x64/FlashMediaServer4.5_x64.tar.gz
这一版本为FMS4.5.7

根据官方文档说支持 centos和rhel 5.5_x64位。在centos6下也安装成功,会有个警告。可以加 ./installFMS -platformWarnOnly 参数忽略。
解压,安装。

[root@Master FMS_4_5_7_r6008]# ./installFMS
ERROR: A required package, libcap, was not found on your Linux x86_64 RedHat.
Please install required package and run Adobe Flash Media Server installer again.

[root@Master FMS_4_5_7_r6008]# yum install -y compat-libcap1 #提示缺少一个包
再次执行安装。会提示输入序列号,百度搜个,然后提示默认安装路径,是否安装apache等等信息,直接一路回车即可。

提示信息略过…

———– Install Action Summary ———–

Installation directory = /opt/adobe/fms  #安装路径

Adobe Flash Media Server Port = 1935  #rtmp默认端口
Adobe Flash Media Admin Server Port = 1111  #fms管理端口
Interface (IP address) FMS will listen on = auto-detect #监听地址

Apache Install = Yes  #安装自带的apache

Administrative username = admin  #fms管理用户
Administrative password = (suppressed)  #fms管理用户密码,这里不显示

service owner = fms

service user = fms  #以fms用户运行
service group = fms #以fms组运行

Run as daemon = Yes #守护进程
Start Adobe Flash Media Server = Yes #开机启动

Proceed with the installation? (y/n/q): y

管理服务:

[root@Master ~]# service fms start|stop|restart
通过这一条命令可以管理fms、fmsAdministration、apache的运行状态。默认已经设置为开机启动

文档中指出更详细的执行方式:
go to the installation directory (default is
/opt/adobe/fms/). Use the command “./fmsmgr server fms start” to start Flash Media
Server and “./fmsmgr adminserver start” to start Flash Media Administration Server.

[root@Master ~]# /opt/adobe/fms/fmsmgr server fms start     #FMS主服务
[root@Master ~]# /opt/adobe/fms/fmsmgr adminserver start #FMS管理服务
没看到有apache的独立管理命令。
ps看到启动参数为:
/opt/adobe/fms/Apache2.2/bin/httpd -f ./conf/httpd.conf -d /opt/adobe/fms/Apache2.2 -k start

2015-04-10
发表者 Venus
Cisco WS-C3750G-48TS 交换机恢复密码已关闭评论

Cisco WS-C3750G-48TS 交换机恢复密码

把交换机断电,按住前面板的mode键,加电。过个10秒左右松开按键(有的资料说直到sys灯不闪动为止,即常亮状态)

进入到交换机的底层模式switch:

键入 flash_init 初始化flash文件系统:
switch: flash_init


键入 dir flash 查看交换机配置文件:
switch: dir flash:    #注意是冒号结尾


键入 rename flash:config.text flash:config.old 备份交换机原始配置文件:
switch: rename flash:config.text flash:config.old


查看是否修改成功:
switch: dir flash:

键入 boot 启动交换机:
switch: boot


在启动到 Would you like to enter the initial configuration dialog? [yes/no]: no 这个地方选no

经过以上,交换机恢复到出厂设置。

恢复之前的配置信息:
先恢复之前的配置文件
Switch>enable
Switch#dir
Directory of flash:/

2 -rwx 5527 Sep 25 2014 00:28:11 +00:00 config.old
3 -rwx 27 Sep 25 2014 00:28:11 +00:00 private-config.text
4 -rwx 616 Mar 1 1993 00:02:41 +00:00 vlan.dat
5 drwx 192 Mar 1 1993 00:08:53 +00:00 c3750-ipbase-mz.122-25.SEB4

32514048 bytes total (25398784 bytes free)

Switch#rename flash:config.old flash:config.text
Destination filename [config.text]?   #直接回车
Switch#

再恢复配置文件信息到DRAM存储器:
Switch#copy flash:config.text system:running-config
Destination filename [running-config]?

5527 bytes copied in 0.637 secs (8677 bytes/sec)
Switch#

再次show run 就可以看到之前的配置信息了。
Switch#show running-config

因为恢复了之前的配置信息,要修改密码:
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#no enable secret
Switch(config)#enable secret 123
Switch(config)#exit

将配置写入nvram:
Switch#write memory

完成。