LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   cacti & apache (https://www.linuxquestions.org/questions/linux-server-73/cacti-and-apache-533936/)

trebek 03-02-2007 10:31 AM

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.

acid_kewpie 03-02-2007 10:34 AM

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?

trebek 03-02-2007 12:40 PM

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.

riyu 03-02-2007 01:19 PM

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?

trebek 03-02-2007 02:25 PM

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.

trebek 03-02-2007 04:35 PM

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.:scratch:

riyu 03-05-2007 07:03 AM

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 :)

trebek 03-05-2007 11:15 AM

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.

lslade 03-05-2007 01:51 PM

Flush Privileges
 
You need to execute a "flush privileges" command as the mysql root user after running any grant commands. Have you done that?

trebek 03-05-2007 04:40 PM

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.

lslade 03-06-2007 09:32 AM

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

trebek 03-06-2007 11:48 AM

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.

trebek 03-08-2007 03:36 PM

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? :scratch:

trebek 03-19-2007 04:19 PM

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?
:scratch:

trebek 03-19-2007 10:23 PM

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!!!!!! :cry:


All times are GMT -5. The time now is 10:34 AM.