Finally I managed to do the job
This is what I did:
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/92joomla /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/92joomla
and changed:
$OUT .= " php_admin_value open_basedir /opt/joomla\n";
to:
$OUT .= " php_admin_value open_basedir /opt/joomla:/opt/gallery2\n";
Followed by:
expand-template etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith restart
Also thanx to thomasch who managed this with wordpress and gallery2