LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-02-2007, 10:31 AM   #1
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Rep: Reputation: 30
cacti & apache


Hello.

I am trying to get the cacti web interface working. In it's manual from the cacti website, they assume that http://localhost/cacti works, in my case, they assumed wrong. So, i verified that apache is working. I had to install php for cacti to be installed. So my question is: how do i create a new site and how can i tell which is the file that cacti uses with this web browser tool?

I don't know how to set up a new site in apache. I went to the apache.org site, but they explain modules and starting scripts, but not the most simple elemental step as to configure a new site and get it to show in the browser.
 
Old 03-02-2007, 10:34 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
well assuming you're running apache as provided by fedora, it was been broken down to enable the use of dropin configuration files. you should have a directory, /etc/httpd/conf.d and in there the cacti install process would have palced a config file specifically for apache to use to provide the necessary configurations. is it there? have you restarted of hup's apache to read the file?
 
Old 03-02-2007, 12:40 PM   #3
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Well, here's the workaround i did. I copied the cacti directory to where apache reads by default, and that fixed that part. But a new issue arised. You know that you have to create a mysql user. So, i performed these steps:
shell> mysql --user=root mysql
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
mysql> flush privileges;
Exactly as they are there so i wouldn't have any problems. But i get this error message:
Code:
Error

You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:

mysql -u cactiuser -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.
I read the error message and verified that i could log in as cactiuser with the password and that i could perform everything with it, and i did from the mysql prompt. What's wrong? I even performed the import again, and typed show tables in the mysql prompt, and saw all the tables there, so i know that the problem is not the importing, it's the user.

U r a life saver man. Thanks a lot.

Last edited by trebek; 03-02-2007 at 12:45 PM.
 
Old 03-02-2007, 01:19 PM   #4
riyu
LQ Newbie
 
Registered: Mar 2007
Location: India
Distribution: gentoo,debian and FreeBSD
Posts: 7

Rep: Reputation: 0
Hi James,

The 3rd point in Installation Guide for Unix/Linux says you have to execute
Code:
mysql -u cactiuser -p cacti < cacti.sql
did you execute it?
 
Old 03-02-2007, 02:25 PM   #5
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Yep i did!!! I can tell cause all the tables in mysql are there. I didn't put them in manually.

So here's the thing: i deleted the database with 'drop database cacti', created the database again with 'create database cacti', and then performed that commmand right there again. Guess what? Same problem. I don't know what's wrong. Jejeje.

Also, please check the commands i used to create the user. Probably the error could be there. But so far i think i did that part right. Since i can connect to the mysql prompt and i can perform everything on the database. Could it be that i need to create a system user too? It doesn't seem so cause in order to connect to the database you just need the user to exist on the database, not on the system. Correct me if i'm wrong. LOL.

Thanks for the help dude.

Last edited by trebek; 03-02-2007 at 02:39 PM.
 
Old 03-02-2007, 04:35 PM   #6
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
I just discovered the most interesting thing. After i type 'grant all on cacti.* to cacti@localhost identified by 'cactiusr';' command, i get a Query OK, 0 rows affected (0.00 sec). So, this kinda made me think if the user was created. So i researched about 'show grants;' and i only get the root grants, but the cactiuser grants are not there, there is only one record!!!!!!! This means that for some reason, the grant statement is not throwing an error, but it is not creating the user either.

What's going on???

Here's the result of the show grants command:
Code:
    -> ;
+---------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                     |
+---------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '1aa2ca6225cef2bb' WITH GRANT OPTION |
+---------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
Thanks for the help.
 
Old 03-05-2007, 07:03 AM   #7
riyu
LQ Newbie
 
Registered: Mar 2007
Location: India
Distribution: gentoo,debian and FreeBSD
Posts: 7

Rep: Reputation: 0
sorry for the late reply.

I dont think there is any problem with the grants (but i dont know much abt mysql).

See if the permissions for the cacti database are set right. If you execute the follow code you should get similar output

Code:
# ls -l /var/db/mysql | grep cacti
drwx------  2 mysql  mysql      4608 Feb  4 16:24 cacti
# ls -l /var/db/mysql/cacti/
total 826
-rw-rw----  1 mysql  mysql    392 Feb  4 16:25 cdef.MYD
-rw-rw----  1 mysql  mysql   2048 Feb  4 16:25 cdef.MYI
-rw-rw----  1 mysql  mysql   8616 Feb  4 16:24 cdef.frm
-rw-rw----  1 mysql  mysql    936 Feb  4 16:25 cdef_items.MYD
-rw-rw----  1 mysql  mysql   3072 Feb  4 16:25 cdef_items.MYI
-rw-rw----  1 mysql  mysql   8722 Feb  4 16:24 cdef_items.frm
...
replace /var/db/mysql with the location where you databases are stored.

if its not then execute

Code:
#chown -R mysql:mysql /var/db/mysql/cacti/

Hope this works
 
Old 03-05-2007, 11:15 AM   #8
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Am i suppossed to get the cacti user privileges when i perform the show grants command? Similar to what i get with root?

I will try that when i get back to work, thanks a lot man.
 
Old 03-05-2007, 01:51 PM   #9
lslade
LQ Newbie
 
Registered: Nov 2005
Location: Canada
Distribution: Debian
Posts: 14

Rep: Reputation: 0
Flush Privileges

You need to execute a "flush privileges" command as the mysql root user after running any grant commands. Have you done that?
 
Old 03-05-2007, 04:40 PM   #10
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by lslade
You need to execute a "flush privileges" command as the mysql root user after running any grant commands. Have you done that?
Yeah, i have, after the grant thing i performed that.
 
Old 03-06-2007, 09:32 AM   #11
lslade
LQ Newbie
 
Registered: Nov 2005
Location: Canada
Distribution: Debian
Posts: 14

Rep: Reputation: 0
Hi,

I saw that you had mentioned the "flush privileges" in your post. Oops.

1. Make sure you have installed the package php-mysql as well.
2. Make sure you didn't start mysql with --skip-grant-tables (for example if you forgot the root password earlier)
3. In your grant statement I don't see the single quotes around 'cactiuser'@'localhost'. If you forgot those please check your permissions by querying the mysql tables with something like this:

mysql -u root -p

> use mysql;
> select user, host from user;
> select user, db from from db;

lslade
 
Old 03-06-2007, 11:48 AM   #12
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Ok, i will try that when i get back to work. I am currently recovering from a motorcycle accident so i'll be away from work at least a week. Thanks for understanding. Believe me when i say that i will be doing those things ASA i get back.

LQ rules. Sorry for the inconvenience.
 
Old 03-08-2007, 03:36 PM   #13
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Ok, i have tried those steps.

I got one question though: how do i start or ckeck if mysql has been started with the option you specified there?

Here's the output of the commands from within mysql.

mysql> select user, host from user;
+-----------+-------------------+
| user | host |
+-----------+-------------------+
| | localhost |
| cacti | localhost |
| cactiuser | localhost |
| root | localhost |
| cactiuser | penguin2 |
| | penguin2.intranet |
| root | penguin2.intranet |
+-----------+-------------------+
7 rows in set (0.00 sec)

and

mysql> select user, db from db;
+-----------+---------+
| user | db |
+-----------+---------+
| | test |
| | test\_% |
| cacti | cacti |
| cactiuser | cacti |
| cactiuser | cacti |
+-----------+---------+
5 rows in set (0.00 sec)

This looks right, right?
 
Old 03-19-2007, 04:19 PM   #14
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Hey there. I just upgraded mysql to a 5.0 something version. I was following the instructions to give the root password after the installation, but mysqladmin is nowhere to be found. What's going on?
 
Old 03-19-2007, 10:23 PM   #15
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
I fixed the mysqladmin thing by installing the client package, but i ran into another problem.

I am trying to perform the following command:
mysqladmin --user=root create cacti
And i get the following error:
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

I remember doing something to fix this, but i can't remember what. Mysql has just made it so hard for me to get this root user to do things. At first, after installing the rpm, it told me to type 'mysqladmin -u root -p password 'password'' to set the initial password for the mysql root user. But after doing this, the command didn't work. So, i am doing what mysql tells me to do, and then turns back at me laughing as if it just made a prank on me.

Now i tried this to kinda figure out how messed up the password is:
mysqladmin version -p
This displayed the following lines:
mysqladmin Ver 8.41 Distrib 5.0.37, for pc-linux-gnu on i686
Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 5.0.37-standard
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 2 min 39 sec

Threads: 1 Questions: 1 Slow queries: 0 Opens: 11 Flush tables: 1 Open tables: 6 Queries per second avg: 0.006

I typed the password i've been using, and it did work, so why is the other mysqladmin command telling that the access is denied and that i am not using a password?

After this, i decided mysql is just not a nice program, so i uninstalled mysql server and client packages, and installed them back again. Now, after installing the server and then the client, i typed 'mysqladmin -u root -p password 'newpassword'' to set the password, and then tried to create the cacti database again, and guess what, same error message:'error: 'Access denied for user 'root'@'localhost' (using password: NO)''.

I am very confused here. Please help!!!!!!

Last edited by trebek; 03-19-2007 at 10:52 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cacti installation on Debian Sarge: create cacti database error Yahweee Debian 2 08-26-2008 06:35 AM
how to install & configure cacti on Ubuntu linux ketut_hendratha Linux - Newbie 4 08-23-2006 05:30 AM
Slackware guide for AMP Apache MySQL & PHP xushi Slackware 35 05-11-2006 11:18 AM
SElinux & php4 & interbase & apache maxut Linux - Security 0 03-15-2005 04:57 AM
From RedHat9 to FreeBSD (Apache 2 & Mysql & PHP 4) guardian653 *BSD 5 12-11-2003 05:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration