เนื่องจากประสพปัญหา profile ในการ set ค่า Dialup ของ IPCop มีน้อยไปคือ มีมาให้แค่ 5 profiles ซึ่งผมเองจำเป็นต้องใช้เยอะๆด้วยสิ เลยต้องขยายมันซะหน่อย

วิธีการคือ
1. remote เข้าไปแก้ไขไฟล์ /home/httpd/cgi-bin/vi pppsetup.cgi
ก่อนแก้ให้ทำการ backup ไฟล์เก่าไว้ก่อนนะครับกันผิดพลาด
# cp pppsetup.cgi pppsetup.cgi-25-06-2008
เสร็จแล้ว vi แก้ไฟล์ pppsetup.cgi ตรงบรรทัดที่ 35 ตามจำนวนที่ต้องการ เช่นผมต้องการ 15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| our %pppsettings=();
my %temppppsettings=();
our %modemsettings=();
our %isdnsettings=();
our %netsettings=();
my %selected=();
my %checked=();
my @profilenames=();
my $errormessage = '';
my $maxprofiles = 15;
my $kernel=`/bin/uname -r | /usr/bin/tr -d '\012'`;
our $drivererror = '';
&Header::showhttpheaders(); |
2. เสร็จแล้ว cd ไปที่ /var/ipcop/ppp ในขั้นตอนนี้จะเป็นการเพิ่มจำนวน file ที่เก็บ profile ให้เท่ากับจำนวน maxprofiles ที่เราได้กำหนดไปในขั้นตอนที่ 1
ใน paht นี้เดิมทีจะมีไฟล์อยู่เท่ากับด้านล่างนี้คือ
root@aone-dial:/var/ipcop/ppp # ls -l
total 72
-rw-r--r-- 1 nobody nobody 22 2005-11-07 04:31 fake-resolv.conf
-rw------- 1 nobody nobody 20 2006-10-06 09:19 secrets
-rw-r--r-- 2 nobody nobody 469 2006-10-06 09:19 settings
-rw-r--r-- 1 nobody nobody 464 2006-09-12 03:03 settings-1
-rw-r--r-- 1 nobody nobody 470 2006-10-03 09:56 settings-2
-rw-r--r-- 1 nobody nobody 463 2006-09-28 10:26 settings-3
-rw-r--r-- 1 nobody nobody 473 2006-08-03 21:44 settings-4
-rw-r--r-- 1 nobody nobody 462 2006-10-05 18:27 settings-5
ซึ่งเท่ากับจำนวน porfile ที่มี เพื่อจะให้มันมี 15 profiles ตามที่ต้องการ ให้ทำการสร้างไฟล์ settings-6 ถึง settings-15 ขึ้นมา วิธีที่ง่ายที่สุดคือ copy จากไฟล์เดิมครับ
# cp settings-1 settings-6
# cp settings-1 settings-7
# cp settings-1 settings-8
# cp settings-1 settings-9
# cp settings-1 settings-10
# cp settings-1 settings-11
# cp settings-1 settings-12
# cp settings-1 settings-13
# cp settings-1 settings-14
# cp settings-1 settings-15
3. profile ที่เพิ่มขึ้นมาอีก 10 profiles นี้จะต้องแก้ค่า PROFILEข้างในไฟล์ทุกไฟล์ ให้ตรงกับชื่อ profile เช่น ของไฟล์ settings-6 โดยการเข้าไปแก้ที่บรรทัดที่ 24 ให้ตรงกับชื่อ profile นั่นคือแก้เป็น 6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| PHONEBOOK=RELAY_PPP1
PROTOCOL=RFC2364
MAXRETRIES=2
DIALMODE=T
DNS1=
SENDCR=off
DEBUG=off
MODEM=PCIST
RECONNECTION=manual
DNS=Automatic
TELEPHONE=
USEIBOD=off
SPEAKER=on
ENCAP=
HOLDOFF=30
TIMEOUT=0
AUTH=pap-or-chap
METHOD=PPPOE_PLUGIN
DTERATE=115200
PASSWORD=user123
AUTOCONNECT=off
DNS2=
MODULATION=AUTO
PROFILE=6
LINE=WO
COMPORT=ttyS1
USERNAME=user1
VALID=yes
TYPE=modem
USEDOV=off
BACKUPPROFILE=1
PROFILENAME=FNS-PNK
DIALONDEMANDDNS=off
LOGINSCRIPT= |
ให้ทำอย่างนี้กับทุกๆ ไฟล์ที่สร้างขึ้นมาใหม่
4. สุดท้าย ต้อง chown ด้วยเพราะเรา login เข้ามาด้วย user root ซึ่งไฟล์ที่เป็นของ root จะแก้ไขผ่านหน้าเว็บเพจ ของ IPCop ไม่ได้เพราะ web server ของ IPCop start ด้วย user nobody ต้อง chown เป็น nobody ก่อน
# chown nobody:nobody settings-*
เสร็จแล้วถ้าไม่มีอะไรผิดพลาด ก็สามารถเข้าไปที่หน้าเพจ Network -> Dialup
ก็จะเห็นจำนวน profile เพิ่มขึ้น ตามรูปด้านบน…
คอมเม้นท์ล่าสุด