您好,登錄后才能下訂單哦!
一.建立一個虛擬主機(jī)
1.vim /etc/httpd/conf.d/vhost.conf
該文件為新建文件,也可在/etc/httpd/conf/httpd.conf末尾添加,為:
<VirtualHost 192.168.18.144:80> /固定格式 ip和端口自己設(shè)置
ServerName cacti.gaowei.com /域名
DocumentRoot /web/vhost/cacti-0.8.8a /路徑
<Directory "/web/vhost/cacti-0.8.8a"> /固定格式,“”里邊為路徑
Options Indexes FollowSymLinks /一些權(quán)限,百度可查
AllowOverride None
Order allow,deny
Allow from all
</Directory> /固定格式
ErrorLog "logs/cacti-error_log" /報錯日志
CustomLog "logs/cacti-access_log" common /常規(guī)日志
</VirtualHost> /固定格式
2.vim /etc/hosts 添加:
192.168.18.144 cacti.gaowei.com
二.安裝cacti
1.tar xvf cacti-0.8.8a -C /web/vhost/ //web/vhost為自己創(chuàng)建的
cd /web/vhost/cacti-0.8.8a
2.mysqladmin create cactidb /創(chuàng)建mysql數(shù)據(jù)庫
3.mysql cactidb < cacti.sql /將cacti.sql導(dǎo)入到數(shù)據(jù)庫
4.mysql -e "GRANT ALL ON cactidb1.* TO cactiuser@localhost IDENTIFIED BY 'cactiuser'" /cactidb給用戶cactiuser所有權(quán)限
密碼為cactiuser
5.mysqladmin flush-privileges /刷新
6.mysql -ucactiuser -p /以cactiuser用戶登錄
7.mysql>SHOW DATABASES; /查看創(chuàng)建的數(shù)據(jù)庫
8.cd include ;vim config.php /修改如9
9.
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactiuser";
$database_port = "3306";
$database_ssl = false;
/*
Edit this to point to the default URL of your Cacti install
ex: if your cacti install as at http://serverip/cacti/ this
would be set to /cacti/
*/
//$url_path = "/cacti/";
$url_path = "/";
10.service httpd restart
11.useradd cactiuser ;passwd cactiuser
12.chown -R cactiuser:cactiuser rra/ log/
13.vim /etc/php.ini /修改如14
14.這個選項設(shè)置為date.timezone = Asia/Shanghai
15.echo '*/5 * * * * /usr/bin/php /web/vhost/cacti-0.8.8a/poller.php &>/dev/null' > /var/spool/cron/cactiuser /每隔5分鐘cactiuser用戶會執(zhí)行
poller.php
16.crontab -u cactiuser -e /使15寫入成功,如果有錯,則會報錯
17.在瀏覽器輸入
cacti.gaowei.com 會彈出cacti安裝提示。按提示安裝即可,自帶5個數(shù)據(jù)源,可添加本機(jī)對這5個數(shù)據(jù)源進(jìn)行監(jiān)控。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。