Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[How-to]: Installing cacti on a gentoo box (fresh install)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Prompty
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 292

PostPosted: Sat Jan 08, 2005 11:47 am    Post subject: [How-to]: Installing cacti on a gentoo box (fresh install) Reply with quote

Formerly known as Unreliable guide to gentoo and cacti (install)

Ok, I'm writing this because I had a few problems before managing to finally get this running and had no luck finding a solution on the internet.


The use-flags I needed
Code:

gd dba mysql php svg apache2 zlib session

AND I think
Code:
cli


I added session because there were problems with session support . ( now some of those flags you don't want to use on your system.)

OK now do a
Code:

emerge cacti

(preferably on a screen or some remote console)

--------Note------
you might need to re-emerge your php and mod_php for cacti to work
-------End-Note----

add a group cacti and user cactiuser ( cactiuser is suppoused to be in
cacacti group ) something like
Code:

group-add cacti
useradd -g cacti cactiuser



Wait for the installation process to finish..

All that you need is in ( my case - fresh apache install )

Code:

cd /var/www/localhost/htdocs/cacti/

Code:

mysql --user=root cactidb < cacti.sql
chown -R cactiuser rra/ log/



in
/var/www/localhost/htdocs/cacti/include/

you might want to do this with your mysql
Run these commands as root
Code:

mysql
mysql> set password for root@localhost=password('rootpw');
mysql> create database cactidb;
mysql> grant all on cactidb.* to root;
mysql> grant all on cactidb.* to root@localhost;
mysql> grant all on cactidb.* to cactiuser;
mysql> grant all on cactidb.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('mycactipw');
mysql> exit



Code:

cp config-sample.php config.php
vi config.php


the interesting part of config.php looks like this
Code:

$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "mycactipw";



Now in /etc/conf.d/apache2 i added
Code:

APACHE2_OPTS="-D PHP5"



Now start your apache
/etc/init.d/apache2 start
it should bring up mysql



now as user cactiuser
Code:
 su - cactiuser

add this to your crontab
Code:
crontab -e

Code:

*/5 * * * * /usr/bin/php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1

you might want to try running this from you cactiuser shell.
REMEBER (i had some problems with that too ;] ) each cacti reinstall ruins permissions to directories , do a
Code:

chown -R cactiuser.cacti rra/ log/

every once in a while



If you're wondering why you're getting a directory listing in your host_name_or_ip/cacti: remeber to to add index.php to your DirectoryIndex in
Code:
 vi /etc/apache2/httpd.conf


My case it looks like that
Quote:
DirectoryIndex index.html index.html.var index.php



If you're having problems with graphs not showing still (reported on hardened gentoo):
-some people reported problems with php safe_mode ( I don't know what or where that is for the time being but ) you should turn it off
_________________
<input stupid message here>


Last edited by Prompty on Wed Jan 25, 2006 12:39 pm; edited 8 times in total
Back to top
View user's profile Send private message
HRH_H_Crab
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jul 2003
Posts: 115
Location: Sarf East Lahndahn

PostPosted: Mon Feb 28, 2005 1:24 pm    Post subject: Reply with quote

nice guide, big up yourself!
followed this and now my cacti is working lovely.
Back to top
View user's profile Send private message
veal
n00b
n00b


Joined: 08 May 2003
Posts: 47

PostPosted: Fri Mar 18, 2005 7:32 pm    Post subject: Reply with quote

[e] never mind, i should've read the official documentation where the default password is written :)

i followed the guide that's printed after a successfull emerge (but looks similar to this one) and everything went smooth except after working through the website-config it prompts for a user/login
"Please enter your Cacti user name and password below:"

but i never created a Cacti user and i tried several combos (of the mysql user etc.) but none of them worked.

any idea?
Back to top
View user's profile Send private message
Prompty
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 292

PostPosted: Sat Mar 19, 2005 2:46 pm    Post subject: Reply with quote

if i remeber correctly it's "admin/admin"
_________________
<input stupid message here>
Back to top
View user's profile Send private message
JustJoe
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jul 2005
Posts: 80

PostPosted: Fri Aug 05, 2005 6:35 pm    Post subject: Reply with quote

Hi, i tried to install cacti, but it comes with this error:

Code:
dev-php/mod_php must be compiled with USE=mysql


Prolly n00b-ish, but how to fix this ?

edit:
i put this in /etc/portage/package.use :
Code:
dev-php/mod_php mysql

but it doesn't seem to be right.


*Solved: I did not emerge dev-php/mod_php, only php.... :?
Back to top
View user's profile Send private message
ruben-
Apprentice
Apprentice


Joined: 09 Nov 2004
Posts: 197

PostPosted: Sun Sep 11, 2005 5:25 pm    Post subject: Reply with quote

Add this to the gentoo-wiki.. It looks good, but not working for me tho :(
I don't get graphs, only unreadable images.
Back to top
View user's profile Send private message
Suicidal
l33t
l33t


Joined: 30 Jul 2003
Posts: 913
Location: /dev/null

PostPosted: Mon Sep 12, 2005 2:41 am    Post subject: Reply with quote

Thanks for the session use flag that fixed the problem I was having with php5; one question though shouldnt cli be added to the use flags if using php5? I tried it without it earlier today and there was no /usr/bin/php binary which would be needed to run the cron job.
Back to top
View user's profile Send private message
overcast
n00b
n00b


Joined: 15 Dec 2003
Posts: 43

PostPosted: Wed Oct 19, 2005 7:48 pm    Post subject: Reply with quote

What is the reason for creating a separate user for something like this? Why not run as root? Just good security practice and a healthy dose of paranoia or are there specific issues someone can site with running this as root?

Just curious.
Back to top
View user's profile Send private message
raven.sorrow
n00b
n00b


Joined: 10 Oct 2005
Posts: 20

PostPosted: Wed Nov 30, 2005 5:03 pm    Post subject: Reply with quote

this guide is great .... but Cacti uses SNMP (Simple Network Managment Protocol) There are very poor HOWTO's on how to set snmp up on a Gentoo Box. Can anyone shead any light on this subject?
Back to top
View user's profile Send private message
wan-geek
n00b
n00b


Joined: 03 Apr 2003
Posts: 66
Location: knee-deep in the ether

PostPosted: Tue Jan 10, 2006 5:14 am    Post subject: snmp setup Reply with quote

You are correct that Cacti uses snmp. It does -not- require snmp to be a running daemon on the local system however.

The function of snmp in Cacti is as a polling mechanism to remote systems. You don't need to setup anything for snmp on the Cacti system to be able to use Cacti.

When you emerge net-snmp, you will end up with a number of utilities that are a part of the package. These can be used to query (and set) snmp values on remote systems. If you have a system running an snmp daemon, you should be able to walk it's MIB tree via the command snmpwalk.

To brush up on snmp itself and it's use, I would check online. There are numbers of great resources that explain the protocol in detail...it's usage and pitfalls. To setup the snmp daemon to run on a system...I would refer to the man page for snmpd and snmpd.conf. (hint: there's a wizard that you can run to build the configs for you...but the man page tells you that already:wink: )

In short, if you are trying to setup a machine to run cacti on...and act as a snmp _poller_ to remote systems, you don't need to do anything more with snmp than emerge it.

Cheers,
-Chris
Back to top
View user's profile Send private message
wan-geek
n00b
n00b


Joined: 03 Apr 2003
Posts: 66
Location: knee-deep in the ether

PostPosted: Tue Jan 10, 2006 5:19 am    Post subject: user separation Reply with quote

In regards to overcast's question, ...regarding running as root...

Best practice states that the root user should be used as little as possible and only when specifically necessary. Since Cacti has -0- need to run as root...it is most commonly setup to run as a separate user.

If you want to run it as root, nobody is stopping ya. Just remember that you chose to run it as root if/when anything goes awry and takes down the system.

Cheers,
-Chris
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum