Aug 12

รับสมัคร System Engineer รายละเอียดดังนี้ครับ
สนใจส่ง Resume มาที่ ton [at] packetlove.com
สอบถามเพิ่มเติม +66868885195 (Ton)

Responsibilities
- Participate in the design, implementation and ongoing management of systems architectures that form the foundation for Weloveshopping.com production infrastructure
- Participate in the design of architectures and automation that deliver against strict requirements for functionality, scalability, performance and reliability
- Become proficient in understanding how each software component, system design, and configuration is linked together to form an end-to-end solution
- Serve in a low-volume on-call rotation as an escalation contact during incidents.

Requirements
- BS or MS degree in Computer Science, Engineering, related technical discipline, or equivalent experience
- Minimum of 3 years administering Linux systems in a production environment
- Proven ability to quickly learn and implement unfamiliar technologies
- Extensive expertise with configuration management systems
cfengine experience a plus
- Configuration and maintenance of common applications such as Apache, Nginx, Memcached, noSQL, Squid, MySQL, NFS, DHCP, NTP, SSH, DNS, and SNMP
- Strong knowledge of Linux kernel configuration, performance monitoring, and tuning
- Advanced experience coding in one of the following languages: Shell, Python or Perl
- Prefer experience coding and/or debugging one or more of the following: PHP, C++ or Ruby
- Experience working with load balancing technologies and large-scale web server farms
- A strong background in internet service deployment, provisioning, IP networking, service infrastructure, or software deployments
- Excellent organization skills, project tracking abilities, communications skills
- Detail oriented with excellent written and verbal communication skills.

Tagged with:
May 25

สวัสดีครับ วันนี้เจอเรื่องปวดหัวนิดหน่อย เกี่ยวกับการเขียน rewrite ของ nginx
ให้ codeigniter  สามารถทำงานได้ เพราะปกติบน apache2 จะใช้ .htaccess
ผมจะไม่พูดถึงการ install nginx+PHP Fast-CGI  นะครับ เพราะคิดว่าหาอ่านได้
ไม่ยากนัก แต่จะพูดถึงการเขียน rewrite ที่ทำให้ nginx ทำงานร่วมกับ codeigniter
มาดูกันเลยครับ ขั้นตอนมีดังนี้

location /
{
index index.php;
root /path/to/your/ci/directory;

if ($request_filename !~ (js|css|images|robots\.txt|index\.php.*) ) {
rewrite ^/(.*)$ /index.php/$1 last;
}
}

location ~ /index.php/
{
include /usr/local/nginx/conf/fastcgi.conf;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /path/to/your/index.php;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_pass 127.0.0.1:9000;
}

จากนั้นทำการแก้ไข file application/config/config.php ของตัว CodeIgniter
ให้เป็น $config['uri_protocol']  = “REQUEST_URI”;
เท่านี้ก็จะทำให้เราสามารถใช้งาน CodeIgniter กับ nginx ได้แล้วครับ ..

Tagged with:
Sep 19

FTP มาจาก IP แปลก ๆ เมืองนอก

FTP มาจาก IP แปลก ๆ เมืองนอก

สวัสดีครับ ไม่ได้มา Update Blog หลายวัน วันนี้จะแก้ไขเว็บ Travel-is.com
แต่ปรากฏว่าเจอ Tag <iframe> .. </iframe> แปลก ๆ ซึ่งเป็นที่ระบาดในตอนนี้
สาเหตุมาจาก Program ที่ใช้ FTP ติด Virus แล้ว Password จะถูกส่งออกไป
ให้ Cracker เพื่อใช้ในการ FTP เข้ามาเปลี่ยน file index.*, main.* ทำให้เว็บเรา
อาจะถูก Google แจ้งเตือนว่าเป็น site อันตราย ไม่เป็นผลดีต่ออันดับในการค้นหา

สำหรับวิธีการหาว่ามีการ FTP จากที่อื่นหรือไม่ ใช้คำสั่ง last | more
ส่วนคำสั่งในการหาว่า file ไหนบ้างติด virus iframe ให้ใช้ find ตามด้วย grep
ดังนี้ครับ find . -type f -name “*.php” -print | xargs grep “iframe” ก็จะรู้ว่า
file ไหนติด iframe ตรงไหน แล้วก็ทำการแก้ไข โดยการลบ iframe พวกนี้ออกไป
แล้วก็อย่าลืมเปลี่ยน Password FTP นะครับ ..

Tagged with:
Aug 04

อ่านบทความจาก http://highscalability.com/youtube-architecture แล้วชอบ
ระบบของ Youtube.com มาก ๆ เจ๋งดี ..

Recipe for handling rapid growth

while (true)
{
identify_and_fix_bottlenecks();
drink();
sleep();
notice_new_bottleneck();
}

จริง ๆ ระบบจะใหญ่ได้ ก็คือระบบที่คืนสู่สามัญที่สุด คือ simple มากที่สุด
แต่มีการเพิ่มจำนวนในแบบ flat ได้มากที่สุด พวกระบบใหญ่ ๆ ของโลก
ใช้ server ขนาดเล็ก แต่ใช้จำนวนมาก ช่วยกันทำงาน ทำให้เวลาเครื่องใด
เครื่องนึงมีปัญหา ก็ยังสามารถทำงานต่อไปได้ uptime 100% ..

Tagged with:
Sep 05

Sphinx a full-text search engine

ตอนนี้ Server นิ่งแล้ว ก็เลยมีเวลามาทำ R&D เกี่ยวกับระบบ Search
เพื่่อนตั้ม (http://www.thaiajax.com) โปเกม่อนเทพ แนะนำ
ว่าให้เอา Sphinx มาช่วย ก็เลยต้องเป็นหน้าที่ผม ที่ต้องทำ Server
ให้ Support หาข้อมูลได้น้อยมากเกี่ยวกับตัว Sphinx ยิ่งในไทย
เท่าที่เห็น ยังไม่มีเลย เพราะคงไม่ต้องใช้ถึงขนาดนี้ ระบบไม่ใหญ่ ..
นั่งงมอยู่นานเหมือนกัน เพราะไม่เคยใช้ หาอ่าน Doc ของเว็บ Sphinx
ก็มีให้อ่านน้อยมาก ๆ แต่เว็บอื่น ๆ มีอยู่พอสมควร ..

ตอนนี้เรื่องการใช้งานการปรับแต่งอะไร ก็กำลัง test กันอยู่ ผมเอา
วิธีการ config มาให้เพื่อน ๆ ที่สนใจได้อ่านกันละกัน เพราะว่ากว่าที่
ผมจะ config ได้ ก็ใช้เวลาพอสมควรเหมือนกัน เลยเอามาแบ่งปัน ..

Install MySQL SphinxSE CentOS 5.2

yum -y install bison patch automake libtool

wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.67.tar.gz/from/http://mysql.thaiweb.net/
tar xfz sphinx*
tar xfz mysql*

cd mysql*
patch -p1 < ../sphinx-0.9.8/mysqlse/sphinx.5.0.37.diff
BUILD/autorun.sh
mkdir sql/sphinx
cp ../sphinx-0.9.8/mysqlse/* sql/sphinx
./configure –prefix=/usr/local/mysql –with-sphinx-storage-engine
make
make install

cp support-files/mysql.server /etc/init.d/
/etc/init.d/mysql.server start

mysql> SHOW ENGINES;
+————+———+—————————————————————-+
| Engine | Support | Comment |
+————+———+—————————————————————-+
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys |
| BerkeleyDB | NO | Supports transactions and page-level locking |
| BLACKHOLE | NO | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE | NO | Example storage engine |
| ARCHIVE | NO | Archive storage engine |
| CSV | NO | CSV storage engine |
| SPHINX | YES | Sphinx storage engine 0.9.8 |
| ndbcluster | NO | Clustered, fault-tolerant, memory-based tables |
| FEDERATED | NO | Federated MySQL storage engine |
| MRG_MYISAM | YES | Collection of identical MyISAM tables |
| ISAM | NO | Obsolete storage engine |
+————+———+—————————————————————-+
13 rows in set (0.00 sec)

Install Sphinx

cd ../sphinx*
./configure --prefix=/usr/local/sphinx --with-mysql
make
make install

cd api/libsphinxclient
chmod +x buildconf.sh
./buildconf.sh
./configure
make
make install

Install PHP Sphinx extension
http://pecl.php.net/package/sphinx


cd ../../../
wget http://th.php.net/get/php-5.2.6.tar.gz/from/this/mirror
wget http://pecl.php.net/get/sphinx-0.2.0.tgz

tar xfz php-5.2.6.tar.gz
tar xfz sphinx-0.2.0.tgz
mv sphinx-0.2.0 php-5.2.6/ext/sphinx
rm configure
./buildconf –force
./configure –with-apxs2=/usr/local/apache/bin/apxs –with-mysql=/usr/local/mysql –enable-force-cgi-redirect –with-gettext –with-zlib-dir=/usr/local/zlib –enable-mbstring –with-curl=/usr/local/lib –with-sphinx
make
make install

ทำนี้ก็เป็นอันเรียบร้อยแล้วครับ สำหรับ MySQL+SphinxSE
และ PHP Sphinx Extension

Tagged with:
preload preload preload
eXTReMe Tracker