[SOLVED] NAS4Free SMF 2 install [GUIDE] PostgreSQL

Started by MrEd, October 02, 2012, 11:32:16 PM

Previous topic - Next topic

MrEd

This is done on NAS4Free 9.1.0.1 - Sandstorm (revision 323)

I already have smf 2 in a share directory, extracted
ie /mnt/share/share/smf


I did these in order:

original source
https://sites.google.com/site/aganimkarmiel/home/free-time/php-extensions-for-freenas [nofollow]



ssh into root

# pkg_add -r php5

# pkg_add -r php5-extensions

# pkg_add -r php5-xmlrpc

# pkg_add -r php5-gettext

# pkg_add -r php5-mcrypt

# pkg_add -r php5-mbstring


Extensions need for MySQL


# pkg_add -r php5-pdo_mysql

# pkg_add -r php5-mysql


Extensions need for PostgreSQL


# pkg_add -r php5-pgsql

# pkg_add -r php5-pdo_pgsql


Extensions need for owncloud


# pcg_add -r php5-zip

# pkg_add -r php5-gd


Extension for forum emailing

# pkg_add -r php5-openssl



In this point web gui not work, but repairable as


# mv /usr/local/bin/php /usr/local/bin/php-cli

# cp /usr/local/bin/php-cgi /usr/local/bin/php



Do this next:

original source
https://sites.google.com/site/aganimkarmiel/home/free-time/install-postgresql-on-freenas [nofollow]

Important!  Must strictly comply with the procedure specified in the manual. Step-by-Step.
1. Create holding folder for PostgreSQL. I want put it into non-system disk, mount point called data

# mkdir -p /mnt/data/db/pgsql

# chmod 777 /mnt/data/db

# ln -s /mnt/data/db/pgsql /usr/local/pgsql

2. Create the group and user 'pgsql' using the FreeNAS WebGUI, it is important
pgsql   Group       GID 70


pgsql   User         UID 70

Important! Home directory for user pgsql must be created in step1 - /mnt/data/db/pgsql

     

         # chown pgsql:pgsql /mnt/data/db/pgsql

3. Type the following command to install PostgreSQL server:

# pkg_add -r postgresql84-server

It is useful to read what to write computer programs after the installation,but I was still satisfied with the default settings.

4.   To run PostgreSQL at startup, add 'postgresql_enable="YES"' to /etc/rc.conf

echo 'postgresql_enable="YES"' >> /etc/rc.conf

5. Create initial database

# /usr/local/etc/rc.d/postgresql initdb

The files belonging to this database system will be owned by user "pgsql". This user must also own the server process.

6. Create database user and test installed software. PostgreSQL must be start from user pgsql, then

  # su pgsql
$ /usr/local/bin/postgres -D /usr/local/pgsql/data

Check in  Freenas webgui Status|Processes  pgsql - daemon

Create user for postgresql

$ createuser -sdrP

Enter name of role to add: username (may be name as admin freenas )

Enter password for new role: *****

Enter it again: ****
$ exit
7. If all goes well then

# reboot


NOTE:

When you get to
pkg_add -r postgresql84-server

Change it to

Quotepkg_add -r postgresql90-server
out of date server package I guess


When your done

# chown -R www:www /mnt/your_share/Shared/smf



Next
#su pgsql

$ createuser -sdrP admin   <---- your db admin name and pw
Enter password for new role:            <--- remember this
Enter it again:

$ createdb smf_aim

$ psql -l
                            List of databases
   Name    | Owner | Encoding | Collation |    Ctype    | Access privileges
-----------+-------+----------+-----------+-------------+-------------------
postgres  | pgsql | UTF8     | C         | en_US.UTF-8 |
smf_aim   | pgsql | UTF8     | C         | en_US.UTF-8 |
template0 | pgsql | UTF8     | C         | en_US.UTF-8 | =c/pgsql         +
           |       |          |           |             | pgsql=CTc/pgsql
template1 | pgsql | UTF8     | C         | en_US.UTF-8 | =c/pgsql         +
           |       |          |           |             | pgsql=CTc/pgsql
(4 rows)

$



This works now and can continue with the websever location   http://your_nas4free.com


#######################################################



Webserver addy... If you have webserver port fwd turned off in router, so you can work on it....
access example 192.168.1.144:4567

takes you to the install.php

If Enable authentication is turned on in webserver service, be sure to set the directory for the user
to default into the smf directory.











Finish up and you done!

Advertisement: