Thanks for the detailed instructions, Matthew. I really appreciate it.
However, my RT is still not quite working. Yes, mysql is running, I even
have phpMyAdmin functional. I ran the following command, it created schema
and populated tables, etc. perl rt-setup-database --action init --dba root
–dba-password
Now I can uncomment PerlRequire /usr/local/bin/webmux.pl in my httpd.conf
file without killing apache, but I still get the following page when I go to
http://myserver/rt/
You’re almost there!
You haven’t yet configured your webserver to run RT. You appear to have
installed RT’s web interface correctly, but haven’t yet configured your web
server to “run” the RT server which powers the web interface. The next step
is to edit your webserver’s configuration file to instruct it to use RT’s
mod_perl, FastCGI or SpeedyCGI handler. If you need commercial support,
please contact us at sales@bestpractical.com.
What must I do next? Below is my rt-specific code in my httpd.conf file. Do
I need to change something in my RT_SiteConfig.pm file???:
Alias /rt /usr/local/share/rt38/html
<Directory "/usr/local/share/rt38/html">
Options Indexes FollowSymLinks
AllowOverride AuthConfig
Order deny,allow
</Directory>
PerlRequire /usr/local/bin/webmux.pl
Thanks,
ZachFrom: Matthew Seaman [mailto:m.seaman@infracaninophile.co.uk]
Sent: Wednesday, December 30, 2009 12:17 PM
To: Zach Boettner
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] rt-3.8.6 is already installed… Error code 1
Zach Boettner wrote:
Can anyone explain a bit more the steps I need to take to resolve this
issue? Matthew, what ‘command’ are you talking about to run from the mysql
client? How do I create the sql structure required by RT? I have the
database, rt3, created, but no structure in it. I’m fairly new to FreeBSD
and a bit lost with this RT installation/config. It’s a crash course.
Thanks, Zach
I showed you a transcript of what you’ld need to type into mysql client, and
what sort of output you should expect. However, here it is spelled out:
-
You should have installed mysql server. You can tell by running
this command:
% pkg_info -Ix mysql-server
If there’s no output from that command, then become root and do this:
cd /usr/ports/databases/mysql50-server
make install clean
-
Mysql server should be running. As root do:
/usr/local/etc/rc.d/mysql-server status
Now, if all is well you will see something like this:
mysql is running as pid 23757.
There are two failure modes. Firstly, if you see a message
mysql is not running
then mysql is configured to start up, but isn’t currently running.
In that case, just run:
/usr/local/etc/rc.d/mysql-server start
and try the status command again. If mysql won’t start, look at
the logfile in /var/db/mysql/${hostname}.err for clues. (ie.
replace ${hostname} with the hostname of your machine…)
Secondly, if you see no output at all, then mysql has not been
configured to start up at all. In that case, edit the file
/etc/rc.conf and add the following line:
mysql_enable=“YES”
Then try starting mysql-server again.
-
If you have not already done so, you should set a root password
inside mysql. Without this, anyone with access to port 3306 on
your server can control your database. To set a new mysql root
password, run this command as root:
mysqladmin password VafugOrmup
where ‘VafugOrmup’ is replaced by your own secret password. Make a
record of the new MySQL root password and keep it in a safe place, as
you’ll need it later. For day to day use, you can set up /root/.my.cnf
so that you don’t need to type in the password every time you go into
mysql client.
Simply edit the /root/.my.cnf file to have the following contents:
# cat /root/.my.cnf
[client]
user = root
password = VafugOrmup
(replacing the password with your own one). Then make that file
accessible
only by root:
# chown root:wheel /root/.my.cnf
# chmod 0600 /root/.my.cnf
Now, when you run the command mysql as root, you should get to
the 'mysql>' prompt straight away. Verify that this works.
-
Note that mysql is a very complex program and has a wealth of
configuration
and tuning settings which may need adjustment to give you good
performance
according to your workload and the available hardware. This is a good
point
to make those settings. Unfortunately, this is not something I can give
you a
potted set of directions that you can just run through because what you
need
to do depends very much on what sort of hardware you have, what sort of
workload
your RT installation will need to cope with and other considerations
like if
you’re running any other databases or if you have separate web and DB
server
hardware.
There are literally thousands of web pages discussing this sort of
thing, not to
mention a dozen or so text books you can refer to, but for best
results, consult
a knowledgeable DBA. For testing purposes you can just proceed with
the default
settings: everything should still work, but probably not as fast as it
could do.
-
Now, we get to the RT specific bits. First, run mysql client and check
if
a database has been created for RT to use.
# mysql
[...]
mysql> SHOW DATABASES ;
This should result in output like so:
| Database |
| information_schema |
| mysql |
| rt3 |
3 rows in set (0.00 sec)
The default database name for RT is ‘rt3’: it is possible to override
that, but
unless you have a good reason to do so, it’s best to just keep to the
default.
The other two databases are used internally by MySQL.
If the database exists, see if there are any tables in it:
mysql> use rt3
mysql> SHOW TABLES ;
The output should look like this:
| Tables_in_rt3 |
| ACL |
| Attachments |
| Attributes |
| CachedGroupMembers |
| CustomFieldValues |
| CustomFields |
| GroupMembers |
| Groups |
| Links |
| ObjectCustomFieldValues |
| ObjectCustomFields |
| Principals |
| Queues |
| ScripActions |
| ScripConditions |
| Scrips |
| Templates |
| Tickets |
| Transactions |
| Users |
| sessions |
21 rows in set (0.00 sec)
Finally, check that the DB userid RT will use for day to day access to
the
database has been set up:
mysql> SHOW GRANTS FOR 'rt_user'@'localhost' ;
| Grants for rt_user@localhost
|
| GRANT USAGE ON *.* TO 'rt_user'@'localhost' IDENTIFIED BY
PASSWORD XXXXXXXXXXCENSOREDXXXXXXXXXXXXXXXXXXXXXXX’ |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX ON rt3
. TO
‘rt_user’@‘localhost’ |
2 rows in set (0.02 sec)
If all the above checks return sensible results, then your database is
in good
shape and you should stop here.
-
Otherwise, you need to install the RT database schema. Remember that
root password
you set up earlier? You’re going to need that now. Run the following
command as
root:
perl rt-setup-database --action init --dba root --dba-password
VafugOrmup
This will create the rt3 database, generate all the tables in it and
populate
them with the necessary initial data, plus create the
‘rt_user’@‘localhost’
user and set a password for it. It will prompt you for anything else
it needs.
Cheers,
Matthew
-----Original Message-----
From: Matthew Seaman [mailto:m.seaman@infracaninophile.co.uk]
Sent: Friday, December 25, 2009 12:34 AM
To: Zach Boettner
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] rt-3.8.6 is already installed… Error code 1
Zach Boettner wrote:
Ok, now when I put the PerlRequire /usr/local/bin/webmux.pl in my
httpd.conf, apache fails to restart and I get the following in my apache
error log file. If I comment out the PerlRequire statement apache will
run
and I get the BestPractical - You’re almost there web page. Does the
following errors indicate a problem with my mysql config or my
RT_SiteConfig.pm???
[Thu Dec 24 08:23:38 2009] [notice] SIGHUP received. Attempting to
restart
[Thu Dec 24 08:23:38 2009] [warn] (22)Invalid argument: Failed to enable
the
‘htt
pready’ Accept Filter
[Thu Dec 24 08:23:41 2009] [error] Can’t use an undefined value as an
ARRAY
refer
ence at /usr/local/lib/perl5/site_perl/5.8.9/RT/Handle.pm line
278.\nCompilation
failed in require at (eval 4) line 1.\n
[Thu Dec 24 08:23:41 2009] [error] Can’t load Perl file:
/usr/local/bin/webmux.pl
for server freebsd8.bchq.local:80, exiting…
[Thu Dec 24 08:23:51 2009] [error] Can’t use an undefined value as an
ARRAY
refer
ence at /usr/local/lib/perl5/site_perl/5.8.9/RT/Handle.pm line
278.\nCompilation
failed in require at (eval 4) line 1.\n
[Thu Dec 24 08:23:51 2009] [error] Can’t load Perl file:
/usr/local/bin/webmux.pl
for server freebsd8.bchq.local:80, exiting…
[Thu Dec 24 08:23:54 2009] [error] Can’t use an undefined value as an
ARRAY
refer
ence at /usr/local/lib/perl5/site_perl/5.8.9/RT/Handle.pm line
278.\nCompilation
failed in require at (eval 4) line 1.\n
[Thu Dec 24 08:23:54 2009] [error] Can’t load Perl file:
/usr/local/bin/webmux.pl
for server freebsd8.bchq.local:80, exiting…
It’s blowing up in this chunk of code (in RT::Handle) –
277 if ( $state eq ‘post’ ) {
278 my $create_table = $dbh->selectrow_arrayref(“SHOW
CREATE
TABLE Tickets”)->[1];
279 unless ( $create_table =~
/(?:ENGINE|TYPE)\s*=\s*InnoDB/i ) {
280 return (0, “RT requires that all its tables be of
InnoDB type. Upgrade RT tables.”);
281 }
282 }
which suggests that you’ve got database problems. Possibly that the rt
database
schema hasn’t been installed. Try running that command from mysql client.
You
should get output like this:
mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 63618
Server version: 5.0.84-log FreeBSD port: mysql-server-5.0.84
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input
statement.
mysql> use rt3
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SHOW CREATE TABLE Tickets \G
*************************** 1. row ***************************
Table: Tickets
Create Table: CREATE TABLE Tickets
(
id
int(11) NOT NULL auto_increment,
EffectiveId
int(11) NOT NULL default ‘0’,
Queue
int(11) NOT NULL default ‘0’,
Type
varchar(16) character set ascii default NULL,
IssueStatement
int(11) NOT NULL default ‘0’,
Resolution
int(11) NOT NULL default ‘0’,
Owner
int(11) NOT NULL default ‘0’,
Subject
varchar(200) character set utf8 collate utf8_unicode_ci
default
‘[no subject]’,
InitialPriority
int(11) NOT NULL default ‘0’,
FinalPriority
int(11) NOT NULL default ‘0’,
Priority
int(11) NOT NULL default ‘0’,
TimeEstimated
int(11) NOT NULL default ‘0’,
TimeWorked
int(11) NOT NULL default ‘0’,
Status
varchar(10) character set ascii default NULL,
TimeLeft
int(11) NOT NULL default ‘0’,
Told
datetime default NULL,
Starts
datetime default NULL,
Started
datetime default NULL,
Due
datetime default NULL,
Resolved
datetime default NULL,
LastUpdatedBy
int(11) NOT NULL default ‘0’,
LastUpdated
datetime default NULL,
Creator
int(11) NOT NULL default ‘0’,
Created
datetime default NULL,
Disabled
smallint(6) NOT NULL default ‘0’,
PRIMARY KEY (id
),
KEY Tickets1
(Queue
,Status
),
KEY Tickets2
(Owner
),
KEY Tickets6
(EffectiveId
,Type
)
) ENGINE=InnoDB AUTO_INCREMENT=348 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
Cheers,
Matthew
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
Kent, CT11 9PW