Thursday, 27 October 2016

How to install phpMyAdmin on a FreeNAS Jail

بسم الله الرحمن الرحيم


Abstract


A tutorial to install phpMyAdmin on a FreeNAS Jail. 

Assumptions and Prerequisites


  • Domain: example.com
  • Hostname: www.example.com
  • OS: FreeNAS 9.10.1-U2 (FreeBSD 10.3-STABLE)
  • Container: Warden Jail
  • Jail Name: www
  • Private IP: 10.0.0.56
  • Subnet Mask: 255.255.255.0/24
  • Apache has already been installed.
  • php56 is already installed.
  • Restrict Access only to local LAN (10.0.0.0/24).

Instructions


- First install php extensions required for phpMyAdmin.    
# pkg install php56-session php56-json php56-mbstring php56-zip php56-gd php56-openssl php56-curl php56-ctype php56-bz2 php56-mcrypt php56-zlib

- Install and Configure phpMyAdmin for Database Web Administration
# pkg install phpmyadmin
- Create phpMyAdmin configuration file /usr/local/etc/apache24/Includes/phpmyadmin.conf
# vi /usr/local/etc/apache24/Includes/phpmyadmin.conf
   (1)      Alias /phpmyadmin "/usr/local/www/phpMyAdmin/"
   (2)       
   (3)      <Directory "/usr/local/www/phpMyAdmin/">                  
   (4)          Options None
   (5)          AllowOverride Limit
   (6)
   (7)          Require local
   (8)          Require ip 10.0.0.0/24
   (9)      </Directory>

- Reload Apache Configurations
# service apache24 graceful

- Configure phpMyAdmin to connect with Database
Goto http://10.0.0.56/phpmyadmin/setup via web browser.
Click the button 'New server' and add a new server settings.
After configuring settings for the database server connection, click the 'Display' button.

- Copy the php code generated into the file /usr/local/www/phpMyAdmin/config.inc.php
# vi /usr/local/www/phpMyAdmin/config.inc.php

- Goto http://10.0.0.56/phpmyadmin via web browser and Login to phpmyadmin with your database username and password.

No comments: