NUBSolutions

Just another WordPress.com weblog

Captive Portal Bagian1

Posted by nubsolutions on May 12, 2009

OS:FC8
Captive Portal Bagian1 (BLUM DICHECK)

Install Cake

[root@localhost source]# cp cake_1.1.18.5850.tar.gz /var/www/

[root@localhost www]# tar -zxvf cake_1.1.18.5850.tar.gz

[root@localhost www]# mv cake_1.1.18.5850 cake

[root@localhost www]# ls -la
total 320
drwxr-xr-x 13 root      root   4096 2009-05-06 21:43 .
drwxr-xr-x 20 root      root   4096 2009-05-04 03:07 ..
drwxr-xr-x  6      5002 5002   4096 2007-10-23 07:29 cake
-rw-r–r–  1 root      root 217566 2009-05-06 21:41 cake_1.1.18.5850.tar.gz
drwxr-xr-x  2 root      root   4096 2007-09-18 14:57 cgi-bin
drwxr-xr-x  3 root      root   4096 2009-05-04 02:50 error
drwxr-xr-x  2 root      root   4096 2007-09-18 14:57 html
drwxr-xr-x  3 root      root   4096 2009-05-04 02:50 icons
drwxr-xr-x 14 root      root   4096 2009-05-04 03:04 manual
drwxr-xr-x  2 root      root   4096 2007-09-18 06:21 mason
drwxr-xr-x  4 root      root   4096 2009-05-04 03:01 tclhttpd
drwxrwsr-x  5 thttpd    www    4096 2009-05-04 02:46 thttpd
drwxr-xr-x  2 webalizer root   4096 2009-05-03 21:48 usage
drwxr-xr-x  4 root      root   4096 2009-05-04 03:09 wiki

[root@localhost www]# service httpd status
httpd (pid 3225 3224 3223 3222 3221 3220 3219 3218 3217 3215) is running…

[root@localhost www]# vim /etc/httpd/conf/httpd.conf

DocumentRoot “/var/www/cake”

<Directory “/var/www/cake”>
AllowOverride All
</Directory>

[root@localhost Packages]# rpm -ivh php-5.2.4-3.i386.rpm
warning: php-5.2.4-3.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing…                ########################################### [100%]
package php-5.2.4-3 is already installed
[root@localhost Packages]# rpm -ivh php-common-5.2.4-3.i386.rpm
warning: php-common-5.2.4-3.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing…                ########################################### [100%]
package php-common-5.2.4-3 is already installed
[root@localhost Packages]# rpm -ivh php-mysql-5.2.4-3.i386.rpm
warning: php-mysql-5.2.4-3.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing…                ########################################### [100%]
package php-mysql-5.2.4-3 is already installed
[root@localhost Packages]# rpm -ivh php-cli-5.2.4-3.i386.rpm
warning: php-cli-5.2.4-3.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing…                ########################################### [100%]
package php-cli-5.2.4-3 is already installed
[root@localhost Packages]# rpm -ivh php-gd-5.2.4-3.i386.rpm
warning: php-gd-5.2.4-3.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing…                ########################################### [100%]
package php-gd-5.2.4-3 is already installed
[root@localhost Packages]# rpm -ivh php-xml-5.2.4-3.i386.rpm
warning: php-xml-5.2.4-3.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing…                ########################################### [100%]
package php-xml-5.2.4-3 is already installed

[root@localhost Packages]# rpm -ivh php-mbstring-5.2.4-3.i386.rpm
warning: php-mbstring-5.2.4-3.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing…                ########################################### [100%]
package php-mbstring-5.2.4-3 is already installed

[root@localhost Packages]# rpm -ivh php-pecl-apc-3.0.14-2.fc8.i386.rpm
warning: php-pecl-apc-3.0.14-2.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing…                ########################################### [100%]
package php-pecl-apc-3.0.14-2.fc8 is already installed

[root@localhost Packages]# vim /etc/php.ini
output_buffering = 4096

pastikan module rewrite terinstall

[root@localhost etc]# httpd -M 2>&1 | grep rew
rewrite_module (shared)

Install Hotchakes
extract dan install dibawah direktory /var/www/cake

[root@localhost source]# cp hotcakes-beta-5.tar.gz /var/www/cake

[root@localhost cake]# tar -zxvf hotcakes-beta-5.tar.gz

[root@localhost cake]# ls -la
total 1088
drwxr-xr-x  7   5002   5002    4096 2009-05-06 22:37 .
drwxr-xr-x 13 root   root      4096 2009-05-06 21:43 ..
drwxr-xr-x 10   5002   5002    4096 2009-05-06 21:42 app
drwxr-xr-x  5   5002   5002    4096 2009-05-06 21:42 cake
drwxr-xr-x  2   5002   5002    4096 2009-05-06 21:42 docs
drwxr-xr-x 11 247965 247965    4096 2007-11-12 17:04 hotcakes
-rw-r–r–  1 root   root   1061179 2009-05-06 22:36 hotcakes-beta-5.tar.gz
-rw-r–r–  1   5002   5002     139 2006-05-22 21:30 .htaccess
-rw-r–r–  1   5002   5002    2680 2007-02-02 20:20 index.php
-rw-r–r–  1 root   root        20 2009-05-06 22:15 phpinfo.php
drwxr-xr-x  2   5002   5002    4096 2007-10-23 07:29 vendors

[root@localhost cake]# useradd www-data

[root@localhost cake]# chown -R www-data. /var/www/cake/hotcakes/tmp/

[root@localhost cake]# ls /var/www/cake/hotcakes/ -la

drwxr-xr-x  6 www-data www-data  4096 2007-11-12 17:04 tmp

[root@localhost cake]# chmod 777 /var/www/cake/hotcakes/webroot/generated/

[root@localhost cake]# ls /var/www/cake/hotcakes/webroot/ -la

drwxrwxrwx  2 247965 247965 4096 2007-11-12 17:04 generated

Setting Mysql
[root@localhost cake]# service mysqld status
mysqld (pid 3550) is running…

[root@localhost Packages]# rpm -ivh mysql-5.0.45-4.fc8.i386.rpm
[root@localhost Packages]# rpm -ivh perl-DBD-Pg-1.49-5.fc8.1.i386.rpm
warning: perl-DBD-Pg-1.49-5.fc8.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing…                ########################################### [100%]
1:perl-DBD-Pg            ########################################### [100%]

[root@localhost Packages]# yum install mysql-connector-java-3.1.12-3.fc6.i386.rpm

[root@localhost Packages]# rpm -ivh glib-java-0.2.6-8.fc7.i386.rpm
warning: glib-java-0.2.6-8.fc7.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing…                ########################################### [100%]
1:glib-java              ########################################### [100%]

[root@localhost Packages]# mysqladmin password xxx

[root@localhost cake]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.45 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

################Konfigurasi database################

ganti username dan password pada file /var/www/cake/hotcakes/config/database.php

class DATABASE_CONFIG
{
var $default = array(‘driver’ => ‘mysql’,
‘connect’ => ‘mysql_connect’,
‘host’ => ‘localhost’,
‘login’ => ‘root’,
‘password’ => ‘xxx’,
‘database’ => ‘radius’,
‘prefix’ => ”);

[root@localhost cake]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.45 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> create database radius;
Query OK, 1 row affected (0.04 sec)

mysql> GRANT ALL PRIVILEGES ON radius.* to ‘radius’@’127.0.0.1’ IDENTIFIED BY ‘radius’;
Query OK, 0 rows affected (0.02 sec)

mysql> GRANT ALL PRIVILEGES ON radius.* to ‘radius’@’localhost’ IDENTIFIED BY ‘radius’;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> exit
Bye

masukan struktur tabel database

[root@localhost cake]# mysql -u root -p radius < /var/www/cake/hotcakes/db/radius.sql
Enter password:
[root@localhost cake]#

Check apakah sudah dimasukan seluruh tabelnya

mysql> use radius
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> show tables
-> ;
+———————+
| Tables_in_radius    |
+———————+
| account_types       |
| admins              |
| banks               |
| billing_plans       |
| cashiers            |
| configuration_items |
| controlled_realms   |

[root@localhost cake]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@localhost cake]# service mysqld restart
Stopping MySQL:                                            [  OK  ]
Starting MySQL:                                            [  OK  ]

###############tambahan #####################

[root@localhost Packages]# yum -y install mysql-connector-java-3.1.12-3.fc6.i386.rpm

[root@localhost www]# tar -xzvf cake_1.1.18.5850.tar.gz

krn sudah ada

[root@localhost www]# ls -s cake_1.1.18.5850 cake
cake:
total 1072
4 app      4 docs      1044 hotcakes-beta-5.tar.gz     4 phpinfo.php
4 cake     4 hotcakes     4 index.php                  4 vendors

cake_1.1.18.5850:
total 20
4 app  4 cake  4 docs  4 index.php  4 vendors
[root@localhost www]#

#################ERROR MSG#####################

Note:

Error msg ini keluar jika di akses dari client, tetapi jika dari local sudah berhasil.

Masih testing, belum sempat lanjut krn masih sibuk projek
Bad Request

Your browser sent a request that this server could not understand.

“400 bad request”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: