INSTALL ------- You can download the latest package from sourceforge and then extract it. But if you want the latest development you can get the code from SVN repository. Follow steps below to get the latest source code from SVN repository: # mkdir -p /usr/local/src/svn # cd /usr/local/src/svn # svn co http://developer.peanutinc.com/svn/banjar/trunk banjar # cd banjar If you use Sqlite3 as your database backend (text file database, recommended) ----------------------------------------------------------------------------- Note before starting step 1: Install Sqlite3 (tested on 3.4.2) on Ubuntu (tested on 7.10): Step: # apt-get install sqlite3 php-pear php-db php5-sqlite3 1. Copy files and directories here to a directory under Web Server's document root Note: For debian or ubuntu the default document root is /var/www For redhat based distro the default document root is /var/www/html For suse the default document root is /srv/www/htdocs In this manual we are using ubuntu server, the document root is /var/www Steps: # cd # mkdir /var/www/banjar # cp -rR . /var/www/banjar 2. Copy necessary files and directories to non-web-document-root directory Steps: # cd # cp -rR ./docs/root/banjar /etc # cp -rR ./docs/root/sbin /usr/local Note: Rules (netfilter.*) will be in /etc/banjar and the executor (banjar.sh) in /usr/local/sbin 3. Copy sqlite3 database to /etc/banjar/ Steps: # cd # cp ./docs/db/sqlite3/banjar.db /etc/banjar/ # chmod 666 /etc/banjar/banjar.db 4. Copy directory conf.example to conf # cd # cp -r conf.example conf 5. Edit conf/config.php (self explainatory, pay attentions to comments) Steps: # cd # mc -e conf/config.php or # vi conf/config.php or # nano conf/config.php Note: You may also want to edit other important files, they are: - conf/config_bandwidth.php - conf/config_password.php - /etc/banjar/netfilter.masquerade 6. We need 666 permission for config_bandwidth.php and netfilter.* Steps: # cd # chmod 666 config_bandwidth.php # chmod 666 /etc/banjar/netfilter.* 7. Change banjar.sh permission to 777 Note: You may want to take a look at config.php, see $apps_path['netfilter_exec'] and remember which filename used as netfilter execution file and its path, the default is banjar.sh Step: # chmod 777 /usr/local/sbin/banjar.sh 8. Configure root's cron file Example: as root type: crontab -e, this will open a crontab editor Step: # crontab -e 9. Insert on crontab editor: * * * * * /usr/local/sbin/banjar.sh >/dev/null 2>&1 Note: This entry will automate the execution of /usr/local/sbin/banjar.sh every minute It is very important for you to set this up correctly 10. Browse banjar's web directory and login (admin login is on config_password.php), the default would be: username = admin password = secret If you use MySQL as your database backend ----------------------------------------- 1. Copy files and directories here to a directory under Web Server's document root Note: For debian or ubuntu the default document root is /var/www For redhat based distro the default document root is /var/www/html For suse the default document root is /srv/www/htdocs In this manual we are using ubuntu server, the document root is /var/www Steps: # cd # mkdir /var/www/banjar # cp -rR . /var/www/banjar 2. Copy necessary files and directories to non-web-document-root directory Steps: # cd # cp -rR ./docs/root/banjar /etc # cp -rR ./docs/root/sbin /usr/local Note: Rules (netfilter.*) will be in /etc/banjar and the executor (banjar.sh) in /usr/local/sbin 3. Insert SQL statements from directory docs/db (banjar.sql) to a MySQL database Steps: # cd # mysqladmin -p create banjar # mysql -p banjar < ./docs/db/banjar.sql 4. Copy directory conf.example to conf # cd # cp -r conf.example conf 5. Edit conf/config.php (self explainatory, pay attentions to comments) Steps: # cd # mc -e conf/config.php or # vi conf/config.php or # nano conf/config.php Note: You may also want to edit other important files, they are: - conf/config_bandwidth.php - conf/config_password.php - /etc/banjar/netfilter.masquerade 6. We need 666 permission for config_bandwidth.php and netfilter.* Steps: # cd # chmod 666 config_bandwidth.php # chmod 666 /etc/banjar/netfilter.* 7. Change banjar.sh permission to 777 Note: You may want to take a look at config.php, see $apps_path['netfilter_exec'] and remember which filename used as netfilter execution file and its path, the default is banjar.sh Step: # chmod 777 /usr/local/sbin/banjar.sh 8. Configure root's cron file Example: as root type: crontab -e, this will open a crontab editor Step: # crontab -e 9. Insert on crontab editor: * * * * * /usr/local/sbin/banjar.sh >/dev/null 2>&1 Note: This entry will automate the execution of /usr/local/sbin/banjar.sh every 1 minute It is very important for you to set this up correctly 10. Browse banjar's web directory and login (admin login is on config_password.php), the default would be: username = admin password = secret UPGRADE ------- I'm sorry that I dont have the upgrade manual, please refer to mailing list tanya-jawab@linux.or.id for this. But basically, to do upgrade you just have to copy all files, replace old files and apply database upgrade Please have a look at ./docs/db/ for database upgrade