- 1. What is a DHCP Server?
- 2. How do I install a DHCP Server?
| 1. |
What is a DHCP Server? |
|
A Dynamic Host Configuration Protocol (DHCP) server dynamically assigns IP addresses and other network setting for a given network to other networked PCs that ask. This simplifies network administration and makes connecting new PCs to a network much easier. |
| 2. |
How do I install a DHCP Server? |
|
![[Note]](http://68.209.206.234/online_books/images/admon/note.png) |
|
| For these examples we are using “eth0” and the following:
IP address range: 192.168.0.100 to 192.168.0.200
Subnet Mask: 255.255.255.0
DNS Servers: 202.188.0.133, 202.188.1.5
Domains: tm.net.my
Gateway Address: 192.168.0.1 |
- Read How do I add Universe and Multiverse?
- Install the dhcp3-server package with Synaptic(See How do I use Synaptic to install packages?)
Networking > dhcp3-server
-
sudo cp /etc/default/dhcp3-server /etc/default/dhcp3-server_backup
sudo gedit /etc/default/dhcp3-server
- Find this line
... INTERFACES=""
- Replace with the following line
INTERFACES="eth0"
- Save the edited file (How do I install a DHCP Server?)
-
sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf_backup
sudo gedit /etc/dhcp3/dhcpd.conf
- Find this section
...
# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
...
- Replace with the following lines
# option definitions common to all supported networks...
#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;
#default-lease-time 600;
#max-lease-time 7200;
- Find this section
...
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}
...
- Replace with the following lines
# A slightly different configuration for an internal subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option domain-name-servers 202.188.0.133, 202.188.1.5;
option domain-name "tm.net.my";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
}
- Save the edited file (sample/dhcpd.conf_installdhcpserver)
-
sudo /etc/init.d/dhcp3-server restart
|
August 5, 2009
Posted by 9com |
Uncategorized |
Leave a Comment
- เบื้องต้นให้เรากำหนดค่าต่าง ๆตาม
- ถ้ายังไม่ได้ให้ของใช้ scripts นี้ทดสอบการทำงานของ session
<?php
// save as "session_test.php" inside your webspace
ini_set('display_errors', 'On');
error_reporting(6143);
session_start();
$sessionSavePath = ini_get('session.save_path');
echo '<br><div style="background:#def;padding:6px">'
, 'If a session could be started successfully <b>you should'
, ' not see any Warning(s)</b>, otherwise check the path/folder'
, ' mentioned in the warning(s) for proper access rights.<hr>';
if (empty($sessionSavePath)) {
echo 'A "<b>session.save_path</b>" is currently',
' <b>not</b> set.<br>Normally "<b>';
if (isset($_ENV['TMP'])) {
echo $_ENV['TMP'], '</b>" ($_ENV["TMP"]) ';
} else {
echo '/tmp</b>" or "<b>C:\tmp</b>" (or whatever',
' the OS default "TMP" folder is set to)';
}
echo ' is used in this case.';
} else {
echo 'The current "session.save_path" is "<b>',
$sessionSavePath, '</b>".';
}
echo '<br>Session file name: "<b>sess_', session_id()
, '</b>".</div><br>';
?>
- ถ้าการทำงานถูกต้องจะต้องไม่มี warnning เตือนขึ้นมา
- ถ้ามี error เตือนหมายความว่า session ของเราไม่สามารทำงานได้ ให้เราตรวจสอบที่ /etc/php5/apache2/php.ini ว่าเรากำหนด directory ของ session ไว้ที่ใด ที่ parameter session.save_path = “tmp/session”
- ในกรณีข้างบนนี้กำหนดว่าเราจะเก็บ session ที่ tmp/session เพราะฉะนั้นเราต้องกำหนด mod ของ floder ให้สามารถอ่านเขียนได้
- ลองเรียก phpmyadmin ทำงานอีกครั้ง
August 5, 2009
Posted by 9com |
Admin |
Leave a Comment