设为首页 收藏本站
查看: 575|回复: 0

[经验分享] 2012实战之LAMP+memcached+cacti

[复制链接]

尚未签到

发表于 2018-6-10 11:24:43 | 显示全部楼层 |阅读模式
我有个不好的习惯,那就是没有及时的做好工作记录。导致我多次遇到同样的问题时,总是记得我遇到过同样的问题且不止一次的这样,但都忘了当时是怎么解决的了。我想是该认真的记录自己所遇到的问题的处理情况了。

LAMP+memcached+cacti

所有的包都是当时最新稳定版本且已经下载到/usr/local/src/目录下面
cd /usr/local/src/
现在逐个开始安装软件包:
#################################################################################################  
apache的安装    http-2.4.1.tar.gz

tar zxvf http-2.4.1.tar.gz
cd http-2.4.1
./configure -prefix=/usr/apahce -enable-so -enable-rewrite \
-with-mpm=worker
问题来了,在编译的时候出现了错误:
Configuring Apache Portable Runtime library ...

checking for APR... no
configure: error: APR not found.  Please read the documentation.
看一下 rpm -qa | grep apr如下
[root@serv-169 httpd-2.4.1]# rpm -qa | grep apr
apr-util-ldap-1.3.9-3.el6.x86_64
apr-1.3.9-3.el6.x86_64
apr-util-1.3.9-3.el6.x86_64
都在的,为什么呢,网上好像说是这个版本太低的原因,我看有可能。我用的
apache是http-2.4.1.tar.gz 现在最新稳定版
解决办法:
下载最新的APR相关软件包
apr-1.4.6.tar.gz
http://apache.etoak.com//apr/apr-1.4.6.tar.gz
http://apache.etoak.com//apr/apr-util-1.4.1.tar.gz
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz

tar zxvf apr-1.4.6.tar.gz
cd apr-1.4.6
./configure --prefix=/usr/apr
make
make test
make install

apr-util-1.4.1.tar.gz

tar zxvf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1
./configure --prefix=/usr/apr-util -with-apr=/usr/apr/bin/apr-1-config
make
make install

现在再来编译apache
./configure --prefix=/usr/apache --with-apr=/usr/apr \
--with-apr-util=/usr/apr-util/ \
-enable-so -enable-rewrite \
--with-mpm=worker
make
make install
一路顺畅,好的。接下来开始检查安装情况
1.查看安装目录    确认在/usr下面
2.查看编译模块:
查看静态模块
[root@serv-169 apache]# bin/apachectl -l
Compiled in modules:
  core.c
  mod_so.c
  http_core.c
  worker.c
查看动态模块
[root@serv-169 apache]# ls modules/
httpd.exp               mod_dav.so                  mod_proxy_ftp.so
mod_access_compat.so    mod_dbd.so                  mod_proxy_http.so
mod_actions.so          mod_deflate.so              mod_proxy_scgi.so
mod_alias.so            mod_dir.so                  mod_proxy.so
mod_allowmethods.so     mod_dumpio.so               mod_ratelimit.so
mod_auth_basic.so       mod_env.so                  mod_remoteip.so
mod_auth_digest.so      mod_expires.so              mod_reqtimeout.so
mod_auth_form.so        mod_ext_filter.so           mod_request.so
mod_authn_anon.so       mod_file_cache.so           mod_rewrite.so
mod_authn_core.so       mod_filter.so               mod_sed.so
mod_authn_dbd.so        mod_headers.so              mod_session_cookie.so
mod_authn_dbm.so        mod_include.so              mod_session_dbd.so
mod_authn_file.so       mod_info.so                 mod_session.so
mod_authn_socache.so    mod_lbmethod_bybusyness.so  mod_setenvif.so
mod_authz_core.so       mod_lbmethod_byrequests.so  mod_slotmem_shm.so
mod_authz_dbd.so        mod_lbmethod_bytraffic.so   mod_socache_dbm.so
mod_authz_dbm.so        mod_lbmethod_heartbeat.so   mod_socache_memcache.so
mod_authz_groupfile.so  mod_log_config.so           mod_socache_shmcb.so
mod_authz_host.so       mod_log_debug.so            mod_speling.so
mod_authz_owner.so      mod_logio.so                mod_ssl.so
mod_authz_user.so       mod_mime.so                 mod_status.so
mod_autoindex.so        mod_negotiation.so          mod_substitute.so
mod_buffer.so           mod_proxy_ajp.so            mod_unique_id.so
mod_cache_disk.so       mod_proxy_balancer.so       mod_unixd.so
mod_cache.so            mod_proxy_connect.so        mod_userdir.so
mod_cgid.so             mod_proxy_express.so        mod_version.so
mod_dav_fs.so           mod_proxy_fcgi.so           mod_vhost_alias.so
我所指定的模块已经被编译出来:
mod_rewrite.so   worker.c
3.检查是否能正常运行:
[root@serv-169 apache]# bin/apachectl -t
AH00558: httpd: Could not reliably determine the server's fully qualified domain name,
using ::1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
这里有个小问题,提示没有找到相应的域名服务器。在配置文件的187行的ServerName改为如下:
    186 #
    187 ServerName localhost:80
    188
    189 #
再来执行试试
[root@serv-169 apache]# bin/apachectl -t
Syntax OK-
现在已经正确,正常情况下应该能启动了
[root@serv-169 apache]# bin/apachectl
[root@serv-169 apache]#
好像没有问题   看看进程
[root@serv-169 apache]# ps aux | grep httpd
root      8310  0.0  0.1  73272  2540 ?        Ss   14:51   0:00 /usr/apache/bin    /httpd
daemon    8311  0.0  0.2 417532  4528 ?        Sl   14:51   0:00 /usr/apache/bin    /httpd
daemon    8312  0.0  0.2 417532  4532 ?        Sl   14:51   0:00 /usr/apache/bin    /httpd
daemon    8313  0.0  0.2 483068  4536 ?        Sl   14:51   0:00 /usr/apache/bin    /httpd
root      8400  0.0  0.0 103152   816 pts/0    S+   14:53   0:00 grep httpd
[root@serv-169 apache]#
已经正常启动起来了!在IE中显示
It works!

#################################################################################################
mysql的安装    mysql-5.5.22.tar.gz
http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz
groupadd mysql
useradd -g mysql mysql
tar zxvf mysql-5.5.22.tar.gz
cd mysql-5.5.22/

cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql \
-DMYSQL_UNIX_ADDR=/var/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all -DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/data/mysql -DMYSQL_USER=mysql

make
make install

chmod +w /usr/mysql
chown -R mysql:mysql /usr/mysql

ln -s /usr/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18


mkdir -p /data/mysql/
mkdir -p /data/mysql/data/
mkdir -p /data/mysql/log/
chown -R mysql:mysql /data/mysql/

cp support-files/my-huge.cnf /etc/my.cnf
(这里的配置文件适用于1G-2G内存的服务器,可以内存大小来选用配置文件。)
cp support-files/mysql.server /etc/init.d/mysqld

初始化安装
/usr/mysql/scripts/mysql_install_db \
--defaults-file=/etc/my.cnf \
--basedir=/usr/mysql \
--datadir=/data/mysql/data \
--user=mysql

加入开机启动
chmod +x /etc/init.d/mysqld
vi /etc/init.d/mysqld(修改为以下内容)
basedir=/usr/mysql
datadir=/data/mysql/data

chkconfig --add mysqld
chkconfig --level 345 mysql on

service mysqld start

[root@serv-169 ~]# service mysqld start
Starting MySQL...                                          [  OK  ]
[root@serv-169 ~]#
成功启动

#################################################################################################
apache整合php安装

整合的方式有几种,最常用的是用mod_so.c调用libphp5.so,也可以像nginx整合php一样,
使用php-cgi。这里我用的是apache以so方式调用PHP,从而实现整合的目的。
实现的过程是这样:
1.如果用户访问的是静态页面(如html文件),由apache自己处理。
2.如果用户请求的是动态内容,则匹配Apache配置文件httpd.conf的项
“AddType application/x-httpd-php.php”,调用php解析器进行处理。对应的apache主配置文件httpd.conf,
就是“LoadModule php5_module modules/libphp5.so”

安装PHP前需要先安装一些组件,使其能够让PHP支持更多的图片类型/格式,以及至此登陆验证码显示一类的
功能。zlib、freetype、jpegsrc、libpng以及GD。安装顺序是先安装前面的四个包,在安装GD。这些源代码包
我都已经下载到/usr/local/src/目录下了。

zlib 安装   zlib-1.2.5.1.tar.gz

tar zxvf zlib-1.2.5.1.tar.gz
cd zlib-1.2.5.1

./configure --prefix=/usr/zlib
make
make install

libpng 安装   libpng-1.5.10.tar.gz

tar zxvf libpng-1.5.10.tar.gz
cd libpng-1.5.10

./configure --prefix=/usr/libpng
make
make install

freetype 安装   freetype-2.4.9.tar.gz

tar zxvf freetype-2.4.9.tar.gz
cd freetype-2.4.9

./configure --prefix=/usr/freetype
make
make install

jpeg 安装   jpegsrc.v8d.tar.gz

tar zxvf jpegsrc.v8d.tar.gz
cd jpegsrc-8d

./configure --prefix=/usr/jpeg
make
make install

GD 安装   gd-2.0.35.tar.gz

安装gd要稍微复杂一点儿,需要在正式安装前做头文件的链接操作。
不然可能会出错。

ln -s /usr/libpng/include/pngconf.h /usr/include
报错
ln: creating symbolic link `/usr/include/pngconf.h': File exists
这个文件已经存在,去看看
[root@serv-169 LAMP+memcahed+catci]# ls -l /usr/include/png*
lrwxrwxrwx. 1 root root 18 Apr  5 22:15 /usr/include/pngconf.h -> libpng12/pngconf.h
lrwxrwxrwx. 1 root root 14 Apr  5 22:15 /usr/include/png.h -> libpng12/png.h
却是存在,因为装系统或者用Yum命令安装的时候产生的。现在我把它删了重新添加用源代码安装
的链接。
[root@serv-169 LAMP+memcahed+catci]# rm -rf /usr/include/pngconf.h
[root@serv-169 LAMP+memcahed+catci]# rm -rf /usr/include/png.h

重新添加链接头文件:
ln -s /usr/libpng/include/pngconf.h /usr/include
ln -s /usr/libpng/include/png.h /usr/include

正是安装gd包
tar zxvf gd-2.0.35.tar.gz
cd gd/2.0.35/

./configure --prefix=/usr/gd --with-png=/usr/libpng\
--with-freetype=/usr/freetype --with-jpeg=/usr/jpeg
注意这里不要加zlib的路径,加上会提示一个参数警告消息。

make
make install

make出错:
/usr/include/png.h:434:24: error: pnglibconf.h: No such file or directory
解决方法
vi /usr/include/png.h  到434行修改为下面格式就可以了
#include "/usr/libpng/include/pnglibconf.h"

需要的组件都已经安装完毕,接下来就是安装php了。

php 安装  php-5.4.0.tar.gz

tar zxvf php-5.4.0.tar.gz
cd php-5.4.0

./configure --prefix=/usr/php \
--with-gd=/usr/gd --with-apxs2=/usr/apache/bin/apxs \
--enable-mbregex --enable-bcmath \
--with-mysql=/usr/mysql --with-zlib-dir=/usr/zlib \
--enable-mbstring=all --with-pdo-mysql \
--with-mysql-sock=/var/mysql --with-freetype-dir=/usr/freetype

make
make install

make的时候又出错了(这里说下,报错的时候在文本模式下显示乱码,我使用了LANG=C命令将乱码变成中文。)

/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_stream_putc':
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:51: error: 'struct gdIOCtx' has no member named 'data'
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_stream_putbuf':
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:58: error: 'struct gdIOCtx' has no member named 'data'
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_stream_ctxfree':
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:67: error: 'struct gdIOCtx' has no member named 'data'
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:68: error: 'struct gdIOCtx' has no member named 'data'
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:69: error: 'struct gdIOCtx' has no member named 'data'
In file included from /usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd.c:103:
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_output_ctx':
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:153: error: 'gdIOCtx' has no member named 'data'
make: *** [ext/gd/gd.lo] Error 1

问题真是一大堆,这个问题好像是处在GD上,我先试着不指定GD的路径

./configure --prefix=/usr/php \
--with-gd --with-apxs2=/usr/apache/bin/apxs \
--enable-mbregex --enable-bcmath \
--with-mysql=/usr/mysql --with-zlib-dir=/usr/zlib \
--enable-mbstring=all --with-pdo-mysql \
--with-mysql-sock=/var/mysql --with-freetype-dir=/usr/freetype

make
这下虽然没有上边那个错误,但是新的错误又来了。

could not read symbols: Bad value
经网上一查,如果系统是64位,需要用64位元的方法进行编译zlib如下:
[root@serv-169 usr]# CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/zlib

[root@serv-169 usr]# make

[root@serv-169 usr]# make install

[root@serv-169 usr]# make clean
现在在来编译php试试
make
make install
已经成功编译安装。

[root@serv-169 php-5.4.0]# cp php.ini-development /usr/php/lib/php.ini

验证安装
这里我主要看与apache相关联的情况
1.在/usr/apache/modules目录下自动生成文件libphp5.so
[root@serv-169 modules]# ls -l lib*
-rwxr-xr-x. 1 root root 29063952 Apr 11 12:08 libphp5.so
2.在apache的主配置文件/usr/apache/conf/httpd.conf中自动插入一行

LoadModule php5_module        modules/libphp5.so

3.更全面的检查:
(1)在默认的apache根目录创建文件/usr/local/apache/htdocs/test.php,其内容为:

[root@serv-169 htdocs]# cat test.php
<?php

PHPinfo();

?>

(2)修改主配置文件。在文件最后增加如下代码:

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

(3)保存配置文件后,检查该文件语法是否正确
[root@serv-169 conf]# /usr/apache/bin/apachectl -t
Syntax OK
这里没有问题,那么启动apache服务,/usr/apache/bin/apachectl

(4)检查其运行状况,包括进程、监听情况等。

(5)在其他计算机的浏览器地址栏输入http://IP/test.php,查看php所支持的模块加载情况。

#################################################################################################


Memcached 安装

安装步骤:

先安装 libevent,再安装 Memcached主程序

libevent 安装    libevent-2.0.18-stable.tar.gz

tar zxvf sources/libevent-2.0.18-stable.tar.gz
cd libevent-2.0.18-stable/

./configure --prefix=/usr/libevent
make
make install

Memcached 安装    memcached-1.4.13.tar.gz  

tar zxvf sources/memcached-1.4.13.tar.gz
cd memcached-1.4.13/

./configure --prefix=/usr/memcached --with-libevent=/usr/libevent/
make
make install
服务器端安装结果测试:
[root@serv-169 usr]# /usr/memcached/bin/memcached -d -m 512 -u root

查看进程
[root@serv-169 usr]# ps aux | grep memcached
root     21976  0.0  0.0 331016  1232 ?        Ssl  16:30   0:00 /usr/memcached/bin/memcached -d -m 512 -u root
root     21995  0.0  0.0   6288   640 pts/0    S+   16:33   0:00 grep memcached
服务器端已经启动。
关闭memcached :pkill memcached

启动服务器端,telnet连接测试一下效果:
telnet 192.168.0.169 11211

Memcached 和 PHP 结合使用

php Memcached 扩展 安装   memcache-2.2.6.tgz

[root@serv-169 LAMP+memcahed+catci]# tar zxf sources/memcache-2.2.6.tgz
[root@serv-169 LAMP+memcahed+catci]# cd memcache-2.2.6/
[root@serv-169 memcache-2.2.6]# /usr/php/bin/phpize
[root@serv-169 memcache-2.2.6]#  ./configure  -enable-memcache --prefix=/usr/memcache \
--with-php-config=/usr/php/bin/php-config --with-zlib-dir=/usr/zlib

[root@serv-169 memcache-2.2.6]# make
报错了
/usr/local/src/LAMP+memcahed+catci/memcache-2.2.6/memcache.c:2232: error: too few arguments to function 'zend_list_insert'
/usr/local/src/LAMP+memcahed+catci/memcache-2.2.6/memcache.c:2250: error: too few arguments to function 'zend_list_insert'
make: *** [memcache.lo] Error 1
这个是什么原因呢,回去看看configure的时候有什么警告没。这里果然有个警告:
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
提示缺少re2c,到网上去找一个装上(注意这里用的是64位的,在下载的时候要根据你的操作系统位数来选择)。
可用地址:http://pkgs.repoforge.org/re2c/re2c-0.13.5-1.el6.rf.x86_64.rpm
装上以后configure的时候就不会报错了,可以看到这样的提示:
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)

make

真是郁闷呀,又报错了。还是同样的错误,说明刚才那个报错根本不关re2c的事也有可能。再到网上找了一下看到
有篇文章也是跟我遇到的情况一样,我把他的方法记录下来先试试。
1.下载地址  http://svn.php.net/viewvc/pecl/memcache/trunk/
把memcache.c下载下来覆盖2.2.6的里的memcache
2. 再按phpize编译就好了

[root@serv-169 memcache-2.2.6]# /usr/php/bin/phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525


真是那么回事,这下已经成功了。

[root@serv-169 memcache-2.2.6]# make install
Installing shared extensions:     /usr/php/lib/php/extensions/no-debug-zts-20100525/
现在回到正常的操作流程上来,该执行修改php.ini文件如下:

添加
[memcache]
extension = memcache.so


重启apache服务,查看memcache是否被现实出来。

#################################################################################################


cacti安装,在安装cacti前先安装rrdtool(用于图形的绘画),Net-snmp(用于数据的获取).


rrdtool安装  rrdtool-1.4.7.tar.gz

tar zxvf rrdtool-1.4.7.tar.gz
cd rrdtool-1.4.7

./configure --prefix=/usr/rrdtool
make
make install

net-snmp安装  net-snmp-5.7.1.tar.gz

tar zxvf net-snmp-5.7.1.tar.gz
cd net-snmp-5.7.1

./configure --prefix=/usr/net-snmp
make
make install

这里make的时候错误提示为:
no rule to make target '../sedscript',needed by 'agentxtrap.1' stop.
make *** [installsubdirs] error 1
解决方法,下载net-snmp-5.0.9-2.90.1.1.src.rpm安装后,重新编译安装net-snmp.

cp EXAMPLE.conf /usr/net-snmp/share/snmp/snmpd.conf

启动snmpd
/usr/net-snmp/sbin/snmpd -c /usr/net-snmp/share/snmp/snmpd.conf
检查是否正常,执行/usr/net-snmp/bin/snmpwalk -c public -v2c 127.0.0.1
如果返回信息则表示正常。

cacti安装 cacti-0.8.8.tar.gz

tar zxvf cacti-0.8.8.tar.gz
cd cacti-0.8.8
mv cacti-0.8.8/ /usr/apache/htdocs/
mysql

创建数据库
mysql> create database cacti;
Query OK, 1 row affected (0.03 sec)

创建用户和密码
mmysql> insert into mysql.user(host,user,password)values('localhost','cacti',password('cacti123'));
Query OK, 1 row affected, 3 warnings (0.00 sec)

重载mysql授权表
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

把cacti数据授权与cacti用户
mysql> grant all privileges on cacti.* to cacti@localhost identified by 'cacti123';
Query OK, 0 rows affected (0.00 sec)

重载mysql授权表
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

cd /usr/apache/htdocs/
导入cacti数据库
mysql -u cacti -pcacti123 cacti < cacti.sql
导入完成以后,修改该一下cacti的配置文件,以保证网站与数据库能正常连接。
vi /usr/apache/htdocs/cacti-0.8.8/include/config.php

$database_type = &quot;mysql&quot;;
$database_default = &quot;cacti&quot;;
$database_hostname = &quot;localhost&quot;;
$database_username = &quot;cacti&quot;;
$database_password = &quot;cacti123&quot;;
$database_port = &quot;3306&quot;;
$database_ssl = false;

然后,在浏览器访问http://192.168.0.169/cacti,这里比较麻烦,我重点说一下。我在这里总共出现四个问题,依次是:
1.页面报错为:
FATAL:cannot connect to mysql server on 'localhost',please mak sure you have specified a valid mysql database name in 'include/config.php'
解决办法:写一个脚本测试连接,代码如下:
<?php

$link=mysql_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;&quot;);
if(!$link) echo &quot;FAILD!&quot;;
else echo &quot;It's OK!&quot;;

?>
2.我测试的的时候又出现一个新的错误:
through socket 'var/mysql'
no mysql-link resource supplied
这个问题有可能是php没有找到mysql的sock文件,因为标准的php配置是通过'/tmp/mysql.sock'来连接mysql的。也有可能是权限的问题,
我的解决办法是:修改mysql的配置文件,client和mysqld的socket文件修改为php所支持的路径 /tmp/mysql.sock.重启mysql就好了。
当然也可修改php.ini文件。
3.虽然前面两个问题没有出现了,但是郁闷之极,问题总是不断的:
错误提示:strtotime():it is not safe torely on the systme's timezone sttings
时区错误,这个时区好像不是系统的那个时区,而是php的。解决办法:
修改php.ini文件的时区设置,我的是date.timezone= &quot;Asia/Chongqing&quot;
保存,并重启系统,再继续访问。
4.现在出现一个比较严重的问题了。安装php的时候没有配置socket支持。
这下没办法了,只能添加socket支持重新编译。

步骤如下:
1.不用停止 apache
2.进入 apache 的模块目录,备份一下 php 模块.
cd   /usr/apache/modules/
cp libphp5.so libphp5.so.bak
3.进入 php 的源码目录下,由于已经成功编译过,会有一个成功的 config.nice 文件,打开这个文件并重新配置,增加 socket 支持
如果不知道 socket 支持需要哪些参数,可以通过 ./configure --help|grep sock 这个命令得到该项帮助
cd /usr/local/src/LAMP+memcahed+catci/php-5.4.0/
vi config.nice
复制原来的代码到剪切板
我的代码如下:
#! /bin/sh
#
# Created by configure

'./configure' \
'--prefix=/usr/php' \
'--with-gd' \
'--with-apxs2=/usr/apache/bin/apxs' \
'--enable-mbregex' \
'--enable-bcmath' \
'--with-mysql=/usr/mysql' \
'--with-zlib-dir=/usr/zlib' \
'--enable-mbstring=all' \
'--with-pdo-mysql' \
'--with-mysql-sock=/var/mysql' \
'--with-freetype-dir=/usr/freetype' \
&quot;$@&quot;
增加一行
'--enable-sockets' \
4.重新生成配置文件
sh config.nice
5.重新编译
make
make install
6.重启 apache
/usr/apache/bin/apachectl restart

--------------加载其他模块方法相同--------------

非常不错,现在终于可以看到正常的网页了,接下来就通过网页安装把。

完成网页的安装后,执行以下几步就可以看到图像了
1.添加系统用户
useradd cacti -g users
2.为cacti设置密码
passwd cacti cacti123
3.赋予权限
chown -R cacti rra/ log/
chown cacti:users scripts/*
4.设置自动作业时间
crontab -u cacti -e
*/5****     /usr/php/bin/php/usr/apache/htdocs/cacti/poller.php > /dev/null 2>&1

保存。(注意:没有赋予正确的权限将不会在rra和log目录下产生文件和日志,同时网页上也不显示图)

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-521692-1-1.html 上篇帖子: sql server 2012 升级安装报错的解决 下篇帖子: 怎么让Windows2012和Windows2008多用户同时远程
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表