nginx安装初始化参数(包含fastdfs-nginx-module模块要记得改配置/usr/local 改为/usr):
./configure
–prefix=/usr/local/nginx
–pid-path=/var/run/nginx/nginx.pid
–error-log-path=/var/log/nginx/error.log
–http-log-path=/var/log/nginx/access.log
–lock-path=/var/lock/nginx.lock
–sbin-path=/usr/local/nginx/sbin/nginx
–conf-path=/usr/local/nginx/conf/nginx.conf
–with-http_gzip_static_module
–with-http_ssl_module
–with-http_stub_status_module
–with-pcre
–http-client-body-temp-path=/var/tmp/nginx/client/
–http-proxy-temp-path=/var/tmp/nginx/proxy/
–http-fastcgi-temp-path=/var/tmp/nginx/fcgi/
–http-uwsgi-temp-path=/var/tmp/nginx/uwsgi
–http-scgi-temp-path=/var/tmp/nginx/scgi
–add-module=/usr/local/fastdfs-nginx-module/src/
./configure --prefix=/mnt/deployNginx --sbin-path=/mnt/deployNginx/nginx --conf-path=/mnt/deployNginx/nginx.conf --pid-path=/mnt/deployNginx/nginx.pid --with-pcre=/mnt/pcre-8.40 --with-zlib=/mnt/zlib-1.2.11 --add-module=/mnt/nginx-upstream-fair-master --with-http_ssl_module
./configure --prefix=/mnt/upstreamNginx --sbin-path=/mnt/upstreamNginx/nginx --conf-path=/mnt/upstreamNginx/nginx.conf --pid-path=/mnt/upstreamNginx/nginx.pid --with-pcre=/mnt/pcre-8.40 --with-zlib=/mnt/zlib-1.2.11 --add-module=/mnt/ngx_cache_purge-2.3 --add-module=/mnt/nginx-upstream-fair-master --with-http_ssl_module
tracker配置:
1、配置base_path
2、port(如果不改变不配,http_server要关注有时需要改一下我用了9999,后面看看会不会和别的冲突)
3、启动
4、创建base_path目录
storeage配置:
1、配置base_path
2、port(如果不改变23000,不要配置)
3、tracker_server配置
4、store_path0 = /mnt/fastDFS/storeage
5、http_server_port = (要和nginx一样)
6、创建base_path目录
client.conf配置
1、store_path0
2、tracker_server
fastDFS上传测试:
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /mnt/11.png
fastDFS 开通端口tracker 22122
开通端口 nginx 9999
安装fastdfs-nginx-module
安装nginx
nginx启动 /usr/local/nginx/sbin/nginx
设置开机启动
vim /etc/rc.d/rc.local
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
/usr/local/nginx/sbin/nginx
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
安装openssl模块
yum -y install openssl openssl-devel
查看fdfs的状态:
netstat -anp|grep fdfs
启动tracker和storage
/etc/init.d/fdfs_trackerd restart
/etc/init.d/fdfs_storaged restart
查看是否启动成功:
ps -ef | grep fdfs_trackerd
ps -ef | grep fdfs_storaged
设置开机启动
防火墙操作:
1、firewalld的基本使用
启动: systemctl start firewalld
查看状态: systemctl status firewalld
停止: systemctl disable firewalld
禁用: systemctl stop firewalld
查看所有打开的端口: firewall-cmd --zone=public --list-ports
更新防火墙规则: firewall-cmd --reload
添加端口
firewall-cmd --zone=public --add-port=9999/tcp --permanent (–permanent永久生效,没有此参数重启后失效)
重新载入
firewall-cmd --reload
查看
firewall-cmd --zone= public --query-port=80/tcp
删除
firewall-cmd --zone= public --remove-port=80/tcp --permanent