OpenNetAdmin

Track. Automate. Configure.

Home About Features Community Develop
Download this project as a tar.gz file

New Install - Creates DB, then fails on login page.

ccie4526

02-07-2012 16:22:35

Created a brand new OpenBSD 5.1 VM with Apache, MySQL 5.1.60, php 5.3.10. Then installed v11.02.10 downloaded from the site here.
Completed the initial installation successfully, then when I go to the "CLICK HERE TO START" page, I get the following error:
Syntax error in your DB config file: /ona/www/local/config/database_settings.inc.php
Please check that it contains a valid PHP formatted array, or check that you have the php cli tools installed.
You can perform this check maually using the command 'php -l /ona/www/local/config/database_settings.inc.php'.


Just to make sure I'm not smoking a green leafy substance, I review that config file... looks like it's supposed to (php header removed):

$ona_contexts=array (
'DEFAULT' =>
array (
'databases' =>
array (
0 =>
array (
'db_type' => 'mysqlt',
'db_host' => '127.0.0.1',
'db_login' => 'ona_sys',
'db_passwd' => '<removed>',
'db_database' => 'ona_default',
'db_debug' => false,
),
),
'description' => 'Default data context',
'context_color' => '#D3DBFF',
),
);


So then I run the error checker as recommended:
[1720][root@ipam:/var/www/ona/www/local/config]$ php -l ./database_settings.inc.php
No syntax errors detected in ./database_settings.inc.php


So. WTF?

ccie4526

02-07-2012 16:31:02

Interesting discovery. By default, for security, OpenBSD runs the httpd daemon in a chroot jail. When I run httpd non-chroot, then ONA works.

Ideas on what it will take to make this work chrooted?

Matt

02-07-2012 21:21:50

Well this is quite interesting. I'm not sure what the chroot jail would be doing that it would care. Obviously the webserver user had the ability to write to the directory to create the database settings file. That is usually the issue people have. Beyond this its simply php code. The php-mysql module would need to operate to talk to the database. Its possible the error response is interpreted as a syntax error when its really just not able to contact the database. I wonder how the jail is effecting phps ability to talk to mysql?

hmmm.. more digging to be done.