本文共 3087 字,大约阅读时间需要 10 分钟。
Lnmp环境:
[root@file ~]# cat /etc/redhat-release CentOS release 6.9 (Final)[root@file ~]# nginx -vnginx version: nginx/1.12.0[root@file ~]# mysql -Vmysql Ver 14.14 Distrib 5.6.39, for linux-glibc2.12 (x86_64) using EditLine wrapper[root@file ~]# /usr/local/php/bin/php -vPHP 5.5.36 (cli) (built: Dec 29 2017 23:03:56) Copyright (c) 1997-2015 The PHP GroupZend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologieswith Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
关闭iptables,关闭selinux
cd /var/www/html/wget https://sourceforge.net/projects/racktables/files/RackTables-0.21.1.tar.gz[root@file html]# mv RackTables-0.21.1 it[root@file html]# lsit RackTables-0.21.1.tar.gz
[root@file vhost]# cat /usr/local/nginx/conf/vhost/it.conf
server { listen 8090; server_name 192.168.10.233;; index index.html index.htm index.php; root /var/www/html/it/wwwroot; #limit_conn crawler 20; #error_page 404 location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } location /5998153NginxStatus { stub_status on; access_log off; }access_log /home/wwwlogs/access.log; }
[root@file vhost]# cat /usr/local/php/etc/php-fpm.conf
[global]pid = /usr/local/php/var/run/php-fpm.piderror_log = /data/wwwlogs/fpm-err.loglog_level = noticeevents.mechanism = epoll;process.priority = -19[www]listen = 127.0.0.1:9000listen.backlog = 65535listen.allowed_clients = 127.0.0.1listen.owner = apachelisten.group = apachelisten.mode = 0666user = apachegroup = apachepm = dynamicpm.status_path = /fpmstatuspm.max_children = 1000pm.start_servers = 48pm.min_spare_servers = 24pm.max_spare_servers = 96access.format = "%R - %u %t %T \"%m %r%Q%q\" %s %f %d"access.log = /data/wwwlogs/pool.access.logrequest_terminate_timeout = 60;request_slowlog_timeout = 2;slowlog = /data/wwwlogs/fpm-slow.log
重启服务
/etc/init.d/php-fpm restart/etc/init.d/nginx restartgrant all on racktables.* to root@localhost;grant all on racktables.* to root;grant all on racktables.* to rackuser;grant all on racktables.* to rackuser@localhost;set password for rackuser@localhost=password('djjies321');flush privileges;
MYSQL设置触发器引起的权限问题报错:
You do not have the SUPER Privilege and Binary Logging is Enabled解决办法:登陆MySQLSET GLOBAL log_bin_trust_function_creators = 1;
参考地址:打开浏览器按设置输入地址,例如:。
下一步进入到环境检测界面,如果不需要用到snmp协议和LDAP extension可以忽略该提示,如果没有问题选择继续。如下图所示:继续下一步出现报错:提示按要求建立配置文件,主要是设定racktables的数据库连接。如下图所示
touch /var/www/html/it/wwwroot/inc/secret.php
chmod 666 /var/www/html/it/wwwroot/inc/secret.php继续 继续提示报错给secret.php文件授权apache权限(原因是nginx的启动用户是apache),secret.php此文件为链接数据库的文件,所以为了安全要去掉执行权限chown apache.apache /var/www/html/it/wwwroot/inc/secret.phpchmod 400 /var/www/html/it/wwwroot/inc/secret.php
到此处安装完成
安装过程参考博文:转载于:https://blog.51cto.com/wujianwei/2090949