May 18

อันนี้เป็น checklist สำหรับ ตั้ง Server ใหม่สำหรับ Ubuntu 8.04 Server นะครับ
ก็ขึ้นกับว่าใครจะทำอะไรบ้างแต่อันนี้เป็นของที่ผมคิดว่า น่าจะเหมาะกับการเป็น Server ครับ

  • /etc/network/interface - pre-up /etc/network/iptables.firewall : เพิ่มกฏ Iptables Firewall
  • vi /etc/default/rcS - UTC=no : แก้ไขเวลาเครื่องและเวลาของระบบ ให้เป็นเวลาของประเทศไทย
  • backup /etc/init.d : ไว้สำหรับแก้ไขไฟล์ เก็บไว้ก่อน
  • /etc/init.d/apparmor stop && update-rc.d -f apparmor remove : ยกเลิกการใช้งาน apparmor
  • ln -sf /bin/bash /bin/sh : แก้ไข default shell
  • apt-get remove pcmciautils ubuntu-minimal pppoeconf ppp pppconfig
  • update-rc.d -f pcmciautils remove
  • /etc/ssh/sshd_config - PermitRootLogin no

เก็บไว้ติดตั้งเรื่อย Ubuntu 8.04 เป็น LTS (Long Term Support) ด้วยครับ จะได้ใช้ไปอีกนานๆ

written by Mr-San \\ tags: , ,

Apr 21

หากใครหา php5-gmp ซึ่งจะไปใช้กับ Ubuntu 7.10 ก็จะหาไม่ได้นะครับ ขั้นแรกคือรอ Ubuntu 8.04 (Hardy Heron) ซึ่งจะมีให้เลย แถมยังเป็น LTS (Long Time Support) อีกด้วย ก็จะ launch ในวันที่ 24 เมษายน ที่จะถึงนี้เอง
แต่พอดีผมใช้อยู่และรอไม่ได้ก็เลยต้องหาวิธีทำให้ PHP5 ของ Ubuntu 7.10 ใช้ได้ก็เลยไปหาใน Ubuntuforums.org มีคนทำเป็น package ด้วย link ดูได้จากด้านล่างนะครับ (อีกที่ มี compile package ไว้ให้ด้วย)
ผมได้แก้ให้เป็น version 5.2.3 ครับ แต่วิธีการเดียวกัน

Steps to enter at the command line:

1. apt-get install build-essential debhelper libgmp3c2 libgmp3-dev

(More tools might be needed depending on what you already have installed, but you will tend to get warnings about what is missing)

Then, download the PHP sources:

2. apt-get source php5

My version is 5.2.3, but yours may be different.

Get all the dependencies for building PHP:

3. apt-get build-dep php5

Change into the debian build directory for PHP:

** Found problem with : libsnmp10-dev - virtual package with libsnmp-dev
used with apt-get install —all of package–

4. cd php5-5.2.3/debian

Let’s edit the modulelist file.

5. vi modulelist

Insert a line below the one that says

gd GD

with the contents:
gmp GMP

Next, edit the rules file. Either open it from gedit directly or use:

6. vi rules

Look for the line that says:

–with-curl=shared,/usr \

Open a line below this with the contents:
--with-gmp=shared,/usr \

Make sure not to forget the backslash on the end. Also, GMP installed itself into /usr/local on my machine. Your location may be different.

Now, we edit the control file. Again, either use the gedit GUI to open the file or type:

7.vi control

Add this to the end of the file:
Package: php5-gmp
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}, php5-common (= ${Source-Version})
Description:GMP module for php5
This package provides a module for GMP to be used with PHP5.
.
PHP5 is an HTML-embedded scripting language. Much of its syntax is borrowed
from C, Java and Perl with a couple of unique PHP-specific features thrown
in. The goal of the language is to allow web developers to write
dynamically generated pages quickly.

Make sure that you keep all that text as one big block with no extra lines between it. It’s ok to have an extra line after it, but not between it. Just see how the other entries are entered and go from there.

Move up a directory.

8. cd ..

Now, run:

9. sudo dpkg-buildpackage

This will do the whole configure/compile for PHP and create debs in the parent directory. This does take awhile, though. When this process is done, move up to the parent directory:

10. cd ..

And, you will see all of the PHP debs, including the new php5-gmp_[version].deb

Run a dpkg -i on the ones you need (I just used the gmp one):

11.dpkg -i php5-gmp_523-1ubuntu6.3_i386.deb

เป็นอันเสร็จพิธี อย่าลืม restart apache นะครับ

อ้างอิง

written by Mr-San \\ tags: , , ,

Sep 22

เจอปัญหาอีกแล้วครับ จากการติดตั้ง Ubuntu 7.04 Feisty Fawn เกิดจากระหว่าง Setup แล้วจะไปหยุด ตอน update-manager-core ที่ 85% นานมากๆๆ ทนไม่ไหว เลยไปหาๆ พบวิธีแก้ดังนี้

#login to tty2 (Ctrl-Alt-F2)
#kill pid id of apt-get update
ps awx|grep -i apt
kill (PID of apt)

หลังจากนั้น กลับมาที่ tty1 ตามปกติ (Ctrl-Alt-F1) ก็จะติดตั้งได้ต่อไป

written by Mr-San \\ tags: , , , ,

Apr 29

มี Course Training ภายใน GITS ก็เลยได้ทดสอบ Compile ด้วย Source ของ PHP บน Ubuntu อันนี้ก็ถือว่าเป็น สรุปละกันเพราะ มีปัญหาที่ต้องติดตั้งเพิ่มหลายจุดเหมือนกัน ก่อนหน้านี้เคยทำสำหรับ Freebsd ไว้แล้วที่ ลอง compile PHP ด้วย port ของ FreeBSD

ขั้นแรก ติดตั้ง Package ที่จำเป็นต่อการ compile ก่อน
apt-get install build-essential bison checkinstall fakeroot
apt-get install flex libgd2-xpm libgd2-xpm-dev libxml2 libxml2-dev libbz2-dev libpng12-0 libpng12-dev libfreetype6 libfreetype6-dev libcurl3 libcurl3-devlibjpeg62 libjpeg62-dev

ต่อจากนั้นก็ เริ่ม compile เลยครับ
./configure \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-zlib \
--with-bz2 \
--with-gd \
--enable-gd \
--enable-gd-native-ttf \
--with-jpeg-dir \
--with-png-dir \
--with-ttf \
--with-freetype-dir \
--with-iconv \
--enable-track-vars \
--with-gettext \
--enable-trans-id \
--with-cpdflib \
--enable-mbstring \
--with-openssl
กรณี ต้องการใช้ร่วมกับ mysql ให้เพิ่ม --with-mysql
กรณี ต้องการใช้ร่วมกับ curl ให้เพิ่ม --with-curl

แล้วก็อย่าลืมเพิ่มบรรทัด ของ PHP ใน httpd.conf ด้วยนะครับ
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

ที่เหลือก็ php.ini แก้ไขตามต้องการครับ ตอนนี้ default จะอยู่ที่ /usr/local/lib/php.ini

written by Mr-San \\ tags: , , ,

Jan 25

Problem again, as I think it’s easy it will be late. This problem about setting up Ubuntu 6.06.1 on Dell PowerEdge 2950.

เจอปัญหาอีกแล้ว นึกว่าจะติดตั้งได้ไว (ปัญหาในการทำ computer 1 ข้อ ก็คือ อะไรที่คิดว่าน่าจะเสร็จได้ไว มักจะมีปัญหาทำให้ล่าช้าทุกครั้ง) เป็นปัญหาการติดตั้ง Ubuntu 6.06.1 บน Dell PowerEdge 2950

Dell PowerEdge 2950 (as in x9xx series) used PERC5/i then ubuntu’s kernel don’t have megaraid_sas in this version (2.6.15). When you setup will see more drive than you think
ex. if your server have 3 HD it will shown 4 HD (the last drive as RAID)
but you can install ubuntu in it but when restart, you found Grub loading error 21.

ปัญหาเกิดจาก Dell PowerEdge 2950 (ใน series นี้น่าจะเป็นหมด) ใช้ PERC 5/i ซึ่ง kernel ของ Ubuntu ไม่มี module นี้ ทำให้มองเห็น RAID ต่างๆที่กำหนดไว้ เพิ่มมาอีก 1 drive เช่น มี HD 3 ตัว จะเท่ากับว่ามี HD 4 ตัวรวม RAID ซึ่งถ้าทำ RAID 5 ควรจะเห็น HD เพียงแค่ ตัวเดียว ซึ่งทำให้หลังจากติดตั้ง Ubuntu เสร็จจะไม่สามารถ boot ได้ และจะขึ้น Grub loading error 21 ไม่ว่าจะทำไงก็จะ error ทุกครั้งเศร้า

This problem solve by Robert (ubuntuforums.org) but I change it to my setting :

ปัญหานี้ มีวิธีแก้ไขเขียนโดย คุณ Robert (ubuntuforums.org) ซึ่งขอปรับให้เข้ากับที่ใช้กับผมเอง
- HD เป็น SATA 3 ตัว ทำ RAID 5
Continue reading »

written by Mr-San \\ tags: , ,

Close
E-mail It