Ok i think i got it working under a FreeBSD jail for now. Steps i took.:
Create new FreeBSD Jail. Command line into jail.
$ pkg install -y sudo vim bash curl
$ adduser
# Username: USERNAME_YOU_LIKE
# Full name: FULLNAME_YOU_LIKE
# Uid (Leave empty for default): <Enter>
# Login group [younis]: <Enter>
# Login group is younis. Invite younis into other groups? []: wheel
# Login class [default]: <Enter>
# Shell (sh csh tcsh nologin) [sh]: bash
# Home directory [/home/younis]: <Enter>
# Home directory permissions (Leave empty for default): <Enter>
# Use password-based authentication? [yes]: <Enter>
# Use an empty password? (yes/no) [no]: <Enter>
# Use a random password? (yes/no) [no]: <Enter>
# Enter password: your_secure_password
# Enter password again: your_secure_password
# Lock out the account after creation? [no]: <Enter>
# OK? (yes/no): yes
# Add another user? (yes/no): no
# Goodbye!
$ visudo
# Uncomment next line by removing hash (#) sign
# %wheel ALL=(ALL) ALL
$ su - USERNAME_YOU_LIKE
$ sudo tzsetup
$ sudo pkg install -y apache24
$ sudo sysrc apache24_enable=yes
$ sudo service apache24 start
$ sudo pkg install -y mysql80-client mysql80-server
$ sudo sysrc mysql_enable=yes
$ sudo service mysql-server start
$ sudo mysql_secure_installation
$ sudo pkg install -y php74 php74-mysqli mod_php74 php74-filter php74-gettext php74-session
$ sudo cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
$ sudo sysrc php_fpm_enable=yes
$ sudo service php-fpm start
$ sudo nano /usr/local/etc/apache24/modules.d/001_mod-php.conf
Then add the following entries to the file:
# <IfModule dir_module>
# DirectoryIndex index.php index.html
# <FilesMatch "\.php$">
# SetHandler application/x-httpd-php
# </FilesMatch>
# <FilesMatch "\.phps$">
# SetHandler application/x-httpd-php-source
# </FilesMatch>
# </IfModule>
$ sudo apachectl configtest
$ sudo apachectl restart
$ sudo nano /usr/local/www/apache24/data/info.php
Copy the line below and paste it into the configuration file:
# <?php phpinfo(); ?>
Head over to http://your_server_IP/info.php, and see if you read “It works!”
$ sudo rm /usr/local/www/apache24/data/info.php
Edit httpd.conf file for PHP
nano /usr/local/etc/apache24/httpd.conf
Search for AddType section – and add the following two lines
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Search for DirectoryIndex line and change from:
DirectoryIndex index.html
to
DirectoryIndex index.php index.html
search for section starting with:
<Directory "/usr/local/www/apache22/data">
and scroll down to line:
AllowOverride None
and change to:
AllowOverride All
This is the Enable Mod Rewrite setting needed for Emoncms
sudo pkg install -y git
cd /usr/local/www/apache24/data
git clone https://github.com/emoncms/emoncms.git
mysql -u root -p
mysql> CREATE DATABASE emoncms;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
mysql> exit
cd /usr/local/www/apache24/data/emoncms
cp default-settings.ini settings.ini
nano settings.ini
enter in mysql username and password from earlier under sql settings
reboot
browse to your_server_IP/emoncms
sources used:
h_____ttps://linuxhint.com/install-apache-php-mysql-on-freebsd/
h_____ttps://openenergymonitor.org/forum-archive/node/2272.html
h_____ttps://bobcares.com/blog/mysql-the-server-requested-authentication-method-unknown-to-the-client/
h_____ttps://www.techpaste.com/2013/01/determine-authentication-method-active-mysql-connection/
[Formatted for presentation - Moderator (RW)]