new install , blanl page at http://remoteip/cacti

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

fborot
Cacti User
Posts: 52
Joined: Thu Apr 07, 2005 3:11 pm

new install , blanl page at http://remoteip/cacti

Post by fborot »

Hello
I was searching in the forum for a while but i have not been able to find something similar:

I just installed cacti, these are the packages I am using (on Fedora 3)

[root@cactitest httpd]# rpm -qa | egrep "apache|httpd|php|mysql|snmp|cacti"
httpd-2.0.52-3
php-pear-4.3.9-3
libdbi-dbd-mysql-0.6.5-9
mod_auth_mysql-20030510-5
mysql-server-3.23.58-13
mysql-3.23.58-13
php-4.3.9-3
net-snmp-5.1.2-11
mysql-devel-3.23.58-13
net-snmp-utils-5.1.2-11
php-snmp-4.3.9-3
php-mysql-4.3.9-3
system-config-httpd-1.3.1-1
mysql-bench-3.23.58-13
httpd-suexec-2.0.52-3
net-snmp-libs-5.1.2-11
cacti-0.8.6c-1

When I go to http://remoteip/cacti I see a blank page. I also see this in /var/log/httpd/error_log

[client 10.100.102.70] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /var/www/html/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339
[client 10.100.102.70] PHP Fatal error: Call to undefined function: cacti_log() in /var/www/html/cacti/lib/database.php on line 51

I created a php file with <?php phpinfo()?> and I see that my pho supports mysql, so mysql is enabled.

I installed everything from rpms. What else could it be?

:cry:

Regards
fborot
duckhead
Cacti User
Posts: 59
Joined: Wed Oct 20, 2004 7:41 pm

Post by duckhead »

1. You did not create the Database

2. You created the Database, but did not put the correct db username/password/database name in include/config.php
fborot
Cacti User
Posts: 52
Joined: Thu Apr 07, 2005 3:11 pm

Post by fborot »

duckhead thank you for replying

the database is created (as you can see below, the user cacti exists, the dababase is called cacti and exists too, the password is the same in the config.php file)


[root@cactitest ~]# mysql -u cacti -p
Enter password: ---here I entered ctengine--
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17 to server version: 3.23.58

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| cacti |
| mysql |
| test |
+----------+
3 rows in set (0.00 sec)

mysql> exit
Bye
[root@cactitest ~]#

these are the entries in the "/var/www/html/cacti/include/config.php" file:

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "ctengine";


so this does not seem to be the problem,
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

Did you also import the SQL file for the database and then gave the user full access to the database?
fborot
Cacti User
Posts: 52
Joined: Thu Apr 07, 2005 3:11 pm

Post by fborot »

elnino, I did not do that because I saw that the cacti rpm created the database by itself. (I did a "use cacti", then a "show tables" and I saw a lot of stuff, so the rpm did all that)
I am not sure about giving it the permissions to the user cacti (created also by the cacti rpm)
but how can I check that that user has the permissions?
regards
fborot
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

I havn't installed Cacti via the rpm before, but it does look like the database was created. It wouldnt' hurt to run these commands again just to make sure the user has access to the database:

Code: Select all

[root@cactitest ~]# mysql --user=root mysql
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'ctengine';
mysql> flush privileges;
It looks like your config.php file is ok, so it should start working after this.
fborot
Cacti User
Posts: 52
Joined: Thu Apr 07, 2005 3:11 pm

Post by fborot »

thanks elnino, but after doing that I still have the same problem.
I do not know what else it could be.
fborot
Cacti User
Posts: 52
Joined: Thu Apr 07, 2005 3:11 pm

Post by fborot »

I checked the file:in /var/www/html/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339 and the function mysql_connect() has these are arguments:
$argHostname,$argUsername,$argPassword

I do not see them defined anywhere else in that file.
In the file : /var/www/html/cacti/include/config.php I have these lines:

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "ctengine";


but in the file /var/www/html/cacti/lib/adodb/drivers/adodb-mysql.inc.php
I do not see any refernece to the usernam, database, userpaswd etc.
Could it be the problem?

Regards
Fabian
fborot
Cacti User
Posts: 52
Joined: Thu Apr 07, 2005 3:11 pm

Post by fborot »

any more suggestions please?
:cry:
mjt
Posts: 2
Joined: Mon Apr 11, 2005 7:47 am

Disable SELinux

Post by mjt »

I ran into the same problem and had to disable SELinux
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Are you running apache in a chroot?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
fborot
Cacti User
Posts: 52
Joined: Thu Apr 07, 2005 3:11 pm

Post by fborot »

mjt
thanks , but how do I know if selinux is enabled, and how to disable it ?

roni,
thank you again, how do I know that?

I am sorry but I still consider myselft a beginner to linux.
thank you both,
regards
fabian
mjt
Posts: 2
Joined: Mon Apr 11, 2005 7:47 am

Disable SELinux

Post by mjt »

run the sestatus command to tell if it is enabled.

to disable it you can change the /etc/sysconfig/selinux file .
change "selinux=enforcing" to "selinux=disable'
reboot
fborot
Cacti User
Posts: 52
Joined: Thu Apr 07, 2005 3:11 pm

Post by fborot »

thank you mjt
that fixed it !!!!!!!
it was enabled and I set it up to disabled and reboot the pc.
Now , after the cacti installation page, I have the login page , I tried root/rootpasswd, cacti/cacti etc and it was not working.
I tried admin/admin and that worked, it asked me then to create a new passwd which I did.
I do not remember to have seen anywhere the default login/passwd combination for cacti, I just guessed it.

thank you very much guys
fabian
meee2
Posts: 10
Joined: Wed Apr 06, 2005 2:40 pm
Location: New Mexico
Contact:

Post by meee2 »

I am running into the same problem on both FC2 and 3. I saw many havg problems on FC3 so I nuked the box and went to 2. At first I got a blank page. Then i applied the patches and I get the following now on FC2 in a webrowser:

Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.

/var/log/httpd/error_log says:

[client 65.125.32.121] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339


selinux=disabled

I can command line long in to MySQL as the cacti user from /include/config.php and it shows the following:

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 66 to server version: 4.1.11-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| cactidb |
| test |
+----------+
2 rows in set (0.01 sec)

I fixed this last week in FC3, but had no images and gave up. Now in FC2 I get the same error... any ideas?
Thanks in advance,
Dave
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests