รถเช่า ประเภทต่างๆ
รถเช่า จังหวัด
การเปลี่ยน ip address direct admin
วันที่: 18/11/2010
เวลา: 07:53:22
sh /usr/local/directadmin/scripts/ipswap.sh <oldip> <newip>
ความคิดเห็นทั้งหมด
04/01/2011 | 11:31:54
ณ เวลานึง Server ของเราก็จะแก่เกินแกง เราต้องหาเครื่องมาเปลี่ยนให้มัน
ของผมนั้นที่จะทำก็แค่แทนที่เครื่องทุกอย่างเหมือนเดิม IP เดิม น่าจะง่ายหน่อย
สิ่งที่ต้องการคือ downtime น้อยที่สุด
ขั้นตอนของผมก็ง่ายๆ
1. เข้า directadmin เครื่องเดิม โดย admin ทำการ backup โดยกดที่ "Admin Backup/Transfer" แล้วก็รอไปหลายชม. (ล่าสุด P4 ram2GB ไฟล์แค่ 30GB รอไป 14 ชม.) Embarrassed
refer:http://help.directadmin.com/item.php?id=269
2. เข้า directadmin client แล้วสร้าง license ใหม่ แล้วเมลล์หา sales บอกว่าขอให้ช่วย activate ให้ซัก 2-3 วัน เพื่อใช้ในการ setup
ที่ต้องทำแบบนี้เพราะว่าตอนเราลงนั้นกินเวลา เราจึงลง directadmin จาก IP อื่นก่อน
3. ติดตั้ง FreeBSD ณ วันที่เขียนยัง support แค่ 7.2 เราเลยลง 7.2 64bit เครื่องใหม่เป็น CPU XEON ให้เลือกใช้ amd64 ตอนติดตั้งก็ให้ติดตั้งแบบ ไม่ลงอะไรเลย ผมเลือก ลงเพิ่มคือ source ต่างๆ Developer จได้ ports มารอไว้เผื่อลงอะไรเพิ่ม
DELL R210 บน FreeBSD 7.2 หรือ 8 ก็ตาม แบบ 64bits ต้องใช้แรม ECC ถึงจะเรียก sysinstall ขึ้น หลังจาก setup เสร็จใช้ non-ECC ได้ปกติ
3. ติดตั้ง wget with ssl ใช้ในการ โหลดไฟล์ (ที่ต้องมี ssl เพราะเวลา directadmin check license ใช้ผ่าน ssl)
Quote
wget http://files.directadmin.com/services/wget-1.8.2.tar.gz
tar xvzf wget-1.8.2.tar.gz
cd wget-1.8.2
./configure --prefix=/usr --with-ssl
make
make install
refer:http://help.directadmin.com/item.php?id=119
4. เริ่มติดตั้ง directadmin ตามขั้นตอน ก็ใส่ client id เราและ license สำหรับ ip ชั่วคราวนี้ไปก่อน
Code:
wget http://www.directadmin.com/setup.sh
chmod 755 setup.sh
./setup.sh
เวลาลงเสร็จให้ดู password ไว้ด้วย หากไม่ทันดูหรือจำไม่ได้ ให้ทำการเปลี่ยน Password ที่ user admin
refer:http://www.directadmin.com/installguide.html
5. หลังจากติดตั้ง directadmin เสร็จ ก็รอจนกว่าจะ backup เครื่องเก่าเสร็จ อาจกินเวลารอหลายชม. สมมุติว่าเสร็จแหละ Tongue
ก็ทำการ FTP file จาก folder /home/admin/admin_backups มาไว้ในเครื่องใหม่ที่เดียวกัน
Quote
mget *.gz
6. เสียวสุด Grin ทำการสลับ IP ให้เครื่องใหม่เป็น IP เดิม และดับเครื่องเก่าให้มันพักผ่อนซะหน่อย โดยแก้ไขไฟล์
Quote
/etc/rc.conf
Quote
defaultrouter="192.168.1.1"
hostname="guru.gumairu.com"
ifconfig_bce0="inet 192.168.1.2 netmask 255.255.255.252"
ifconfig_bce0_alias0="inet 192.168.1.3 netmask 255.255.255.252"
ตรง alias คือการทำให้มีหลายๆ IP บน NIC ตัวเดียว จะกี่IP ก็ต่อไปเรื่อย alias0,alias1 ...
ทั้งตรง IP,netmask,gateway
เมื่อแก้เสร็จก็ทำการ restart service
Quote
/etc/rc.d/netif restart && /etc/rc.d/routing restart
ตอนนี้เครื่องใหม่ก็มาแทนเครื่องเดิมละ แต่เว็บมันก็ยังเข้าไม่ได้นะสิ !!! Shocked
refer:http://www.cyberciti.biz/tips/freebsd-how-to-start-restart-stop-network-service.html
7. ทำการบอก directadmin ว่าเปลี่ยน IP
Code:
/usr/local/directadmin/scripts/ipswap.sh
ให้ดีก็ restart เครื่องไปเลย
8. get license ใหม่โดยต้องกลับไปใช้ license เดิมบน server เครื่องเดิม
Code:
cd /usr/local/directadmin/scripts
./getLicense.sh [ClientID] [LicenseID] [IP]
/usr/local/directadmin/directadmin restart
refer:http://help.directadmin.com/item.php?id=30
9. เข้า directadmin control panel แก้ไข Default IP และ เพิ่ม IP ตรงเมนู แล้วก็ไปที่เมนู "Admin Backup/Transfer" คราวนี้ก็ทำการกด restore แล้วก็รอพอเสร็จมันจะมี msg แจ้ง (ตอนrestore ใช้เวลาแค่ 50 นาทีเอง)
เสร็จแล้วง่ายเนอะ กลับมาจะเหมือนเดิมทุกอย่างทั้ง path permission password e-mail แจ่มเลย Smiley
หาเปลี่ยนเครื่องเปลี่ยน IP ลองดูได้จาก
refer:http://help.directadmin.com/item.php?id=57
ของผมนั้นที่จะทำก็แค่แทนที่เครื่องทุกอย่างเหมือนเดิม IP เดิม น่าจะง่ายหน่อย
สิ่งที่ต้องการคือ downtime น้อยที่สุด
ขั้นตอนของผมก็ง่ายๆ
1. เข้า directadmin เครื่องเดิม โดย admin ทำการ backup โดยกดที่ "Admin Backup/Transfer" แล้วก็รอไปหลายชม. (ล่าสุด P4 ram2GB ไฟล์แค่ 30GB รอไป 14 ชม.) Embarrassed
refer:http://help.directadmin.com/item.php?id=269
2. เข้า directadmin client แล้วสร้าง license ใหม่ แล้วเมลล์หา sales บอกว่าขอให้ช่วย activate ให้ซัก 2-3 วัน เพื่อใช้ในการ setup
ที่ต้องทำแบบนี้เพราะว่าตอนเราลงนั้นกินเวลา เราจึงลง directadmin จาก IP อื่นก่อน
3. ติดตั้ง FreeBSD ณ วันที่เขียนยัง support แค่ 7.2 เราเลยลง 7.2 64bit เครื่องใหม่เป็น CPU XEON ให้เลือกใช้ amd64 ตอนติดตั้งก็ให้ติดตั้งแบบ ไม่ลงอะไรเลย ผมเลือก ลงเพิ่มคือ source ต่างๆ Developer จได้ ports มารอไว้เผื่อลงอะไรเพิ่ม
DELL R210 บน FreeBSD 7.2 หรือ 8 ก็ตาม แบบ 64bits ต้องใช้แรม ECC ถึงจะเรียก sysinstall ขึ้น หลังจาก setup เสร็จใช้ non-ECC ได้ปกติ
3. ติดตั้ง wget with ssl ใช้ในการ โหลดไฟล์ (ที่ต้องมี ssl เพราะเวลา directadmin check license ใช้ผ่าน ssl)
Quote
wget http://files.directadmin.com/services/wget-1.8.2.tar.gz
tar xvzf wget-1.8.2.tar.gz
cd wget-1.8.2
./configure --prefix=/usr --with-ssl
make
make install
refer:http://help.directadmin.com/item.php?id=119
4. เริ่มติดตั้ง directadmin ตามขั้นตอน ก็ใส่ client id เราและ license สำหรับ ip ชั่วคราวนี้ไปก่อน
Code:
wget http://www.directadmin.com/setup.sh
chmod 755 setup.sh
./setup.sh
เวลาลงเสร็จให้ดู password ไว้ด้วย หากไม่ทันดูหรือจำไม่ได้ ให้ทำการเปลี่ยน Password ที่ user admin
refer:http://www.directadmin.com/installguide.html
5. หลังจากติดตั้ง directadmin เสร็จ ก็รอจนกว่าจะ backup เครื่องเก่าเสร็จ อาจกินเวลารอหลายชม. สมมุติว่าเสร็จแหละ Tongue
ก็ทำการ FTP file จาก folder /home/admin/admin_backups มาไว้ในเครื่องใหม่ที่เดียวกัน
Quote
mget *.gz
6. เสียวสุด Grin ทำการสลับ IP ให้เครื่องใหม่เป็น IP เดิม และดับเครื่องเก่าให้มันพักผ่อนซะหน่อย โดยแก้ไขไฟล์
Quote
/etc/rc.conf
Quote
defaultrouter="192.168.1.1"
hostname="guru.gumairu.com"
ifconfig_bce0="inet 192.168.1.2 netmask 255.255.255.252"
ifconfig_bce0_alias0="inet 192.168.1.3 netmask 255.255.255.252"
ตรง alias คือการทำให้มีหลายๆ IP บน NIC ตัวเดียว จะกี่IP ก็ต่อไปเรื่อย alias0,alias1 ...
ทั้งตรง IP,netmask,gateway
เมื่อแก้เสร็จก็ทำการ restart service
Quote
/etc/rc.d/netif restart && /etc/rc.d/routing restart
ตอนนี้เครื่องใหม่ก็มาแทนเครื่องเดิมละ แต่เว็บมันก็ยังเข้าไม่ได้นะสิ !!! Shocked
refer:http://www.cyberciti.biz/tips/freebsd-how-to-start-restart-stop-network-service.html
7. ทำการบอก directadmin ว่าเปลี่ยน IP
Code:
/usr/local/directadmin/scripts/ipswap.sh
ให้ดีก็ restart เครื่องไปเลย
8. get license ใหม่โดยต้องกลับไปใช้ license เดิมบน server เครื่องเดิม
Code:
cd /usr/local/directadmin/scripts
./getLicense.sh [ClientID] [LicenseID] [IP]
/usr/local/directadmin/directadmin restart
refer:http://help.directadmin.com/item.php?id=30
9. เข้า directadmin control panel แก้ไข Default IP และ เพิ่ม IP ตรงเมนู แล้วก็ไปที่เมนู "Admin Backup/Transfer" คราวนี้ก็ทำการกด restore แล้วก็รอพอเสร็จมันจะมี msg แจ้ง (ตอนrestore ใช้เวลาแค่ 50 นาทีเอง)
เสร็จแล้วง่ายเนอะ กลับมาจะเหมือนเดิมทุกอย่างทั้ง path permission password e-mail แจ่มเลย Smiley
หาเปลี่ยนเครื่องเปลี่ยน IP ลองดูได้จาก
refer:http://help.directadmin.com/item.php?id=57
30/03/2011 | 13:59:44
How to change server IP address on DirectAdmin
If your server requires a new server IP due to server move, or network restructuring, follow the following steps to update your license and system.
1) Contact DirectAdmin ahead of the move to notify them of the new IP address. Include the old IP, and license ID. Note that if you have an internal license, you must be the datacenter to make this request. If you cannot view your license from your clients section then you do not have authority to issue the request. Note that DirectAdmin will continue to run even after we change the IP. You just can't update the license or DA at this time. Also ensure you have enough time before the license expires (eg: more than a day).
2) Boot the server with the new server ip. Do this the same way you did originally for the old server IP. This should be done in your system's network settings and not in DirectAdmin (yet). Do not add the IP to DA through the IP Manager.
DirectAdmin will not be running, as the license file will be invalid.
Assuming we got your email and processed the request in step 1), you should now be able to get the new license file:
cd /usr/local/directadmin/scripts
./getLicense.sh 1234 56789
and replace 1234 with your client ID number, and replace 56789 with your license ID number. See this guide for more information on downloading the license.key.
3) Start DirectAdmin with the new license:
/etc/init.d/directadmin restart
The dataskq may have already started it, thus the restart instead of just "start".
4) Run the ipswap.sh script to replace the old server IP (1.2.3.4) with the new server IP (4.3.2.1)
cd /usr/local/directadmin/scripts
./ipswap.sh 1.2.3.4 4.3.2.1
This script can be run on any ip, so if you want to change all ips with new ones, just run this script for each old ip with the new ip. Just ensure that you match the new server ip with the old one. As mentioned before, you must not add the new IP do DA through the IP Manager. The new server IP is to be added using the ipswap.sh script. It will remove the old IP as well automatically.
Restart everything:
/etc/init.d/httpd restart
/etc/init.d/proftpd restart
/etc/init.d/exim restart
/etc/init.d/dovecot restart
etc.
Make sure they are correctly binding to the new ports by testing them.
Note for any domain that will have it's IP change, you may notice dns propogation delay. See the Related Guides below to lower the TTL before doing the move, and also why you may be seeing the apache or shared IP page after an IP change.
If your server requires a new server IP due to server move, or network restructuring, follow the following steps to update your license and system.
1) Contact DirectAdmin ahead of the move to notify them of the new IP address. Include the old IP, and license ID. Note that if you have an internal license, you must be the datacenter to make this request. If you cannot view your license from your clients section then you do not have authority to issue the request. Note that DirectAdmin will continue to run even after we change the IP. You just can't update the license or DA at this time. Also ensure you have enough time before the license expires (eg: more than a day).
2) Boot the server with the new server ip. Do this the same way you did originally for the old server IP. This should be done in your system's network settings and not in DirectAdmin (yet). Do not add the IP to DA through the IP Manager.
DirectAdmin will not be running, as the license file will be invalid.
Assuming we got your email and processed the request in step 1), you should now be able to get the new license file:
cd /usr/local/directadmin/scripts
./getLicense.sh 1234 56789
and replace 1234 with your client ID number, and replace 56789 with your license ID number. See this guide for more information on downloading the license.key.
3) Start DirectAdmin with the new license:
/etc/init.d/directadmin restart
The dataskq may have already started it, thus the restart instead of just "start".
4) Run the ipswap.sh script to replace the old server IP (1.2.3.4) with the new server IP (4.3.2.1)
cd /usr/local/directadmin/scripts
./ipswap.sh 1.2.3.4 4.3.2.1
This script can be run on any ip, so if you want to change all ips with new ones, just run this script for each old ip with the new ip. Just ensure that you match the new server ip with the old one. As mentioned before, you must not add the new IP do DA through the IP Manager. The new server IP is to be added using the ipswap.sh script. It will remove the old IP as well automatically.
Restart everything:
/etc/init.d/httpd restart
/etc/init.d/proftpd restart
/etc/init.d/exim restart
/etc/init.d/dovecot restart
etc.
Make sure they are correctly binding to the new ports by testing them.
Note for any domain that will have it's IP change, you may notice dns propogation delay. See the Related Guides below to lower the TTL before doing the move, and also why you may be seeing the apache or shared IP page after an IP change.
1.ติดต่อ DirectAdmin ว่าจะเปลี่ยนเป็นอีก IP
2.เมื่อทาง DirectAdmin เปลี่ยนให้แล้วให้Runคำสั่ง
Code: [Select]
cd /usr/local/directadmin/scripts
./getLicense.sh UID LID3.ถ้าไม่มี Error ให้ Restart DirectAdmin ด้วยคำสั่ง
Code: [Select]
service directadmin restart4.Download Script สลับ IP จากเว็บ DirectAdminแล้ว Run
Quote
wget http://www.directadmin.com/ipswap.sh
chmod 755 ipswap.sh
5.Restart ทุกอย่าง (IMMO: Restart เครื่องง่ายกว่ามั้ย)
6.Update User list