![]() |
|
OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
Dear jggimi;
Here is my ls -l outputs: Code:
ls -l /var/mysql/ total 246180 -rw-rw---- 1 _mysql _mysql 32768 Jun 1 23:44 aria_log.00000001 -rw-rw---- 1 _mysql _mysql 52 Jun 1 23:44 aria_log_control -rw-rw---- 1 _mysql _mysql 67405 Jun 1 23:45 my_system.err -rw-rw---- 1 _mysql _mysql 5 Jun 1 23:44 my_system.pid -rw-r----- 1 _mysql _mysql 976 Jun 1 23:44 ib_buffer_pool -rw-rw---- 1 _mysql _mysql 100663296 Jun 1 23:44 ib_logfile0 -rw-rw---- 1 _mysql _mysql 12582912 Jun 1 23:44 ibdata1 -rw-rw---- 1 _mysql _mysql 12582912 Jun 1 23:44 ibtmp1 -rw-rw---- 1 _mysql _mysql 0 May 26 14:07 multi-master.info drwx------ 2 _mysql _mysql 2560 May 26 13:19 mysql drwx------ 2 _mysql _mysql 512 May 28 22:17 onedb drwx------ 2 _mysql _mysql 512 May 26 13:19 performance_schema drwx------ 2 _mysql _mysql 512 May 26 13:19 test Code:
ls -l /var/www/var/run/mysql/ total 0 srwxrwxrwx 1 _mysql _mysql 0 Jun 1 23:44 mysql.sock Code:
ls -l /etc/php-8.0 total 0 lrwxr-xr-x 1 root wheel 30 May 29 07:49 mysqli.ini -> /etc/php-8.0.sample/mysqli.ini Code:
ls -l /var/www total 56 drwxr-xr-x 2 root daemon 512 Apr 18 2021 acme drwxr-xr-x 2 root daemon 512 May 26 13:21 bin drwx-----T 2 www daemon 512 Apr 18 2021 cache drwxr-xr-x 2 root daemon 512 Apr 18 2021 cgi-bin drwxr-xr-x 3 root daemon 512 May 28 21:21 conf drwxr-xr-x 4 root daemon 512 May 26 14:09 htdocs drwxr-xr-x 2 root daemon 512 May 25 22:40 logs drwxr-xr-x 5 root daemon 512 May 26 13:23 pear drwxr-xr-x 12 root daemon 3072 May 28 21:21 phpMyAdmin drwxr-xr-x 2 root daemon 512 Jun 1 23:44 run drwx-----T 2 www www 512 Jun 1 17:22 tmp drwxr-xr-x 3 root daemon 512 May 26 13:21 usr drwxr-xr-x 3 root daemon 512 May 31 13:31 var Quote:
Code:
server "lab" { listen on * port 80 location "*.php" { fastcgi socket "/run/php-fpm.sock" } } Code:
cat /etc/httpd.conf # $OpenBSD: httpd.conf,v 1.22 2020/11/04 10:34:18 denis Exp $ #[ MACROS ] loopback = "127.0.0.1" # [ SERVERS ] server "default" { listen on $loopback port 80 root "htdocs/my_website" directory index "index.php" location "/*.php*" { fastcgi socket "/run/php-fpm.sock" } } # [ TYPES ] types { include "/usr/share/misc/mime.types" |
|
||||
![]()
My lab webserver's chroot is /var/www -- the default. My lab webserver's root directory within the chroot is /htdocs -- the default. Therefore, the physical location of the website file structure is under /var/ww/htdocs/. A URL consisting of http://<webserver>/phpMyAdmin/index.php resolves to the actual file /var/www/htdocs/phpMyAdmin/index.php -- but yours does not on your webserver. From httpd.conf(5):
Code:
root directory Configure the document root of the server. The directory is a pathname within the chroot(2) root directory of httpd. If not specified, it defaults to /htdocs. |
|
||||
![]()
In order to get phpMyAdmin working correctly, an assortment of different tools need to be functioning and integrated together. Each should be tested individually to confirm they function, and then an integration test can be performed to ensure they work together.
MariaDB (MySQL) unit test Review /etc/my.cnf and ensure that the [client-server] socket value is assigned inside /var/www. Code:
[client-server] socket=/var/www/var/run/mysql/mysql.sock Code:
$ mysql -u YourUser -pYourPassword Welcome to the MariaDB monitor. Commands end with ... PHP / mysqli extension unit test Run the PHP command line tool to confirm the mysqli extension is provisioned with PHP: Code:
$ php -r "phpinfo();" | grep parsed Additional .ini files parsed => /etc/php-8.0/mysqli.ini You have a phpinfo.php file located on your server's filesystem at /var/www/htdocs/my_website/phpinfo.php. It should contain Code:
<?php phpinfo(); ?> phpMyAdmin test Confirm you have correctly copied the complete file structure of 3,815 files from /var/www/phpMyAdmin to /var/www/htdocs/my_website/phpMyAdmin. In my case, these files were copied to /var/www/htdocs/phpMyAdmin: Code:
$ find /var/www/phpMyAdmin | wc -l 3815 $ find /var/www/htdocs/phpMyAdmin | wc -l 3815 |
|
||||
![]()
If the URL with http://localhost/phpinfo.php does not resolve correctly, double-check that localhost is provisioned correctly. Usually, this is provisioned through hosts(5) and resolv.conf(5):
|
|
|||||
![]()
Dear jggimi;
Thanks for the detailed explanation. Please let me tell you why I did this: htdocs/my_website. It's because there is another directory under that. I wanted them to be separated. Code:
>>>ls -l /var/www/htdocs/ total 8 drwxr-xr-x 2 root wheel 512 Apr 18 2021 bgplg drwxr-xr-x 3 root daemon 512 May 29 08:29 my_website Quote:
Tests: #1 Quote:
Code:
cat /etc/my.cnf [client-server] socket=/var/www/var/run/mysql/mysql.sock port=3306 Quote:
Code:
>>>mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 10.5.12-MariaDB OpenBSD port: mariadb-server-10.5.12p0v1 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> quit Bye ![]() Quote:
Code:
php -r "phpinfo();" | grep parsed Additional .ini files parsed => (none) ![]() Quote:
Code:
Additional .ini files parsed /etc/php-8.0/mysqli.ini Code:
>>>find /var/www/phpMyAdmin/ | wc -l 2993 Code:
>>>ls www/htdocs/my_website/phpMyAdmin/ | wc -l < 2993 |
|
|||||
![]() Quote:
Quote:
Quote:
Quote:
$ pkg_info -E /usr/local/bin/php and take a look at which version of PHP it is. If it isn't 8.0, then you needn't worry, because it's only PHP 8.0 that needs to be provisioned with the extension. Quote:
|
|
||||
![]()
Dear jggimi,
sorry for little late response. Quote:
Quote:
Code:
MariaDB [(none)]> CREATE USER 'user2'@'localhost' IDENTIFIED BY 'F5tYh(ikB2wq'; Code:
mysql -u user2 -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 10.5.12-MariaDB OpenBSD port: mariadb-server-10.5.12p0v1 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> quit Bye Quote:
Code:
pkg_info -E /usr/local/bin/php /usr/local/bin/php: php-7.4.23 php-7.4.23 server-side HTML-embedded scripting language Quote:
Code:
find /var/www/htdocs/my_website/phpMyAdmin/ | wc -l 2993 RECENT EDIT: I put some "index.php" file inside "/var/www/htdocs/my_website/phpMyAdmin" and it worked. It didn't ask any username or password, though. In order to land username-password page I stopped all the daemons with rcctl stop command and started them again but couldn't land on username-password page. It takes credentials by default I guess. How can land on that phpMyAdmin page which asks your username and password? So I anyways, from the first beginning I was making a huge mistake. I didn't put any index.php file into "/var/www/htdocs/my_website/phpMyAdmin". I was thinking that it resolve pages automatically. All of my php files were outside of "/var/www/htdocs/my_website/phpMyAdmin" like this: Code:
ls /var/www/htdocs/my_website/ first.php index.html index.php phpinfo.php test.php first.php~ index.html~ phpMyAdmin phpinfo.php~ Last edited by gordon.f; 3rd June 2022 at 01:39 PM. |
|
||||
![]() Quote:
Quote:
Code:
$ ls /var/www/htdocs/phpMyAdmin/ | wc -l 27 Code:
$ ls -F /var/www/htdocs/phpMyAdmin/ CONTRIBUTING.md composer.json favicon.ico print.css themes/ ChangeLog composer.lock index.php robots.txt url.php LICENSE config.inc.php js/ setup/ vendor/ README config.sample.inc.php libraries/ show_config_errors.php RELEASE-DATE-5.1.3 doc/ locale/ sql/ babel.config.json examples/ package.json templates/ Code:
# rm -r /var/www/htdocs/my_website/phpMyAdmin # cp -pR /var/www/phpMyAdmin /var/www/htdocs/my_website/ |
|
||||
![]()
Dear jggimi,
Good day. I was trying to fix this problem. It took some time. I deleted php-8.0.10 and related packages. Now I use php-7.4.23. I tested it and it works. I have phpinfo() page without a problem outside of phpMyAdmin. Now talk about the first warning(related to "twig" which was appearing at username-password page); it disappeared. Everything looks cool. In order to make sure I deleted phpMyAdmin from /my_website directory. Code:
rm -r /var/www/htdocs/my_website/phpMyAdmin Code:
ls /var/www/htdocs/my_website/ first.php index.html index.php phpinfo.php~ first.php~ index.html~ phpinfo.php test.php Code:
cp -pR /var/www/phpMyAdmin /var/www/htdocs/my_website/ Code:
ls /var/www/htdocs/my_website/ first.php index.html index.php phpinfo.php test.php first.php~ index.html~ phpMyAdmin phpinfo.php~ Code:
ls -F /var/www/htdocs/my_website/phpMyAdmin/ | wc -l 112 Code:
ls -F /var/www/phpMyAdmin/ | wc -l 112 Code:
>>>find /var/www/htdocs/my_website/phpMyAdmin/ | wc -l 2993 Code:
find /var/www/phpMyAdmin/ | wc -l 2993 Code:
>>>ls /var/www/htdocs/my_website/phpMyAdmin/ CODE_OF_CONDUCT.md robots.txt CONTRIBUTING.md schema_export.php ChangeLog server_binlog.php DCO server_collations.php LICENSE server_databases.php README server_engines.php RELEASE-DATE-4.9.5 server_export.php ajax.php server_import.php browse_foreigners.php server_plugins.php changelog.php server_privileges.php chk_rel.php server_replication.php composer.json server_sql.php composer.lock server_status.php config.inc.php server_status_advisor.php config.sample.inc.php server_status_monitor.php db_central_columns.php server_status_processes.php db_datadict.php server_status_queries.php db_designer.php server_status_variables.php db_events.php server_user_groups.php db_export.php server_variables.php db_import.php setup db_multi_table_query.php show_config_errors.php db_operations.php sql db_qbe.php sql.php db_routines.php tbl_addfield.php db_search.php tbl_change.php db_sql.php tbl_chart.php db_sql_autocomplete.php tbl_create.php db_sql_format.php tbl_export.php db_structure.php tbl_find_replace.php db_tracking.php tbl_get_field.php db_triggers.php tbl_gis_visualization.php doc tbl_import.php error_report.php tbl_indexes.php examples tbl_operations.php export.php tbl_recent_favorite.php favicon.ico tbl_relation.php gis_data_editor.php tbl_replace.php import.php tbl_row_action.php import_status.php tbl_select.php index.php tbl_sql.php js tbl_structure.php libraries tbl_tracking.php license.php tbl_triggers.php lint.php tbl_zoom_select.php locale templates logout.php themes navigation.php themes.php normalization.php transformation_overview.php package.json transformation_wrapper.php phpinfo.php url.php phpmyadmin.css.php user_password.php prefs_forms.php vendor prefs_manage.php version_check.php prefs_twofactor.php view_create.php print.css view_operations.php Code:
>>>rcctl restart php74_fpm php74_fpm(ok) php74_fpm(ok) Screenshot: https://www.imgur.com/a/Od5VQos Please view the errors below: Quote:
Quote:
Quote:
Quote:
Code:
php -r "phpinfo();" | grep parsed Additional .ini files parsed => /etc/php-7.4/mysqli.ini Code:
cat /etc/my.cnf [client-server] socket= /var/www/var/run/mysql/mysql.sock port= 3306 # This will be passed to all MariaDB clients [client] password=my_password # The MariaDB server [mysqld] # To listen to all IPv4 network addresses, use "bind-address = 0.0.0.0" bind-address=127.0.0.1 # Directory where you want to put your data #data=/var/mysql # This is the prefix name to be used for all log, error and replication files #log-basename=mysqld # Logging #general-log #slow_query_log Code:
ls /var/www/var/run/mysql/ mysql.sock Last edited by gordon.f; 4th June 2022 at 11:09 AM. |
|
||||
![]()
Congratulations on getting your phpMyAdmin application up and running! You now have a web interface into your MariaDB platform.
On my lab system, when I log in I see these same three warnings. I could continue provisioning actions to eliminate these warnings:
![]() |
|
|||
![]()
Dear jggimi;
Thanks a lot. I'm looking after those warnings and errors but can I ask did you see there is also a popup warning on the attached screenshot. It says "connection to server has been lost". What could be the problem? |
|
||||
![]()
There's no attached screenshot, and I didn't see any similar popup when connecting to my test system. Aside from our release differences, I was running the test environment in a separate guest virtual machine and connecting to it remotely, using a Firefox instance running on the host.
|
|
|||
![]()
I shared but maybe website not showing it you. Here is the link for the screenshot:
https://imgur.com/a/Od5VQos Can you view it? EDIT: I cannot view phpMyAdmin/index.php without restarting php74_fpm and when I do that I can view that page. But with an error: "Error in processing request Error code:404 Error text: Not found(rejected) It seems that the connection to server has been lost. Please check your network connectivity and server status." Last edited by gordon.f; 4th June 2022 at 12:05 PM. |
|
||||
![]()
I can see your screenshot, thank you.
The error at the beginning of the message is what you should focus on. It is an HTTP 404 error: "Not Found". But the message doesn't tell you what file was not found. There is a possibility that whatever produced this message has logged more information, either in /var/www/logs/error.log, or possibly in /var/log/php-fpm.log. Perhaps not. |
|
|||
![]() Quote:
Code:
>>>cat /var/www/logs/error.log Code:
>>>cat /var/log/php-fpm.log Code:
[04-Jun-2022 14:56:54] NOTICE: fpm is running, pid 10859 [04-Jun-2022 14:56:54] NOTICE: ready to handle connections [04-Jun-2022 15:00:45] NOTICE: Terminating ... [04-Jun-2022 15:00:45] NOTICE: exiting, bye-bye! [04-Jun-2022 15:00:46] NOTICE: fpm is running, pid 14895 [04-Jun-2022 15:00:46] NOTICE: ready to handle connections [04-Jun-2022 15:06:23] NOTICE: Terminating ... [04-Jun-2022 15:06:23] NOTICE: exiting, bye-bye! [04-Jun-2022 15:06:24] NOTICE: fpm is running, pid 47527 [04-Jun-2022 15:06:24] NOTICE: ready to handle connections I didn't understand why I couldn't see the index.php page without restarting php74_fpm. EDIT: I was trying to create a new user and got this message too. Code:
rcctl check mysqld mysqld(ok) Code:
mysql_install_db WARNING: The host 'my_system.net' could not be looked up with /usr/local/bin/resolveip. This probably means that your libc libraries are not 100 % compatible with this binary MariaDB version. The MariaDB daemon, mysqld, should work normally with the exception that host name resolving will not work. This means that you should use IP addresses instead of hostnames when specifying MariaDB privileges ! mysql.user table already exists! Run mysql_upgrade, not mysql_install_db Last edited by gordon.f; 4th June 2022 at 12:46 PM. |
|
||||
![]()
So, nothing in your logs related to the 404 error.mysql_install_db(1) should only be used when provisioning MariaDB for the very first time, and /var/mysql does not yet exist. Or if you have deleted the /var/mysql structure and wish to recreate it, starting over.
Quote:
|
|
|||
![]()
Dear jggimi;
Quote:
This is my /etc/hosts: Code:
>>>cat /etc/hosts 127.0.0.1 localhost ::1 localhost Code:
>>>gethostbyname ksh: gethostbyname: not found Code:
cat /etc/resolv.conf lookup file bind |
|
||||
![]()
Domain names such as "daemonforums.org" need to be resolved into IP addresses, such as "95.170.82.241", in order to communicate over a network. There are two ways to resolve names into addresses: 1) via one or more domain name servers that provide this as a service, or 2) via a local file on the computer that lists domain names and their IP addresses. Your OpenBSD system does not have any domain name servers provisioned. If there were any, there would be "nameserver" lines in /etc/resolv.conf. You only have a local file defining names and addresses. In that local file, you only have "localhost" defined, no other systems, and therefore no definition for "my_system.net". There are man pages that may help: the resolv.conf(5) man page and the hosts(5) man page.
Quote:
|
|
|||
![]()
Dear jggimi;
Thanks a lot. Let's see what can I achieve and I'll let you know about the result. |
![]() |
Tags |
httpd, php, phpmyadmin |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Automating the "vi /etc/httpd.conf", httpd -n, rcctl restart httpd" treadmill | J65nko | Guides | 0 | 18th May 2021 12:58 AM |
How to configure nagios-web on OpenBSD 5.8 httpd? | kleefaj | OpenBSD Packages and Ports | 0 | 11th April 2016 04:58 PM |
phpMyAdmin problems | werwer | OpenBSD General | 5 | 16th July 2010 10:53 AM |
phpMyAdmin Unaccessable | Nk2Network | OpenBSD Packages and Ports | 2 | 20th April 2009 09:13 PM |
phpMyAdmin Unaccessable | plexter | OpenBSD Packages and Ports | 3 | 16th December 2008 10:32 PM |