问题: 安装完成后,会在 确保: 修改 翻看cacti源码后,发现 好家伙!原来在这限制了,按照lnmp>=1.4修改: 然后 然后1. 配置vmware CentOS7
1. 更换阿里源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak&&wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo&&sed -i 's/http:/https:/g' /etc/yum.repos.d/CentOS-Base.repo
2. 解决安装open-vm-tools后粘贴复制失效的问题
由于open-vm-tools在反复卸载和安装后,仍然不能复制、粘贴。所以换为vmware自带的增强工具,但这时遇到了"重新安装 Vmware Tools" 是灰色的,无法点击。
解决:
VMWare TOOLS
的挂载,将里面的VMwareTools-xxxx
复制出来,解压后,运行安装文件。2. 基础环境配置
1. 配置lnmp环境
wget http://soft1.vpser.net/lnmp/lnmp1.4-full.tar.gz&&tar zxf lnmp1.4-full.tar.gz&&cd lnmp1.4-full&&./install.sh lnmp
/usr/local/
目录下生成php、mysql、nginx的目录。
web目录位于/home/wwwroot/
, 以www
用户权限启动。2. 安装rrdtool和net-snmp
yum install rrdtool -y &&yum install -y net-snmp net-snmp-utils
RRDtool 1.3+, 1.5+ recommended
NET-SNMP 5.5+
3. 下载cacti-1.2.16
wget https://www.cacti.net/downloads/cacti-1.2.16.tar.gz -O cacti.tar.gz&&tar zxvf cacti.tar.gz&&mv cacti-1.2.16/ /home/wwwroot/default/cacti/
3. 安装过程中遇到的问题
1. php memory_limit 默认 128M
/usr/local/php/etc/php.ini
的 memory_limit
为 800M2. 解决 php cli "PHP CLI NO" 的问题
lib/utility.php#1556行
:$php = cacti_escapeshellcmd(read_config_option('path_php_binary', true));
$php_file = cacti_escapeshellarg($config['base_path'] . '/install/cli_check.php') . ' optionals';
$json = shell_exec($php . ' -q ' . $php_file);
$opt = @json_decode($json, true);
read_config_option('path_php_binary', true)
会一直返回null,但本地确实存在/usr/bin/php和/bin/php
搞过安全的都知道open_basedir
和disable_functions
会限制命令执行,查看phpinfo():disable_functions 为空
open_basedir 为 /home/wwwroot/default:/tmp/:/proc/
chattr -ai /home/wwwroot/default/.user.ini&&rm -f /home/wwwroot/default/.user.ini
vim /usr/local/nginx/conf/fastcgi.conf
将 fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/
注释掉
3. 安装ldap扩展
yum install openldap openldap-devel -y
cp -frp /usr/lib64/libldap* /usr/lib/
cd /opt/workspace1/lnmp1.4-full/src/php-5.6.31/ext/ladp
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-ldap
make&&make install
vim /usr/local/php/etc/php.ini
添加extension=ldap.so
4. 安装gmp扩展
cd /opt/workspace1/lnmp1.4-full/src/php-5.6.31/ext/gmp
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-ldap
make&&make install
vim /usr/local/php/etc/php.ini
添加extension=gmp.so
重启php-fpm:lnmp php-fpm restart
5. Your MySQL TimeZone database is not populated. Please populate this database before proceedin
cd /usr/local/mysql/bin&&./mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
6. 目录 Not Writable
chown -R www:www /home/wwwroot/default/cacti/*
Comments NOTHING