Forum

Problem with the database setup script

Ali
18 July 2012, 22:39
I've edited the necessary conf files and put Hiawatha Monitor in its place, then run the setup_database script for installation. First thing appeared during database setup was this message;
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0
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 /var/www/domain.tld/http/monitor/database/setup_database on line 12

After I've typed the root password for the MySQL server and hit enter, these similar messages followed;
PHP Warning:  system() has been disabled for security reasons in /var/www/domain.tld/http/monitor/database/setup_database on line 14

PHP Warning: system() has been disabled for security reasons in /var/www/domain.tld/http/monitor/database/setup_database on line 66

According to phpMyAdmin, it seems like the setup script was able to create the database and the privileged user given in the website.conf. However, there were no tables whatsoever in the database. I've tried importing the "mysql.sql" by hand but, although tables are created and filled after my attempt, I'm not able to login with the default credentials (admin:monitor -> "Login incorrect"). Also, there is a notice on top of the login screen stating:
Only variables should be passed by reference in /var/www/domain.tld/http/monitor/libraries/database/database_connection.php on line 259.


Any ideas?

PHP: v5.4.4-2 (Hiawatha is configured for PHP-FPM, but since script is pointing "/usr/bin/php", it is using cli)
Hiawatha version: 8.4
Operating System: Debian Wheezy
Ali
19 July 2012, 16:54
I've edited the cli php.ini and got rid of the "system() has been disabled" error. After dropping the database and removing the user, I've re-run the setup script. This time it finished it's job without creating any errors. Created the database and user according to the website.conf settings, also imported the mysql.sql.

However, I'm still not able to login with default admin:monitor combination and this is message still appears on top of the login screen;
Only variables should be passed by reference in /var/www/alikuru.com/http/monitor/libraries/database/database_connection.php on line 259.
Hugo Leisink
19 July 2012, 17:37
The error message can be fixed by replacing line 259 with the following code:
$parts = explode(" ", ltrim($args[0]), 2);
$statement = strtolower(array_shift($parts));

What is the content of the table 'users' in your database?

Are you the same Ali I just wrote an e-mail about error messages I keep receiving from a webserver?
Ali
19 July 2012, 19:25
Thanks for your reply Hugo, that fixed the line 259.

And, yes, that was my server annoying you Sorry about that. I was unaware of the fact that your email listed as the "Webmaster's email" on the script, so that was completely unintentional. I believe I've fixed that issue through phpMyAdmin though, now I'm getting those mails.

Here is what listed on users table:
1 	admin 	08b5411f848a2581a41672a759c87380 	NULL	0 	Administrator 	root@localhost


Still can't login.
Ali
19 July 2012, 22:15
By the way, error messages sent via email by the server have changed since I've applied your fix for the line 259.

Now, whenever I browse the monitor, whether I try to login or not, server is sending me this;
Declaration of output::transform() should be compatible with XML::transform($xslt_file) in /var/www/domain.tld/http/monitor/libraries/output.php on line 11.
Hugo Leisink
19 July 2012, 22:48
In output.php, change transform() to transform($xslt_file) on line 11.
Ali
20 July 2012, 09:08
There were'nt any "transform()"s on line 11, but I've found one on line 295 and that was the only occurrence;
public function transform() {
return false;
}

Changed it to;
public function transform($xslt_file) {
return false;
}

Didn't receive any error mails after that fix, thank you Hugo. However, I still am not able to login with default user-password (admin:monitor) combination.
Hugo Leisink
20 July 2012, 09:51
I got it. Change the 0 to 2 in the users table (column 'status').
Ali
20 July 2012, 13:59
I'm in! Thanks again Hugo
Ali
20 July 2012, 15:36
Well, I believe I've managed to broke the Hiawatha again

I've edited the hiawatha.conf with "MonitorServer = 127.0.0.1", added my virtual host configuration files "MonitorRequests = yes" and updated my crontab with the settings included in the README. I've also added the 127.0.0.1 as a webserver under CMS Menu > Webservers > New Webserver.

After a restart with new settings, Hiawatha stopped responding in a few moments. When I try to restart it, I saw the "no such process" warning again.

I switched to the test server I've setup for bug reporting to create a report regarding this issue with Valgrind. But, in this server, which hiawatha is compiled without stripping, hiawatha -k tells me that I have an error in my config.
root@testbox:~# hiawatha -k
Using /usr/local/etc/hiawatha
Reading hiawatha.conf
Syntax error in hiawatha.conf on line 17.

Line 17 is:
MonitorServer = 127.0.0.1
Hugo Leisink
20 July 2012, 16:38
If you type 'hiawatha -v', what does it say?
Ali
20 July 2012, 18:30
Alright, I've recompiled Hiawatha again and didn't forget the "-DENABLE_MONITOR=on" flag this time I've even added the "-DENABLE_COMMAND=on", so both my actual and test servers are equipped with same abilities.
root@testbox:/# hiawatha -v
Hiawatha v8.4, cache, Command Channel, IPv6, Monitor, reverse proxy, SSL, URL toolkit, XSLT
Copyright (C) by Hugo Leisink <hugo@leisink.net>

I've reproduced the error and created a bug report with Valgrind, it's on its way.
This topic has been closed.