Monthly Archives: December 2013

Ubuntu NFS-command client package as follows shared directory on Ubuntu

เริ่มแรกต้องทำการติดตั้ง  ตัวโปรแกรมก่อน

  1. $sudo apt-get update
  2. $sudo  apt-get install nfs-common

จากนั้นระบบจะถามยืนยัง การติดตั้งโปรแกรม ให้ตอบ  Y ถ้าต้องการติดตั้ง

Continue reading

คำสั่งในการลบ file Remove or Delete a File on ubuntu

ใช้แค่คำสั่ง rm  ตัวอย่าง
ต้องการลบ file ชื่อ abc.txt

  1. $ rm abc.txt

คำสั่ง ลบ file และ remove all files & subdirectories from a directory 

  1. $ rm -rf mydir



To remove empty directory use rmdir and not rm command:

  1. $ rmdir mydirectory

ยกเลิกการติดตั้ง Webmin Remove

ต้องการยกเลิก โทรวิธีที่ติดตั้ง แบบ RPM โดยใช้คำสั่งนี้

  1. # rpm -ev webmin

กรณีที่ เป็น Webmin Source Installation

คัดลอกโค้ดทั้งหมด

  1. # /etc/webmin/uninstall.sh

ติดตั้ง vsftpd Ubuntu Linux vsftpd ftp service / server install, configuration

เริ่มเลย ทำการติดตั้ง โปรแกรมก่อน

  1. $ sudo apt-get install vsftpd

Output: ทำตามขั้นตอนด้านล่างเลยนะครับ

  1. Reading package lists… DoneBuilding dependency treeReading state information… DoneThe following NEW packages will be installed:  vsftpd0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.Need to get 121kB of archives.After unpacking 438kB of additional disk space will be used.Get:1 http://us.archive.ubuntu.com edgy/main vsftpd 2.0.4-0ubuntu5 [121kB]Fetched 121kB in 0s (246kB/s)Selecting previously deselected package vsftpd.(Reading database … 31396 files and directories currently installed.)Unpacking vsftpd (from …/vsftpd_2.0.4-0ubuntu5_amd64.deb) …Setting up vsftpd (2.0.4-0ubuntu5) …Adding system user `ftp’ with uid 106…Adding new user `ftp’ (106) with group `nogroup’.Not creating home directory `/home/ftp’. * Starting FTP server: vsftpd

เสร็จแล้วทำการ  Configure /etc/vsftpd.conf โดยใช้คสั่ง nano หรือ vi ก็ได้ครับ แล้วแต่ความถนัด  อิอิ ส่วนผมจะใช้ nano

อ้างอิง
$ sudo nano /etc/vsftpd.conf

แล้วเข้าไปเปลี่ยน  ตามนี้เลยนะครับ

  1. local_enable=YES
  2. write_enable=YES
  3. chroot_local_user=YES

เสร็จแล้วให้ save  แล้ว รอง restart vsftpd

  1. $ sudo /etc/init.d/vsftpd restart

เสร็จแล้วรองใช้งานดูนะครับ    ง่าย ๆ   รวดเร็ว

การแก้ไข ip address บน Linux ( CentOS , Redhat )

1. ใช้โปรแกรม Editor เช่น nano editor แก้ไขไฟล์ /etc/sysconfig/network-scripts/ifcfg-eth0 ( กรณีเป็น Ethernet 0 )

  1. DEVICT=eth0
  2. BOOTPROTO=static
  3. HWADDR=00:22:19:D4:C6:C7
  4. IPV6INIT=yes
  5. IPV6_AUTOCONF=yes
  6. NETMASK=255.255.0.0
  7. NETWORK=172.18.10.5
  8. NOBOOT=yes

2. แก้ไข GATEWAY ได้ที่ไฟล์ /etc/sysconfig/network ( กรณีใส่ GATEWAY ไว้ที่ interface แล้วไม่ต้องใส่อีก )
3. ใช้คำสั่ง service network restart เพื่อ restart ให้ใช้ ip ใหม่
4. ใช้คำสั่ง ifconfig เพื่อดู ว่า ip address ของเราตอนนี้เป็น ip อะไรแล้ว
5. ทดสอบ ping ไปยังเครื่องอื่นในวงเดียวกัน และ default gateway เพื่อทดสอบดูว่าสามารถไปได้ไหม
6. จำไว้ว่า default gateway ต้องเป็น network วงเดียวกันเท่านั้น
7. กรณีแก้ชั่วคราวสามารถใช้คำสั่งนี้ได้
ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up
แต่จำไว้ว่าแบบนี้ ip address จะกลับไปเป็นตาม ip ที่อยู่ใน configure file กรณี boot เครื่องใหม่

IP-PBX IP Phone ทำโทรศพท์ ผ่านระบบ Lan แบบใช้งานได้จริง ครับ

ที่ผมจะนำเสนอนี้คือ เป็น ของ asterisknow  เป็น ตัวที่ใช้งานได้ง่าน และติดตั้งใช้เวลาประมาณ 30 นาที   Config ผ่าน เว็บได้เลย

asterisknow   เป็นระบบ  linux centos  ผู้ที่สนใจ รองไปดาวโหลดมาทดสอบได้ที่ เว็บ asterisk.org  ดาวโหลด ที่เป็น file iso เสร็จแล้วนำมา burn ใน iso ลงแผ่น CD แล้วนำไปติดตั้ง ส่วนโปรแรกมที่ใช้ในการทดสอบ โทรศัพท์ ผ่าน คอมพิวเตอร์ สามารถดาวโหลดได้ ผมใช้ X-Lite_Win32_1104o_56125_100106
การติดตั้ง และ Config  เดียวจะมาพูดต่อ ในโอกาศหน้าครับ

ติดตั้ง Install PhpMyAdmin On Ubuntu แบบรวดเร็ว

  1. # apt-get install phpmyadmin

แล้วระบบจะให้ใส่ รหัส ฐานข้อมูล และ รหัสผ่าน สำหรับ Admin   เสร็จแล้ว

เรียกเข้าใช้งานได้เลย

  1. http://ipserver/phpmyadmin

วิธีติดตั้ง webadmin สำหรับ Ubuntu ง่าย ๆ รวดเร็ว

อันดับแรกต้องติดตั้ง  perl5 libnet-ssleay-perl  โดยใช้คำสั่งดังนี้

  1. #sudo apt-get install perl5 libnet-ssleay-perl

จากนี้ให้ดาวโหลด webmin มาติดตั้ง  ที่ server

  1. # wget http://prdownloads.sourceforge.net/webadmin/webmin-1.310.tar.gz
  2. # sudo tar xzvf webmin-1.310.tar.gz
  3. # cd webmin-1.310
  4. # sudo sh setup.sh
  5. ระบบจะติดตั้ง ก็ทำตาม ขั้นตอน ได้เลยครับ
  6. # Config file directory [/etc/webmin]:
  7. Leave as default, or change as you wish
  8. Log file directory [/var/webmin]:
  9. Leave as default, or change as you wish
  10. Full path to perl (default /usr/bin/perl):
  11. Leave as default, or change as you wish
  12. Operating system:
  13. Enter ‘6′
  14. Version:
  15. Enter ‘6′
  16. Web server port (default 10000):
  17. This is where you can start to make webmin more secure then the standard install you get with apt-get, Synaptic, or RPM. Leave as default or change it to what ever port you want.
  18. Login name (default admin):
  19. It is ‘admin’, so you can leave it as that, or put in any name that you like.
  20. Login password:
  21. By creating the user above and giving it a password, you have now made it so you will not need to log into webmin with root.
  22. Password again:
  23. enter your password again
  24. If you did not install ‘libnet-ssleay-perl’ you will get the following message:
  25. ‘The Perl SSLeay library is not installed. SSL not available.’ You can continue with the install, but it would be more secure if you install sslrelay.
  26. Use SSL (y/n):y
  27. Choose yes here
  28. Start Webmin at boot time (y/n):y
  29. select here y
  30. At this point it is going to configure things, install things, and create things…
  31. It will then tell you that you can log in to https://hostipaddress:10000 and to accept the certificate.
  32. Webmin User Password Change
  33. If you want to change root password in webmin use this included Perl script:
  34. sudo /usr/share/webmin/changepass.pl /etc/webmin root

เสร็จแล้ว เรียกเข้าใช้งานได้ เลยครับ
https://ip_server:10000

ีรองดูนะครับ  แจ่ม เลย

linux ทำให้ user แต่ละ user ทำเว็บได้

ต้องสร้าง public_html directory in home directory ของ user แต่ละคนก่นอถึงจะใช้ทำเว็บได้

# mkdir ~/public_html  หรือ mkdit /home/user [ชื่อสมาชิก]/public_html

ต่อด้วยคำสั่งนี้ครับ  คือการเปิดใช้งาน user directory
cd /etc/apache2/mods-enabled sudo ln -s ../mods-available/userdir.conf userdir.conf sudo ln -s ../mods-available/userdir.load userdir.load

เสร็จแล้ว Restart Apache

# sudo /etc/init.d/apache2 restart

วิธีเรียกใช้งาน  http://ip_server/~user ชื่อสมาชิก

จบแล้วครับ