进程管理工具supervisor
yum -y install supervisor
vim /etc/supervisord.conf
[include]
files = supervisord.d/*.conf
vim redmine.conf
[program:redmine]
command=rails s
directory=/home/www/redmine
user=root
启动supervisor
supervisord -c /etc/supervisord.conf
supervisorctl start redmine
supervisorctl status redmine
supervisorctl stop redmine
NFS文件共享同步
yum -y install nfs-utils rpcbind (rpc是在nfs共享是负责通知客户端)
192.168.10.150(客户端)
192.168.10.155(服务端,155将自己的硬盘共享给150)
【以下是服务端】
NFS配置
vim /etc/exports
/opt/nfs/ 192.168.10.150(rw,no_root_squash,no_all_squash,sync,anonuid=501,anongid=501)
【配置文件说明】
注:配置文件说明:
/opt/test 为共享目录
192.168.1.0/24 可以为一个网段,一个IP,也可以是域名,域名支持通配符 如: *.qq.com
rw:read-write,可读写;
ro:read-only,只读;
sync:文件同时写入硬盘和内存;
async:文件暂存于内存,而不是直接写入内存;
no_root_squash:NFS客户端连接服务端时如果使用的是root的话,那么对服务端分享的目录来说,也拥有root权限。显然开启这项是不安全的。
root_squash:NFS客户端连接服务端时如果使用的是root的话,那么对服务端分享的目录来说,拥有匿名用户权限,通常他将使用nobody或nfsnobody身份;
all_squash:不论NFS客户端连接服务端时使用什么用户,对服务端分享的目录来说都是拥有匿名用户权限;
anonuid:匿名用户的UID值,可以在此处自行设定。
anongid:匿名用户的GID值
***********************
exportfs -r(是配置文件生效)
启动NFS
service rpcbind start
service nfs start
chkconfig rpcbind on
chkconfig nfs on
一下是客户端
showmount -e 192.168.10.155 查看服务端可挂载目录
mount -t nfs 192.168.10.155:/opt/nfs /opt 将自己的 /opt 挂载到 服务端的/opt/nfs
没有报错表示挂载成功
试着在客户端的 /opt上增删文件,在服务端上查看有没有生效
转载:
ffmpeg-php扩展
https://www.cnblogs.com/jkklearn/p/6737467.html
php视频缩略图,较常用的是ffmpeg-php
1: 安装 ffmpeg
ffmpeg的下载链接 http://ffmpeg.org/download.html
解压安装包
tar -jxvf ffmpeg-x.x.tar.bz2
进入目录
cd ffmpeg-x.x
编译安装
./configure --enable-shared && make && make install
安装完成之后 执行 ffmpeg -version
如果能够出现类似下列信息,说明ffmpeg安装成功。
ffmpeg version 2.5.11 Copyright (c) 2000-2016 the FFmpeg developers
built on Apr 17 2017 16:47:15 with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)
configuration: --enable-shared
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 13.100 / 56. 13.100
libavformat 56. 15.102 / 56. 15.102
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
2 安装ffmpeg-php
官方的下载链接
https://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/
官方版本已经很久很久不更新了,我在centos 7 + php5.6&php7.1 centos6.5+php5 试了都不行。在configure完 make的时候会报错。
后来在github上找了一个版本。在centos7.2+php5.5.6 上编译安装成功 (centos7 + php7.1还是不行)
地址: git clone https://github.com/tony2001/ffmpeg-php.git
也可以访问我的百度云盘进行下载
https://pan.baidu.com/s/1skQTVlj
进入 ffmpeg-php目录 进行编译扩展
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
注意(如果make之后出现错误,那就是ffmpeg-php版本的问题,别再折腾了,换版本吧(或者降低php版本试试))。
在php的配置文件 php.ini中 添加
1
extension=ffmpeg.so
重启php。在 phpinfo()中查看有无ffmpeg信息。
有的话就OK
或者执行
1
/usr/local/php/bin/php -i |grep ffmpeg
要是有输出的话OK
参考: https://github.com/char0n/ffmpeg-php