GhostBSD with Apache and php-admin for MySQL

Need support for GhostBSD. Ask here if your question does not fit elsewhere.
Post Reply
hank2000
Posts: 253
Joined: Mon Sep 16, 2013 9:42 am

GhostBSD with Apache and php-admin for MySQL

Post by hank2000 »

Hi Eric, ASX and others

I m ashamed I have to at least try and ask but:

I don t have success getting Apache with PHP and mywebSQL running smoothly on my GhostBSD 10.3!
I thought I could almost copy the steps 1:1 from my Suse installation (except for compl. different pathes of course ;-) ) and add some stuff from well known forums, but:

- I have a running Webserver (´It works` :) ) and can access the login-page from mywebSQL so far, but not via Alias, via call of the index.php file from it.
- I gave user group access to cups, mysql, www and wheel
- root directory has read,write,execute for owner root, read, write, execute for group ´wheel´ (right now) and read for ´others´!
- the output of my httpd.conf-additions is:

.AddType application/x-httpd-php .php
.AddType application/x-httpd-php-source .phps

.Alias /mywebsql /usr/local/www/mywebsql
.AcceptPathInfo On
.<Directory "/usr/local/www/mywebsql/">
. Options FollowSymlinks
. Order Deny,Allow
. Allow from all
.</Directory>

Strange thing is:
when I start the URL request with "http://localhost/mywebsql/" I get the usual "forbidden" error I found so often in forums
when I start with "http://localhost/mywebsql/index.php" I get the login form, but the default user ´mysql´ without password, as works on commandline, gets another "forbidden... (403)" error when trying to login, THEN when restarting this URL (....index.php) I don t get an error but the database window I usually get on Linux after login and then selecting a database gets me the next 403 error...???
maybe I tried too much from too many forums but I am completely confused now and would really appreciate some fresh ideas where I m too stupid for the right configuration!
strange too: when reloading the index.php page I get THE following page that was rejected in the first place, same with the next page, after login the "database overview page" is rejected and with next index.php loading it gets on instead of a login etc., what am I doin wrong?
Let me know what output to add as well...
Thanks in advance - til then I ll do MySQL administration on Linux... :oops:

best
Achim
hank2000
Posts: 253
Joined: Mon Sep 16, 2013 9:42 am

Re: GhostBSD with Apache and php-admin for MySQL

Post by hank2000 »

additional info:

- MariaDB 10.0.29 is installed as MariaDB 55 seems buggy and causes error11 when installed!
- MySQL56 was tried but needs horrendous RAM ressources, up to 95%, therefor not suitable for my netbook with 1GB!
- I couldn t install several apache24-modules, as they conflict with MariaDB 10.0x, better to try and compile from ports?
- add. to adding user to the groups mentioned before I tried to chown directories to either group wheel and/or www but same effect concerning error message 403.
so still confused where to change s.th. for the better!

best
Achim
hank2000
Posts: 253
Joined: Mon Sep 16, 2013 9:42 am

Re: GhostBSD with Apache and php-admin for MySQL

Post by hank2000 »

well:

at least I could restore most of the directory path privilegies, maybe one or two writings and executings too much, but everything is running like before; pfuuu! :shock:
I don t know what exactly is to configure in httpd.conf, but commenting out all Directory directives with "deny" in and put them to "allow" helped at least to get the login screen of myWebSQL AND to login with mysql users that have enhanced privilegies with database handling ( and a MySQL "root" of course).
But I still get a few error messages within myWebSQL and I m not happy with my apache-conf file either of course, so any help on getting a secure system AND a working MySQL-PHP-administration would be greatly appreciated! ;)

best
Achim
hank2000
Posts: 253
Joined: Mon Sep 16, 2013 9:42 am

Re: GhostBSD with Apache and php-admin for MySQL

Post by hank2000 »

last update:

managed to solve most things now except one:

I can t start the myWebSQL php-tool with the usual URL like with Suse, have to add the index.php there to get the login mask.
WHEN I login then, I only get the directory tree shown in browser, when I then click on that index.php again, I m put trough to the right user/Database selection, that should orig. come after pressing "login"!
I put in the "AddType" lines for php in httpd.conf and gave the right permissions to this directory tree, but it still acts diff. to its Suse Linux part...
work WITHIN myWebSQL and the databases works fine then, but login and first choose keeps confusing...

best

Achim
Jes
Posts: 42
Joined: Sun Dec 25, 2016 2:43 pm
Location: Spain
Contact:

Re: GhostBSD with Apache and php-admin for MySQL

Post by Jes »

If you don't mind use nginx instead of apache, the configuration is pretty simple:

(replace versions with those must apply)

pkg install nginx-1.6.2_1,2
pkg install phpMyAdmin-4.3.3
pkg install php5-extensions-1.7

chown -R www:www /usr/local/www/phpMyAdmin
ln -s /usr/local/www/phpMyAdmin /usr/local/www/nginx

edit /usr/local/etc/php-fpm.conf :

[global]
events.mechanism = kqueue
[www]
listen = /var/run/php-fpm.sock
listen.owner = www
listen.group = www
listen.mode = 0666


edit /usr/local/etc/nginx/nginx.conf and make the 'server' section appears like:

server {
listen 80;
server_name localhost 127.0.0.1;
root /usr/local/www/nginx;
index index.php index.html index.htm;

location / {
try_files $uri $uri/ =404;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}


edit /etc/rc.conf :

php_fpm_enable="YES"
nginx_enable="YES"

then initiate php_fpm and nginx services.

check installation pointing your browser to http://localhost/phpmyadmin/index.php

BR

Jes
hank2000
Posts: 253
Joined: Mon Sep 16, 2013 9:42 am

Re: GhostBSD with Apache and php-admin for MySQL

Post by hank2000 »

Hi jes

thank You for Your detailed response, but with all mutual respect:
I did not try out dozens of possibilities to start from scrap now again and with using myWebSQL i found a very suitable solution for me I m using for over a year now.
And except for one obstacle I m through with it:

- the only problem I encounter is the connection AFTER login, where it shows the directory tree of myWebSQL instead of the surface of mywebSQL.
when I can get THIS resolved as well, afterwards I m able to work with it, then everything s fixed.
but I don t want to start anew. I m already in touch with Samnan, the main developer, and in the meantime I can do this on Linux, but I ll get there on BSD as well
in the end.

but thx for getting back.
best
Achim
Post Reply