SOLVED FreeNAS 11.3U7 & MySQL + Apache24 + PHP72 + phpMyAdmin

Joined
Jan 23, 2020
Messages
9
Hallo zusammen!

Nachdem ich seit Wochen schon stiller Mitleser bin und aus der Windows-Ecke schon so viel gelernt habe, stoße ich inzwischen an meine Grenzen und hoffe auf ein wenig Schwarmwissen.

Ausgangssituation
Derzeit läuft bei mir ein QNAP TS231 - eine inzwischen extrem lahme Krücke. Im Wesentlichen hat es drei Aufgaben:
  • Speicher für Backups von allen PC im Netzwerk
  • Speicher für meine beruflichen Daten (als Langzeit-Archiv)
  • Webserver für mein CRM-Tool (unter PHP56 läuft das webbasierte Tool "Xentral")
Da PHP56 schon sehr alt ist und ich bald ein Update von Xentral machen möchte, was aber PHP72 voraussetzt, hat das QNAP ausgedient. Wegen der nicht gegebenen Flexibilität fällt QNAP sogar komplett raus und so kaufte ich mir die Hardware für einen eigenen Server-Aufbau. Trotz dessen, dass ich mit Linux nie etwas anfangen konnte, roote ich seit über 10 Jahren meine Smartphones. Doch so leicht wie auf dem QNAP ist die Installation von MySQL und phpMyAdmin unter FreeNAS wohl doch nicht. Es will partout nicht klappen. Ich habe nun schon bestimmt 10 Youtube-Videos gesehen und mindestens 20 verschiedene Text-Tutorials gelesen. Alle führen an verschiedenen Stellen zu unterschiedlichen Fehlern. Und nun hoffe ich auf euch... :)

Wenn ich es richtig verstanden habe, kann man unter FreeNAS nie direkt Erweiterungen installieren, sondern immer nur in Jails. Klingt nach mehr Sicherheit. Also fein ein Test-Jail eingerichtet. Ich nutze für die Befehle PuTTY 0.73.

Zuletzt habe ich mich an diese Anleitung gehalten:

Im Sinne der besseren Lesbarkeit setze ich alle Kommandozeilen-Kopien in Spoiler und kommentiere drunter meine Fragen.

PKG Update
root@CRMtest:/ # pkg update
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
[CRMtest] Installing pkg-1.12.0...
[CRMtest] Extracting pkg-1.12.0: 100%
Updating FreeBSD repository catalogue...
[CRMtest] Fetching meta.txz: 100% 944 B 0.9kB/s 00:01
[CRMtest] Fetching packagesite.txz: 100% 6 MiB 6.5MB/s 00:01
Processing entries: 100%
FreeBSD repository update completed. 31862 packages processed.
All repositories are up to date.

Scheint alles okay zu sein.

PKG Upgrade
root@CRMtest:/ # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
Checking for upgrades (1 candidates): 100%
Processing candidates (1 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

Scheint alles okay zu sein.

MySQL
root@CRMtest:/ # pkg search mysql
mysql55-client-5.5.62_3 Multithreaded SQL database (client)
mysql55-server-5.5.62_3 Multithreaded SQL database (server)
mysql56-client-5.6.47 Multithreaded SQL database (client)
mysql56-server-5.6.47 Multithreaded SQL database (server)
mysql57-client-5.7.29 Multithreaded SQL database (client)
mysql57-server-5.7.29 Multithreaded SQL database (server)
mysql80-client-8.0.19 Multithreaded SQL database (client)
mysql80-server-8.0.19 Multithreaded SQL database (server)

root@CRMtest:/ # pkg install mysql80-server mysql80-client
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 15 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
mysql80-server: 8.0.19
mysql80-client: 8.0.19
perl5: 5.30.1
curl: 7.67.0
libnghttp2: 1.40.0
ca_root_nss: 3.49.1
protobuf: 3.9.2,1
libunwind: 20170615
libevent: 2.1.11
libedit: 3.1.20191211,1
icu: 65.1,1
zstd: 1.4.4
liblz4: 1.9.2,1
cyrus-sasl: 2.1.27
openldap-client: 2.4.48

Number of packages to be installed: 15

The process will require 432 MiB more space.
52 MiB to be downloaded.

Proceed with this action? [y/N]: y
[CRMtest] [1/15] Fetching mysql80-server-8.0.19.txz: 100% 17 MiB 8.9MB/s 00:02
[CRMtest] [2/15] Fetching mysql80-client-8.0.19.txz: 100% 4 MiB 3.7MB/s 00:01
....gekürzt...
[CRMtest] [14/15] Extracting mysql80-client-8.0.19: 100%
[CRMtest] [15/15] Installing mysql80-server-8.0.19...
===> Creating groups.
Creating group 'mysql' with gid '88'.
===> Creating users
Creating user 'mysql' with uid '88'.
[CRMtest] [15/15] Extracting mysql80-server-8.0.19: 100%
=====
Message from ca_root_nss-3.49.1:

--
FreeBSD does not, and can not warrant that the certification authorities
whose certificates are included in this package have in any way been
audited for trustworthiness or RFC 3647 compliance.

Assessment and verification of trust is the complete responsibility of the
system administrator.

This package installs symlinks to support root certificates discovery by
default for software that uses OpenSSL.

This enables SSL Certificate Verification by client software without manual
intervention.

If you prefer to do this manually, replace the following symlinks with
either an empty file or your site-local certificate bundle.

* /etc/ssl/cert.pem
* /usr/local/etc/ssl/cert.pem
* /usr/local/openssl/cert.pem
=====
Message from perl5-5.30.1:

--
The /usr/bin/perl symlink has been removed starting with Perl 5.20.
For shebangs, you should either use:

#!/usr/local/bin/perl

or

#!/usr/bin/env perl

The first one will only work if you have a /usr/local/bin/perl,
the second will work as long as perl is in PATH.
=====
Message from cyrus-sasl-2.1.27:

--
You can use sasldb2 for authentication, to add users use:

saslpasswd2 -c username

If you want to enable SMTP AUTH with the system Sendmail, read
Sendmail.README

NOTE: This port has been compiled with a default pwcheck_method of
auxprop. If you want to authenticate your user by /etc/passwd,
PAM or LDAP, install ports/security/cyrus-sasl2-saslauthd and
set sasl_pwcheck_method to saslauthd after installing the
Cyrus-IMAPd 2.X port. You should also check the
/usr/local/lib/sasl2/*.conf files for the correct
pwcheck_method.
If you want to use GSSAPI mechanism, install
ports/security/cyrus-sasl2-gssapi.
If you want to use SRP mechanism, install
ports/security/cyrus-sasl2-srp.
If you want to use LDAP auxprop plugin, install
ports/security/cyrus-sasl2-ldapdb.
=====
Message from openldap-client-2.4.48:

--
The OpenLDAP client package has been successfully installed.

Edit
/usr/local/etc/openldap/ldap.conf
to change the system-wide client defaults.

Try `man ldap.conf' and visit the OpenLDAP FAQ-O-Matic at
http://www.OpenLDAP.org/faq/index.cgi?file=3
for more information.
=====
Message from mysql80-client-8.0.19:

--
This is the mysql CLIENT without the server.
for complete server and client, please install databases/mysql80-server
=====
Message from mysql80-server-8.0.19:

--
There is no initial password for first time use of MySQL.
Keep in mind to reset it to a secure password.

MySQL80 has a default %%ETCDIR%%/my.cnf,
remember to replace it with your own
or set `mysql_optfile="$YOUR_CNF_FILE` in rc.conf.

root@CRMtest:/ # sysrc mysql_enable="yes"
mysql_enable: -> yes

root@CRMtest:/ # service mysql-server start
Starting mysql.

root@CRMtest:/ # cat $HOME/.mysql_secret
cat: /root/.mysql_secret: No such file or directory

Bis zum Ende glaubte ich eine aktuelle Anleitung gefunden zu haben. Doch am Ende gibt es dann doch einen Fehler, den ich so gar nicht verstehe.
Nach einer der vielen anderen Tutorials klappte dieser Befehl mit wurde ein Passwort angezeigt. Bin davon ausgegangen, dass hier nun aber schlicht gar kein Passwort gesetzt wurde und machte daher mit der "mysql_secure_installation" weiter...

root@CRMtest:/ # mysql_secure_installation
mysql_secure_installation: [ERROR] unknown variable 'prompt=\u@\h [\d]>\_'.

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 1
Please set the password for root here.

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.

- Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!

Nach Setzen eines neuen Passwortes wurde mir die Sicherheit mit 100% bestätigt. Dann kam allerdings gleich die Frage
Code:
Do you wish to continue with the password provided? : y

Laut Tutorial hätte kommen sollen
Code:
Change the password for root ? : y
Do you wish to continue with the password provided? : y


Der Test-Login in MySQL scheint geklappt zu haben:
root@CRMtest:/ # mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.19 Source distribution

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

root@localhost [(none)]> exit
Bye

Apache24-Server
root@CRMtest:/ # pkg install apache24
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 10 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
apache24: 2.4.41
libxml2: 2.9.10
expat: 2.2.8
pcre: 8.43_2
apr: 1.7.0.1.6.1
gdbm: 1.18.1_1
indexinfo: 0.3.1
readline: 8.0.1
gettext-runtime: 0.20.1
db5: 5.3.28_7

Number of packages to be installed: 10

The process will require 93 MiB more space.
21 MiB to be downloaded.

Proceed with this action? [y/N]: y
[CRMtest] [1/10] Fetching apache24-2.4.41.txz: 100% 5 MiB 1.7MB/s 00:03
[CRMtest] [2/10] Fetching libxml2-2.9.10.txz: 100% 823 KiB 842.3kB/s 00:01
[CRMtest] [3/10] Fetching expat-2.2.8.txz: 100% 124 KiB 127.4kB/s 00:01
....gekürzt...
[CRMtest] [9/10] Installing apr-1.7.0.1.6.1...
[CRMtest] [9/10] Extracting apr-1.7.0.1.6.1: 100%
[CRMtest] [10/10] Installing apache24-2.4.41...
===> Creating groups.
Using existing group 'www'.
===> Creating users
Using existing user 'www'.
[CRMtest] [10/10] Extracting apache24-2.4.41: 100%
=====
Message from apr-1.7.0.1.6.1:

--
The Apache Portable Runtime project removed support for FreeTDS with
version 1.6. Users requiring MS-SQL connectivity must migrate
configurations to use the added ODBC driver and FreeTDS' ODBC features.
=====
Message from apache24-2.4.41:

--
To run apache www server from startup, add apache24_enable="yes"
in your /etc/rc.conf. Extra options can be found in startup script.

Your hostname must be resolvable using at least 1 mechanism in
/etc/nsswitch.conf typically DNS or /etc/hosts or apache might
have issues starting depending on the modules you are using.


- apache24 default build changed from static MPM to modular MPM
- more modules are now enabled per default in the port
- icons and error pages moved from WWWDIR to DATADIR

If build with modular MPM and no MPM is activated in
httpd.conf, then mpm_prefork will be activated as default
MPM in etc/apache24/modules.d to keep compatibility with
existing php/perl/python modules!

Please compare the existing httpd.conf with httpd.conf.sample
and merge missing modules/instructions into httpd.conf!

root@CRMtest:/ # sysrc apache24_enable="YES"
apache24_enable: -> YES

Dann gab es am Ende beim Restart des Apache-Servers den nächsten Fehler:
root@CRMtest:/ # service apache24 start
Performing sanity check on apache24 configuration:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Starting apache24.
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

Ich bin ehrlich: ich kann damit nichts anfangen und habe ich keine Ahnung, wo ich was in welcher config-Datei ändern muss.

PHP72
root@CRMtest:/ # pkg install mod_php72 php72-session php72-xml php72-ctype php72-openssl php72-filter php72-gd php72-json php72-mysqli php72-mbstring php72-zlib php72-zip php72-bz2
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 37 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
mod_php72: 7.2.26
php72-session: 7.2.26
php72-xml: 7.2.26
php72-ctype: 7.2.26
php72-openssl: 7.2.26
php72-filter: 7.2.26
php72-gd: 7.2.26
php72-json: 7.2.26
php72-mysqli: 7.2.26
php72-mbstring: 7.2.26
php72-zlib: 7.2.26
php72-zip: 7.2.26
php72-bz2: 7.2.26
libargon2: 20190702
php72: 7.2.26
libXpm: 3.5.12_2
libXext: 1.3.4,1
libXau: 1.0.9
libX11: 1.6.9,1
libxcb: 1.13.1
libXdmcp: 1.1.3
xorgproto: 2019.2
libpthread-stubs: 0.4
libXt: 1.2.0,1
libSM: 1.2.3,1
libICE: 1.0.10,1
freetype2: 2.10.1
png: 1.6.37
jpeg-turbo: 2.0.3
libgd: 2.2.5_2,1
fontconfig: 2.12.6,1
webp: 1.0.3_1
tiff: 4.1.0
jbigkit: 2.1_1
giflib: 5.2.1
oniguruma: 6.9.3
libzip: 1.5.2

Number of packages to be installed: 37

The process will require 70 MiB more space.
14 MiB to be downloaded.

Proceed with this action? [y/N]: y
[CRMtest] [1/37] Fetching mod_php72-7.2.26.txz: 100% 1 MiB 1.3MB/s 00:01
[CRMtest] [2/37] Fetching php72-session-7.2.26.txz: 100% 36 KiB 36.4kB/s 00:01
[CRMtest] [3/37] Fetching php72-xml-7.2.26.txz: 100% 20 KiB 20.8kB/s 00:01
....gekürzt...
[CRMtest] [37/37] Installing php72-bz2-7.2.26...
[CRMtest] [37/37] Extracting php72-bz2-7.2.26: 100%
=====
Message from freetype2-2.10.1:

--
The 2.7.x series now uses the new subpixel hinting mode (V40 port's option) as
the default, emulating a modern version of ClearType. This change inevitably
leads to different rendering results, and you might change port's options to
adapt it to your taste (or use the new "FREETYPE_PROPERTIES" environment
variable).

The environment variable "FREETYPE_PROPERTIES" can be used to control the
driver properties. Example:

FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
cff:no-stem-darkening=1 \
autofitter:warping=1

This allows to select, say, the subpixel hinting mode at runtime for a given
application.

If LONG_PCF_NAMES port's option was enabled, the PCF family names may include
the foundry and information whether they contain wide characters. For example,
"Sony Fixed" or "Misc Fixed Wide", instead of "Fixed". This can be disabled at
run time with using pcf:no-long-family-names property, if needed. Example:

FREETYPE_PROPERTIES=pcf:no-long-family-names=1

How to recreate fontconfig cache with using such environment variable,
if needed:
# env FREETYPE_PROPERTIES=pcf:no-long-family-names=1 fc-cache -fsv

The controllable properties are listed in the section "Controlling FreeType
Modules" in the reference's table of contents
(/usr/local/share/doc/freetype2/reference/site/index.html, if documentation was installed).
=====
Message from mod_php72-7.2.26:

--
Make sure index.php is part of your DirectoryIndex.

You should add the following to your Apache configuration file:

<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>

If you are building PHP-based ports in poudriere(8) or Synth with ZTS enabled,
add WITH_MPM=event to /etc/make.conf to prevent build failures.
=====
Message from php72-session-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-18-session.ini
=====
Message from php72-xml-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-xml.ini
=====
Message from php72-ctype-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-ctype.ini
=====
Message from php72-openssl-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-openssl.ini
=====
Message from php72-filter-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-filter.ini
=====
Message from php72-gd-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-gd.ini
=====
Message from php72-json-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-json.ini
=====
Message from php72-mysqli-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-mysqli.ini
=====
Message from php72-mbstring-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-mbstring.ini
=====
Message from php72-zlib-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-zlib.ini
=====
Message from php72-zip-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-zip.ini
=====
Message from php72-bz2-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-bz2.ini

root@CRMtest:/ # cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

Hier scheint alles geklappt zu haben. Einige Hinweise werden zwar angezeigt, aber die scheinen nicht weiter wichtig zu sein. Zumindest scheint PHP ohne Fehler zu laufen.
Code:
root@CRMtest:/ # php -v
PHP 7.2.26 (cli) (built: Jan  2 2020 01:31:05) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies


Mit nano werde ich nicht warm, daher Anpassung von
direkt über FileZilla/Notepad++:

Ergänzung Verzeichnisindex:

<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>

Ergänzung am Ende der Datei:

<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>


<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>

Nach Anpassung der Apache-Config wieder der Fehler bezüglich des ServerName
root@CRMtest:/ # service apache24 restart
Performing sanity check on apache24 configuration:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Stopping apache24.
Waiting for PIDS: 16085.
Performing sanity check on apache24 configuration:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Starting apache24.
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
root@CRMtest:/ #

phpMyAdmin
root@CRMtest:/ # pkg install phpmyadmin
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'phpmyadmin' have been found in the repositories

root@CRMtest:/ # pkg search phpmyadmin
phpMyAdmin-php72-4.9.4 Set of PHP-scripts to manage MySQL over the web
phpMyAdmin-php73-4.9.4 Set of PHP-scripts to manage MySQL over the web
phpMyAdmin-php74-4.9.4 Set of PHP-scripts to manage MySQL over the web
phpMyAdmin5-php72-5.0.1 Set of PHP-scripts to manage MySQL over the web
phpMyAdmin5-php73-5.0.1 Set of PHP-scripts to manage MySQL over the web
phpMyAdmin5-php74-5.0.1 Set of PHP-scripts to manage MySQL over the web

root@CRMtest:/ # pkg install phpMyAdmin5-php72-5.0.1
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
phpMyAdmin5-php72: 5.0.1
php72-hash: 7.2.26

Number of packages to be installed: 2

The process will require 44 MiB more space.
8 MiB to be downloaded.

Proceed with this action? [y/N]: y
[CRMtest] [1/2] Fetching phpMyAdmin5-php72-5.0.1.txz: 100% 8 MiB 2.8MB/s 00:03
[CRMtest] [2/2] Fetching php72-hash-7.2.26.txz: 100% 150 KiB 153.7kB/s 00:01
Checking integrity... done (0 conflicting)
[CRMtest] [1/2] Installing php72-hash-7.2.26...
[CRMtest] [1/2] Extracting php72-hash-7.2.26: 100%
[CRMtest] [2/2] Installing phpMyAdmin5-php72-5.0.1...
===> Creating groups.
Using existing group 'www'.
[CRMtest] [2/2] Extracting phpMyAdmin5-php72-5.0.1: 100%
=====
Message from php72-hash-7.2.26:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-hash.ini
=====
Message from phpMyAdmin5-php72-5.0.1:

--
phpMyAdmin5-php72-5.0.1 has been installed into:

/usr/local/www/phpMyAdmin

Please edit config.inc.php to suit your needs.

To make phpMyAdmin available through your web site, I suggest
that you add something like the following to httpd.conf:

For Apache versions earlier than 2.4:

Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"

<Directory "/usr/local/www/phpMyAdmin/">
Options none
AllowOverride Limit

Order Deny,Allow
Deny from all
Allow from 127.0.0.1 .example.com
</Directory>

For Apache version 2.4.x or above:

Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"

<Directory "/usr/local/www/phpMyAdmin/">
Options None
AllowOverride Limit

Require local
Require host .example.com
</Directory>

SECURITY NOTE: phpMyAdmin is an administrative tool that has had several
remote vulnerabilities discovered in the past, some allowing remote
attackers to execute arbitrary code with the web server's user credential.
All known problems have been fixed, but the FreeBSD Security Team strongly
advises that any instance be protected with an additional protection layer,
e.g. a different access control mechanism implemented by the web server
as shown in the example. Do consider enabling phpMyAdmin only when it
is in use.

root@CRMtest:/ # cp /usr/local/www/phpMyAdmin/config.sample.inc.php /usr/local/www/phpMyAdmin/config.inc.php

Auch hier wieder Anpassung von
direkt über FileZilla/Notepad++:
Ergänzung am Ende der Datei:

Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"

<Directory "/usr/local/www/phpMyAdmin/">
Options None
AllowOverride Limit

Require local
Require host .example.com
</Directory>

Und zum Ende nochmals der ServerName Fehler beim Restart des Apache-Servers:
root@CRMtest:/ # service apache24 restart
Performing sanity check on apache24 configuration:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Stopping apache24.
Waiting for PIDS: 16756.
Performing sanity check on apache24 configuration:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Starting apache24.
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
root@CRMtest:/ #


Ich habe das Gefühl, dem Ziel schon verdammt nahe zu sein.
Wenn ich die IP des NAS aufrufe, dann kommt "It Works". Prima:cool:
Gehe ich auf 192.168.178.XXX/phpmyadmin, kommt ein 404er mit
Not Found
The requested URL was not found on this server.
Habe mal zum Test index.php hinter der URL gesetzt. Und dann kam plötzlich die phpMyAdmin Loginmaske. Allerdings kam ich partout nicht rein. Egal, welche User-Passwort-Kombi ich nutzte.

Ich weiß nicht mehr weiter und finde leider kein aktuelles Tutorial für FreeNAS und MySQL + Apache24 + PHP72/73 + phpMyAdmin. In Teilen finde ich Anleitungen für FreeBSD, aber selbst wenn ich MySQL nach der einen und Apache24 nach einer anderen und phpMyAdmin wieder unter einer anderen Anleitung installiere, komme ich am Ende dennoch nicht zum Ziel.
 

micneu

Patron
Joined
Mar 23, 2019
Messages
473
moin, ich muss mal nachfragen du machst das alles in einer jail oder?

mit den packeten habe ich meinen FAMP installiert:

Code:
pkg install mod_php72-0.7.2_2 php72-zip-7.2_2 php72-xmlrpc-7.2_2 php72-xml-7.2_2 php72-readline-7.2_2 php72-opcache-7.2_2 php72-pdo_mysql-7.2_2 php72-mbstring-7.2_2 php72-json-7.2_2 php72-intl-7.2_2 php72-gd-7.2_2 php72-curl-7.2_2 php72-mysqli-7.2_2 mysql56-client-5.6.47 mysql56-server-5.6.47 php72-pear-MDB2_Driver_mysql-1.5.0.b4
 
Joined
Jan 23, 2020
Messages
9
Moin! Ja, hatte ich oben direkt über dem verlinkten genutzten Tutorial erwähnt. Ist das nicht richtig? Dazu habe ich komischerweise nicht wirklich viele klare Aussagen gefunden, ob in Jail oder direkt in FreeNAS. Habe es mit meinem bescheidenden Englisch so verstanden, dass man direkt in FreeNAS nie etwas installieren kann.

Komme da auch nie wirklich weiter. Allein schon, wenn ich pkg update ausführe, kommt
Code:
root@freenas[~]# pkg update
Updating local repository catalogue...
pkg: Repository local load error: access repo file(/var/db/pkg/repo-local.sqlite) failed: No such file or directory
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/packagesite.txz: No such file or directory
Unable to update repository local
Error updating repositories!
root@freenas[~]#


Die von dir genannten Pakete sind etwas anders als bei mir. Interessant.
In der von mir genutzten Anleitung wurden folgende Pakete gar nicht erwähnt:
  • php72-xmlrpc
  • php72-readline
  • php72-opcache
  • php72-pdo_mysql
  • php72-intl
  • php72-curl
  • php72-mysqli
Kann es daran liegen? Sind diese PHP-Erweiterungen zwingend nötig für PHP i.V.m. phpMyAdmin und MySQL resp. MariaDB?

Hast du dafür ein bestimmtes Tutorial genutzt, oder flutscht dir das so von der Hand?

Habe auch gesehen, dass du mysql156 installiertest. Ich wollte da von Beginn an up-to-date sein und wählte sogleich mysql180.
Mein Gedanke dabei: wenn das System einmal produktiv läuft - vor allem das mir heilige CRM, mit welchem ich sämtliche Angebote & Rechnungen schreibe - dann will ich so schnell nichts updaten müssen. Nicht, dass ich mir bei einem Update den Live-Betrieb zerschieße.
Das System ist von außen eh nicht erreichbar, insofern sollten spätere Sicherheitslücken nicht gleich gravierend sein für mich. Glaube ich jedenfalls.

Ich werde morgen mal ein weiteres Jail zum Testen einrichten und die Version 1.56 von MySQL installieren. Vielleicht komme ich damit weiter.
 

micneu

Patron
Joined
Mar 23, 2019
Messages
473
recherche, erfahrung, bin it-systemadministrator.
hatte bei mir ein shopsystem getestet und das wollte nicht, erst als ich diese packete noch nachinstallierte ging das system, deshalb installiere ich die jetzt immer mit.
 

micneu

Patron
Joined
Mar 23, 2019
Messages
473
und phpmysql kannst du dir auch sparen, ich lege die datenbanken übers terminal ein:


Code:
Datenbank erstellen und Benutzer

CREATE DATABASE shop; # shop ist der datenbank name
CREATE USER 'shop'@'localhost' IDENTIFIED BY 'shop'; # 'shop' ist das passwort
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON shop.* TO 'shop'@'localhost'; # 'shop'@'localhost' zugriff auf die datenbank nur über localhost
FLUSH PRIVILEGES;


mal auf die schnelle, hoffe das hat dir geholfen.
 

micneu

Patron
Joined
Mar 23, 2019
Messages
473
kann es sein das du den titel die falsche version geschrieben hast.
ich habe gerade geschaut, ich habe nur die "FreeNAS 11.2-U7" gefunden keine "FreeNAS 11.3U7"
das könnte irgend wann zu Verwirrung führen.
 
Joined
Jan 23, 2020
Messages
9
Ja stimmt... vertippt. Habe die 11.2U7.
Wo kann ich das ändern? Ich finde hier nirgends einen Button zum Ändern eines Posts o.ä.

Den Code schaue ich mir morgen in Ruhe an.

Das mit phpmysql fand ich schon verwirrend. In der einen Anleitung standen phpmysql und phpmysqli (mit einem i am Ende!) und in einer anderen wieder nicht.

In deinem Code oben unter Post 2 hast du auch dieses Paket phpmysqli mit dem i am Ende...
Also phpmysql nicht, phpmysqli aber ja?
 
Joined
Jan 28, 2020
Messages
1
Hi,
Code:
ln -s /usr/local/www/phpMyAdmin /usr/local/www/apache24/data/phpmyadmin

damit sollte es funktionieren...
 
Joined
Jan 23, 2020
Messages
9
Hi,
Code:
ln -s /usr/local/www/phpMyAdmin /usr/local/www/apache24/data/phpmyadmin

damit sollte es funktionieren...

Korrekt, @thejoker230580! Das ist aber nur ein Fehler in der Anleitung. Inzwischen stellte sich heraus, dass die gesamte von mir genutzte Anleitung so gar nicht zu den von mir verwendeten Versionen der Pakete von Apache, PHP und phpMyadmin passte.
Das habe aber zugegeben nicht ich herausgefunden, sondern ein externer IT-Experte.

Nun habe ich andere Versionen genutzt (allerdings selbst da an einigen Stellen nachhelfen müssen) und alles war in knapp unter einer Stunde installiert (ich habe mit IT beruflich nichts zu tun und bin mit der kurzen Zeit ohne Fehlermeldungen sehr glücklich).

Ich werde beizeiten mal einen genauen Ablauf für FreeNAS 11.2U7 und PHP74 und Apache24 und phpMyAdmin5 & MySQL80 zusammenfassen und für Leute wie mich (*) veröffentlichen. Denn ich habe bis heute keine einzige Anleitung gefunden, nach der das fehlerfrei klappt. Das wundert mich allerdings sehr. Bei meinen Smartphones gibt es seit Ewigkeiten genau nach Gerät sortiert gute Anleitungen hinsichtlich root, xposed-frameworks, xprivacylua, afwall+ und und und..... Hätte niemals gedacht, dass beim Thema Eigenbau-NAS Tutorials so rar gesät sind.

(*) = Leute, die von Linux keine Ahnung haben, jedoch aus abartig geschlossenen Strukturen ausbrechen möchten, lesen können und Abläufe anhand von ToDo's nachstellen können. :cool:
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
may I ask why you are using Mysql while most of the internet moved to Mariadb?
 
Joined
Jan 23, 2020
Messages
9
Finales Feedback (sorry, dass jetzt erst, hatte meinen Thread etwas aus den Augen verloren...):

Mein Problem kann als gelöst betrachtet werden.

Wie in einem oberen Post erwähnt, hatte ich letztes Jahr einen IT-Spezi beauftragt, sich meines Problems anzunehmen.
Da ich in den letzten Tagen abermals in einem Jail eine ähnliche Installation zum Laufen bringen wollte, stieß ich nun doch wieder auf die selben Probleme.

1. Problem:
ich nutzte den vermutlich falschen Befehl für die SQL-Datenbank, nämlich
Code:
pkg install mysql80-server mysql80-client

anstatt
Code:
pkg install mysql80-server mysql80-server
.

Bei Wahl der Server-Version ging es am Ende der MySQL-Installation normal weiter. (MariaDB testete ich jetzt nicht weiter, aber ich glaube da letztes auch die Client-Version genommen zu haben, was zu einem ähnlichen Fehler führte).

2.Problem:
die Versionen waren nicht perfekt kompatibel miteinander.
Letztlich klappte die gesamte Installation mit folgender Installations-Reihenfolge und Versionswahl:
  1. PKG Update/Upgrade
  2. pkg install --yes mysql80-server
  3. mysql_secure_installation
  4. pkg install --yes apache24
  5. pkg install --yes php74 mod_php74 php74-curl php74-simplexml php74-iconv php74-pdo php74-ldap php74-imap php74-soap ioncube-php74 php74-extensions
  6. phpmyadmin5-php74
Mit den entspechenden Anpassungen an den einzelnen Stellen gelang die Installation meines CRM-Tools "Xentral", das ich nach Testen eines Updates allerdings nur noch der von mir jahrelang genutzten Version 19.* bedingungslos empfehlen kann. Ab 20.* gibt es in der OS-Version doch einige ekelige Bugs.

Ende gut, alles gut! Mein CRM läuft inzwischen auf meinem für meine Zwecke rasend schnellen Eigenbau-NAS unter FreeNAS-11.3-U5.

Sonnige Grüße
happy-drummer
 
Top