Forum

Hiawatha monitor on freebsd

Fred
27 January 2015, 12:48
Hi,

Have have installed Hiawatha on my FreeBSD 10 server from the port tree.
I would like to use the Hiawatha monitor..

Could you please tell me on this setup work on FreeBSD?

Thank you
Fred

Hiawatha version: v9.8
Operating System: FreeBSD 10
Hugo Leisink
27 January 2015, 13:10
Please follow this HOWTO and let me know if there are any problems.
Fred
27 January 2015, 17:04
Hi,

I followed the instruction but I don't understand how to 'run the script 'database/setup_database'.
I tried via the ssh console
./setup_database
but nothing happened
I also tried
http://webcheck.mydomain.co.uk/database/setup_database


When I go to http://webcheck.mydomain.co.uk/, I get
SQL query: select * from settings where `key`='head_title' Error message: Table 'hiawatha_monitor.settings' doesn't exist 
Hugo Leisink
27 January 2015, 17:54
The script requires the command line version of PHP. Is it available on your system? The script assumes that it is present in /usr/bin by the way.
Fred
28 January 2015, 11:46
Hi,

In FreeBSD it look like php is in /usr/local/bin/php.
In order to run the script, is changing the top line to
#!/usr/local/bin/php
be enough to run it?

Thank you
Fred
Fred
28 January 2015, 12:04
Ok,
I set the right php path
#!/usr/local/bin/php
and the script does execute.
I now face another issue..
The script assume that the database is on the same server..
How do I modify the script to tell it that my DB server is located elsewhere on non standard port?

Thank you

Fred
Hugo Leisink
28 January 2015, 14:32
The script doesn't assume that. It uses the information in settings/website.conf. Change those settings before running the script.
Fred
28 January 2015, 16:34
Hi Hugo,
This is what I have in my settings/website.conf.
# Website configuration
#
CACHE_TIMEOUT = 86400
DEBUG_MODE = yes
LAYOUT_CMS = layout_cms
LAYOUT_SITE = layout_site
SESSION_TIMEOUT = 1800
SESSION_PERSISTENT = no
UPLOAD_DIRECTORY = files
WEBSITE_ONLINE = yes

# Database configuration
#
DB_HOSTNAME = 192.168.1.130:1296
DB_DATABASE = hiawatha_monitor
DB_USERNAME = hiawatha
DB_PASSWORD = gr175wt7jugvjn5rwj1lztgxnyx7ryb


My DB root user has been renamed dbadmin

when I do ./setup_database I get the following:
This script will create a MySQL user 'hiawatha' and the database 'hiawatha_monitor'.

Make sure the database settings in settings/website.conf are correct!

Enter MySQL root password: PHP Warning: system() has been disabled for security reasons in /usr/local/www/webs/monitor/database/setup_database on line 19
fyZ0Y5+mysecretpassword+I017VU2e
PHP Warning: system() has been disabled for security reasons in /usr/local/www/webs/monitor/database/setup_database on line 21

PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'192.168.1.125' (using password: YES) in /usr/local/www/webs/monitor/libraries/database/mysqli_connection.php on line 23
Can't connect to MySQL database (root@mysql).


Where does 192.168.1.125 is the web server local IP. where does it get that from?

Thank you
Hugo Leisink
29 January 2015, 09:13
For some reason, the system() command is not available. You have two options: enable it and re-run the script or create a database manually and import database/mysql.sql into it.

I see your database uses a non-default port number. The setup script can't handle that. So, if you want to use the setup script, remove the port number from DB_HOSTNAME in settings/website.conf and add it as a fifth parameter to MySQLi_connection() at lines 28 and 85 in database/setup_database.

Oh, and since you dumbed your database password on a public forum, you might want to change that too.
Fred
29 January 2015, 11:41
Thank you very much for the help:)
BTW, this isn't my real DB password

I'll let you know if this worked for me
This topic has been closed.