Installing a php bbs (forum) system on pcbsd 1.5.1
This guide is in two parts.
1. - Installing prerequisites - (apache, php & mysql)
2. - Installing the bbs
************************************************** ***
************************************************** ***
Part 1.
Install apache:
Do --> cd /usr/local/ports/www/apache13
Do --> make install clean
Edit: /etc/rc.conf AND ADD: apache_enable="YES"
If you want more than one website (IE one with a forum and one without
for example) then enable virtual servers by adding the following (edit)
to /usr/local/etc/apache/httpd.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerName
www.website1.com
DocumentRoot /usr/local/www/data/website1.com
ServerAdmin your-email-address-here
ErrorLog /var/log/website1-error_log
</VirtualHost>
<VirtualHost *:80>
ServerName
www.website2.com
DocumentRoot /usr/local/www/data/website2.com
ServerAdmin your-email-address-here
ErrorLog /var/log/website2-error_log
</VirtualHost>
Repeat for third/fourth website whatever.
If you do not require virtual servers (IE you will only be using one
website/domain name) then you only need the following edit:
/ ServerAdmin
give your mail address
/ ServerName
give your server's name (must be FQDN)
Make sure you have the following lines uncommented also:
AddType application/x-httpd-php .php <---may already be there
AddType application/x-httpd-php-source .phps <---may already be there
You should check that apache is running correctly by either going on
to build your website or simply browse localhost in firefox/whatever.
If apache fails to start when you boot/or manually start the service
it may be because you need a copy of libphp4.so
Out of two systems I built it was missing from one - I have no reason
why it should be so. I just grabbed a copy from the other system and
placed it in the following directory: /usr/local/libexec/apache
You may have to google for it/whatever. After that it started perfectly.
End of apache setup.
**********
Next install mysql:
Do --> cd /usr/ports/databases/mysql41-server
Do --> make install clean
Do --> /usr/local/bin/mysql_install_db
Do --> cd /var/db
Do --> chown -R mysql mysql
Edit: /etc/rc.conf and add: mysql_enable="YES"
do --> /usr/local/bin/mysqld_safe &
Next create the mysql admin password:
Do --> /usr/local/bin/mysqladmin -u root password 'new-password'
Now create the mysql database and mysql user:
Do --> pcbsd# mysql -u root -p;
Then, from within mysql do:
mysql> create database mybbs;
mysql> grant usage on mybbs.* to mybbsuser@localhost;
mysql> set password for mybbsuser@localhost = password('secret');
mysql> grant all privileges on *.* to mybbsuser@localhost;
mysql> quit;
In the above the database is named mybbs and a mysql user with name
mybbsuser is created. You can use whatever name and password you
want of course.
End of mysql install/setup.
**********
Install php:
Do --> cd /usr/ports/lang/php4
Do --> make config
Add aditional options:
[X] APACHE Build Apache module
Do --> make install clean
Install php extensions:
Do --> cd /usr/ports/lang/php4-extensions
Do --> make config
Make sure you have/or insert these options:
[X] BZ2
[X] CTYPE
[X] MBSTRING
[X] MYSQL
[X] OVERLOAD
[X] PCRE
[X] PDF
[X] POSIX
[X] SESSION
[X] TOKENIZER
[X] XML
[X] ZIP
[X] ZLIB
You must have a copy of PDFLib-Lite-7.0.2.tar.gz or you will get
a build error in the next stage of the process.
You can get it from::
http://www2-pcmdi.llnl.gov/trac/browser ... z?rev=6295 or wherever else/up to you.
Next copy it to /usr/ports/distfiles/
Then do --> make install clean
Copy the recommended ini file:
Do --> cd /usr/local/etc
Do --> cp php.ini-recommended php.ini: php.ini
Now edit php.ini and make sure safe mode is off
************************************************** *******
************************************************** *******
Part 2.
Installing the BBS
You may choose whatever forum (bbs) package you want but I chose
one called MyBB which is available at
http://www.mybboard.net/
Unpack it and copy the directory /forums/* to your document root:
/usr/local/www/data/yourwebsite.com/
The bbs should reside in a directory as follows:
/usr/local/www/data/yourwebsite.com/forums/
Next use mc or the chmod command/whatever and chmod all folders to 777
and all files to 666 - watch out for executables! This is rather tedious as
there are a lot of directories and files here.
Next point your browser (firefox/whatever) at:
http://yourwebsite.com/forums/install/index.php
and set up your bbs.
cookie domain = .yourdomain.com (the detected default worked fine)
You can theme the bbs by fetching themes from the main bbs website
and following some simple instructions. Alternatively you could keep
the default theme and just change the logo at the top by creating a
new logo.gif located in /usr/local/www/data/yourwebsite.com/forum/images
To administer the bbs point your browser at:
http://yourwebsite.com/forums/admin/index.php
where you will find various options to tune your bbs. Dont forget to
add a proper email address with smtp server (not a web one) so that your
bbs may send authentication emails when users register.
**********
Some commands for starting and stopping the services during
installation/setup:
STARTING MYSQL:
/usr/local/bin/mysqld_safe &
STOPPING MYSQL:
mysqladmin -u root -p shutdown
STARTING APACHE:
/usr/local/sbin/apachectl start
STOPPING APACHE:
/usr/local/sbin/apachectl stop
RESTARTING APACHE:
/usr/local/sbin/apachectl graceful
START/STOP/RESTART APACHE:
/usr/local/etc/rc.d/apache13.sh stop/start/restart
START/STOP/RESTART MYSQL:
/usr/local/etc/rc.d/mysql.sh stop/start/restart
*********************Finished*********************