cacti

#$ sudo apt-get install apache2
#$ sudo apt-get install mysql-server
$ sudo apt-get install php5
#sudo apt-get install php5-mysql php5-cgi php5-cli php5-snmp php-pear snmp snmpd
sudo apt-get install php5-cgi php-pear


--------------------------------------------------------------------------

1 安装软件

sudo apt-get -y install apache2 mysql-server php5 php5-mysql php5-cgi php5-cli php5-snmp php-pear snmp snmpd rrdtool
再加sudo apt-get install libapache2-mod-php5


2 设置服务

cd /var/www/
sudo wget http://www.cacti.net/downloads/cacti-0.8.7e.tar.gz
sudo tar xfz cacti-0.8.7e.tar.gz
sudo mv cacti-0.8.7e.tar.gz /data/tgz/
sudo mv cacti-0.8.7e/ cacti
cd cacti/
mysqladmin -u root -p create cacti
mysql -u root -p cacti < cacti.sql


3 添加用户权限,执行 mysql -u root -p cacti

grant all on cacti.* to cactiuser@localhost identified by 'cacti';

set password for cactiuser@localhost=password('cactiuser');

编辑/var/www/cacti/include/config.php,修改数据库的密码为cactiuser

这个是根据你上面设置数据库的密码

$ sudo vi /var/www/cacti/include/config.php

$database_password = "cactiuser";


4 设置用户

useradd cactiuser -d /data/monitor/cacti -s /bin/false
chown -R cactiuser /data/monitor/cacti/rra /data/monitor/cacti/log
vi /etc/crontab

增加一行
*/5 * * * * cactiuser php5 /data/monitor/cacti/poller.php > /dev/null 2>&1


修改这几个php配置文件:

vi /etc/php5/apache2/php.ini
vi /etc/php5/cgi/php.ini
vi /etc/php5/cli/php.ini

编辑 "; extension=msql.so" => "extension=mysql.so"

/etc/init.d/apache2 restart



---------------------------------------------------------------------------
step1:sudo vim /etc/apache2/ports.conf 修改监听端口以及主机端口为8080

NameVirtualHost *:8080
Listen 8080

step2:  sudo vim /etc/apache2/sites-available/default 只要修改virtualHost的端口即可:

<VirtualHost *:8080>

step3:重启apache2

sudo service apache2 stop

sudo service apache2 start

你可能感兴趣的:(互联网)