Linux上简单配置安装cacti(一)apache和mysql
Linux上简单配置安装cacti(一)apache和mysql
首页
http://www.cacti.net/index.php
下载得到文件
cacti-0.8.7e.tar.gz
官方参考文档
http://www.cacti.net/downloads/docs/html/install_unix.html
我参考了BLOG
http://soft.zdnet.com.cn/software_zone/2007/0912/502918.shtml
1、apache服务器
先检查apache服务器是否已经安装了
[root@dev1 conf]# httpd -v
Server version: Apache/2.0.52
Server built: May 24 2006 11:45:10
不是2.2版本。。。。。
停止老版本服务
service httpd stop
网站上下载一个新版
http://httpd.apache.org/download.cgi
得到文件
httpd-2.2.14.tar.gz
解开压缩
tar zvxf httpd-2.2.14.tar.gz
进入目录
cd httpd-2.2.14/
开始安装
./configure --enable-modules=all --enable-so
make
make install
启动Apache服务
# /usr/local/apache2/bin/apachectl start
关闭Apache服务
# /usr/local/apache2/bin/apachectl stop
重启Apache服务
/usr/local/apache2/bin/apachectl restart
设置Apache启动服务
#cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
配置文件
/usr/local/apache2/conf/httpd.conf
2、mysql数据库
参考以前自己的BLOG安装完成mysql5
http://hi.baidu.com/luohuazju/blog/item/c6705efc1eedbc87b801a032.html
晕,下载地址换了
http://download.softagency.net/MySQL/Downloads/MySQL-5.1/
下载文件
http://download.softagency.net/MySQL/Downloads/MySQL-5.1/mysql-5.1.40-linux-i686-glibc23.tar.gz
输入命令后报错:
[root@dev1 mysql]# bin/mysqld_safe --user=mysql &
[1] 15325
[root@dev1 mysql]# 091217 22:22:53 mysqld_safe Logging to '/var/lib/mysql/dev1.sccl.cn.err'.
091217 22:22:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
091217 22:23:01 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
[root@dev1 mysql5.1]# bin/mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (1)
解决办法
vi /etc/my.cnf
把
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/lib/run/mysql/mysqld.pid
改成
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysqld.pid
好现象,貌似启动成功了,插件进程
[root@dev1 log]# ps -aux | grep mysql
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.3/FAQ
root 15526 0.0 0.0 5276 1112 pts/0 S 22:42 0:00 /bin/sh bin/mysqld_safe --user=mysql
mysql 15594 0.0 0.6 119232 14292 pts/0 Sl 22:42 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/dev1.sccl.cn.err --pid-file=/var/lib/mysql/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root 15613 0.0 0.0 5976 656 pts/0 S+ 22:44 0:00 grep mysql
但是登陆还是报错,修改如下:
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
登陆老是提醒我登陆的用户名和密码不对,我重新设置了一下密码
mysqladmin -uroot password kaishi
登陆
mysql -u root -p
输入新密码kaishi
登陆终于成功了:),好事多磨啊。