Algunas anotaciones personales respecto a cómo configurar un servidor Apache, PHP y MySQL en una Jail de FreeNAS.


Listar Jails

$ jls
List all your jails.
$ jls
  JID  IP Address      Hostname                      Path
     1  -               owncloud_1                    /mnt/fastdata/jails/owncloud_1
     2  -               plexmediaserver_1             /mnt/fastdata/jails/plexmediaserver_1
     3  -               transmission_1                /mnt/fastdata/jails/transmission_1
     4  -               apache_1                      /mnt/fastdata/jails/apache_1

Elegir jail sobre la que trabajar:
# jexec 4 /bin/tcsh

Actualizar los paquetes de la jail:
Yes you have to type upgrade twice, this is in case the pkg software is not up to date.
# pkg update
# pkg upgrade
# pkg upgrade
Now let’s get the latest portsnap.
# portsnap fetch
# portsnap extract
# portsnap fetch update




::: fuentes :::
http://blog.timvandewoestyne.be/index.php/2015/02/14/freenas-93-jail-with-apache-and-php/


***************************************************************************
Message for mysql56-client-5.6.26:
 * * * * * * * * * * * * * * * * * * * * * * * *

Please be aware the database client is vulnerable
to CVE-2015-3152 - SSL Downgrade aka "BACKRONYM".
You may find more information at the following URL:

http://www.vuxml.org/freebsd/36bd352d-299b-11e5-86ff-14dae9d210b8.html

Although this database client is not listed as
"affected", it is vulnerable and will not be
receiving a patch. Please take note of this when
deploying this software.

* * * * * * * * * * * * * * * * * * * * * * * *
Message for phpMyAdmin-4.4.14:
 phpMyAdmin-4.4.14 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.

Message for mysql56-server-5.6.26:
 ************************************************************************

Remember to run mysql_upgrade the first time you start the MySQL server
after an upgrade from an earlier version.

************************************************************************
Message for mod_php56-5.6.12:
 ***************************************************************

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>

***************************************************************
Message for git-2.5.1:
 ------------------------------------------------------------------------
*************************** GITWEB *************************************
If you installed the GITWEB option please follow these instructions:

In the directory /usr/local/share/examples/git/gitweb you can find all files to
make gitweb work as a public repository on the web.

All you have to do to make gitweb work is:
1) Copy the files /usr/local/share/examples/git/gitweb/* to a directory on
   your web server (e.g. Apache2) in which you are able to execute
   CGI-scripts.
2) In gitweb.cgi, adjust the variable $projectroot to point to
   your git repository (that is where you have your *.git project
   directories).
*************************** GITWEB *************************************

Para hacer el mysql_upgrade:
mysql_upgrade -u root -p
password = contraseña por defecto del usuario root

_______________________________________________________
Según esta guía: https://www.iceflatline.com/2011/11/how-to-install-apache-mysql-php-and-phpmyadmin-on-freebsd/
En la parte del make config para las extensiones php hay que seleccionar pdo_mysql (por ejemplo para usar Prestashop).



Esta parte no es necesaria.

Usar portupgrade para actualizar la instalación de php y módulos fácilmente.
fuente: https://forums.freebsd.org/threads/no-php-pdo-mysql-support.33823/

If you don't have portupgrade, do this before the others:

Code:
cd /usr/ports/ports-mgmt/portupgrade
make install distclean

____________________________

You really want PHP-5.45. If you have portupgrade installed, you can upgrade your current version by doing:
Code:
portupgrade php5
portupgrade php5-extensions


I like to make backups of any related config. files first.
Once that's done, you will also want to do:

Code:
cd usr/ports/databases/php5-pdo_mysql
make install distclean