pastikan kamu sudah masuk dalam full permission di root
# sudo
pertama yang harus dilakukan adalah menginstall apache
# apt-get install apache2
install openssl :
# apt-get install openssl ssl-cert
Jika tidak mempunyai sertifikat SSL, maka diharuskan membuat sertifikat sendiri.
pada linux debian varian selain etch dapat menjalankan perintah
# apache2-ssl-certificate
pada debian etch, jalankan perintah :
# make-ssl-cert
untuk membentuk sertifikat ssl jalankan perintah dan jawab pertanyaannya :
# openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem
Generating a 1024 bit RSA private key
....................................++++++
.....................++++++
writing new private key to '/etc/apache2/apache.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:ID
State or Province Name (full name) [Some-State]:DKI Jakarta
Locality Name (eg, city) []:Jakarta
Organization Name (eg, company) [Internet Widgits Pty Ltd]:PT Indo Pratama Cyber net
Organizational Unit Name (eg, section) []:Network Operation Center
Common Name (eg, YOUR name) []:Indra Budiman
Email Address []:noc2@ipnet.net.id
setting permisions pada apache.pem yang telah terbentuk
#chmod 600 /etc/apache2/apache.pem
setelah sertifikat terbentuk,tambahkan port 443
# vi /etc/apache2/ports.conf
isi :
Listen 80
Listen 443
enable support SSL pada Apache2 webserver
# a2enmod ssl
Module ssl installed; run /etc/init.d/apache2 force-reload to enable
tambahkan didalam konfigurasi site :
NameVirtualHost *:443
<>
....
SSLEngine on
SSLCertificateFile /etc/apache2/apache.pem
...
< /VirtualHost >
Restart apache
# /etc/init.d/apache2 restart
Minggu, 23 September 2007
Rabu, 19 September 2007
Freeradius: Disconnected user when time limit exceed
I learned this while integrating phpmyprepaid into my radius server.
The purpose of this configuration is to limit a user by the time he use our network.
Let say as example I want to limit a user only 1 hour per prepaid card.
So what I did is define a counter using sqlcounter module in the radius.conf file;
— snipped —
sqlcounter timelimit {
counter-name = Max-All-Session-Time
check-name = Max-All-Session
sqlmod-inst = sql
key = User-Name
reset = never
query = “SELECT SUM(AcctSessionTime) FROM radacct where UserName=’%{%k}’”
}
— snipped —
In the configuration I set the check-name as Max-All-Session, this will apply to the the radcheck table. You can choose other name, the same name should be use in the radcheck table. in the query part is the sql query we use to get the data for accounting. From the above query radius server will get the sum of session time of the user from radacct table. It will compare with Max-All-Session check item and terminate the session when the time is reached.
but the server does not do accounting yet, to enable accounting we must specify the module we define in authorize section in the radius.conf.
— snipped —
authorize {
preprocess
chap
mschap
suffix
eap
files
sql
pap
timelimit
}
— snipped —
Then we need to restart/reload the server to make the new configuration take effect.
To force the setting to the user we must insert the regarding attribute into the radcheck table:
as example:
+–+———–+—————–+—+———-+
| id | UserName| Attribute | op | Value |
+–+———–+—————–+—+———-+
| 1 | user | User-Password | := | p45sw0rd |
| 2 | user | Max-All-Session | := | 3600 |
+–+———–+—————–+—+———-+
The purpose of this configuration is to limit a user by the time he use our network.
Let say as example I want to limit a user only 1 hour per prepaid card.
So what I did is define a counter using sqlcounter module in the radius.conf file;
— snipped —
sqlcounter timelimit {
counter-name = Max-All-Session-Time
check-name = Max-All-Session
sqlmod-inst = sql
key = User-Name
reset = never
query = “SELECT SUM(AcctSessionTime) FROM radacct where UserName=’%{%k}’”
}
— snipped —
In the configuration I set the check-name as Max-All-Session, this will apply to the the radcheck table. You can choose other name, the same name should be use in the radcheck table. in the query part is the sql query we use to get the data for accounting. From the above query radius server will get the sum of session time of the user from radacct table. It will compare with Max-All-Session check item and terminate the session when the time is reached.
but the server does not do accounting yet, to enable accounting we must specify the module we define in authorize section in the radius.conf.
— snipped —
authorize {
preprocess
chap
mschap
suffix
eap
files
sql
pap
timelimit
}
— snipped —
Then we need to restart/reload the server to make the new configuration take effect.
To force the setting to the user we must insert the regarding attribute into the radcheck table:
as example:
+–+———–+—————–+—+———-+
| id | UserName| Attribute | op | Value |
+–+———–+—————–+—+———-+
| 1 | user | User-Password | := | p45sw0rd |
| 2 | user | Max-All-Session | := | 3600 |
+–+———–+—————–+—+———-+
Langganan:
Komentar (Atom)
