Friday, April 01, 2005

MySql Bugzilla

ok mysql has a two part process of install
you need to have a root or sa user
then have a bugzilla user and
all the grant tables working.

$> /etc/init.d/mysql start
$> mysqladmin -u root flush-privileges password "password"
$> mysql -u root -p
Enter password: password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.22

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

mysql> exit
Bye

the above worked see the page:
http://www.ladse.de/index.php/Installation:Gentoo:MySQL

now i have tried to run the bugzilla checksetup.pl script
and here is what i get.

Creating database bugs ...

The 'bugs' database could not be created. The error returned was:

Access denied for user: '@localhost' to database 'bugs'

but this makes sense because really all i have done is setup
the basic mysql exe and the system tables
but is there a complete bugzilla db with tables and a user?
i dont know is the answer to this. so what do i need to do?
i need to have command line tools to query the db status.

yes there are fine graphical tools but i need things
i can script. (i dont want to fart with web shots
on this blog)

ok
i ran mysql command

$> mysql -u root -p
and then ran the following query:

mysql> select Host,User from mysql.user;
+-----------+------+
| Host | User |
+-----------+------+
| localhost | |
| localhost | root |
+-----------+------+
2 rows in set (0.00 sec)

there is currently one user.

so i pretty much know i need
to add a user called bugs.

i looked up the mysql documentation online
and adding a user seems to be
be more about 'grant' than 'create user'
anyway the link is:
http://dev.mysql.com/doc/mysql/en/adding-users.html

GRANT ALL PRIVILEGES on *.* to 'bugs'@'localhost'
-> IDENTIFIED BY 'password' with GRANT OPTION;
GRANT ALL PRIVILEGES on *.* to 'bugs'@'%'
->IDENTIFIED BY 'password' WITH GRANT OPTION;

so i have created user 'bugs' on the bugs database
with the password 'password'
i have deliberately made this simple i may change
the passwords later but for now i want something
simple easy to remember as move along.

i then reran ./checksetup.pl from the bugzilla
source dirctory same problem again
but the inuited that i would need to check
the password entry :

$db_pass = ''

ah!

i changed this to
$db_pass = 'password'
and re-ran ./checksetup.pl

tada it start creating a bunch
of tables and user accounts.

i went back and put the link in my
browser;
http://localhost/bugzilla/
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.0.52 (Gentoo/Linux) Server at xxxx Port 80

so what next?
i could debug the index.cgi script?
or is it something in the localconfig script?

i found the following line in the error logs
[Fri Apr 01 13:43:00 2005] [alert] [client 192.168.x.x] /var/www/localhost/htdocs/bugzilla/.htaccess: AllowOverride not allowed

i did some digging in the bugzilla docs and found this.

4.2.6. .htaccess files and security
....
The default .htaccess file may not provide adequate access restrictions, depending on your web server configuration. Be sure to check the entries for your Bugzilla directory so that the .htaccess file is allowed to override web server defaults. For instance, let's assume your installation of Bugzilla is installed to /usr/local/bugzilla . You should have this entry in your httpd.conf file:
<Directory /usr/local/bugzilla/>
Options +FollowSymLinks +Indexes +Includes +ExecCGI
AllowOverride All
</Directory>


I DID NOT HAVE THIS.
I added the following and went back and tried the site.
tada! the bugzilla site came up.


No comments: