แก้ไข
/etc/bash.bashrc
เพิ่ม
#Java Environment Variable
JAVA_HOME=/usr/lib/jvm/jdk1.7.0/
export JAVA_HOME
JRE_HOME=/usr/lib/jvm/jdk1.7.0/jre
export JRE_HOME
PATH=$PATH:$JAVA_HOME:$JRE_HOME
export PATH
ถ้าเป็น JAVA 8
#Java Environment Variable
JAVA_HOME=/usr/lib/jvm/jdk1.8.0/
export JAVA_HOME
JRE_HOME=/usr/lib/jvm/jdk1.8.0/jre
export JRE_HOME
PATH=$PATH:$JAVA_HOME:$JRE_HOME
export PATH
Posted: March 29th, 2013
Categories:
how-to,
linux
Tags:
่java
Comments:
No Comments.
ท่าานเจอกับปัญหา nginx error log โชว์แต่ error ว่าไม่พบ favicon.ico ใช่หรือไม่?
2013/03/27 14:48:45 [error] 7924#0: *2436 open() “/home/nginx/activity.xxx.com/htdocs/favicon.ico” failed (2: No such file or directory), client: 119.44.16.42, server: activity.xxx.com, request: “GET /favicon.ico HTTP/1.1″, host: “praew.xxx.com”
2013/03/27 14:48:48 [error] 7924#0: *2436 open() “/home/nginx/activity.xxx.com/htdocs/favicon.ico” failed (2: No such file or directory), client: 119.44.16.42, server: activity.xxx.com, request: “GET /favicon.ico HTTP/1.1″, host: “praew.xxx.com”
2013/03/27 14:48:50 [error] 7924#0: *2436 open() “/home/nginx/activity.xxx.com/htdocs/favicon.ico” failed (2: No such file or directory), client: 119.44.16.42, server: activity.xxx.com, request: “GET /favicon.ico HTTP/1.1″, host: “praew.xxx.com”
ทางแก้คือ.. บอกให้ nginx ส่งค่า 204 ไปยัง browser ครับ
nginx.conf
http {
....
...
..
.
server {
location = /favicon.ico {
return 204;
access_log off;
log_not_found off;
}
}
}
Posted: March 27th, 2013
Categories:
how-to,
linux
Tags:
favicon,
nginx
Comments:
No Comments.
คือแบบว่า imagemagick มันช้าครับ
เลยต้องหาวิธีที่จะ convert ได้ไวไว เลยไปเจอกับ epeg
# git clone git://github.com/mattes/epeg.git
# aptitude install build-essential cdbs debhelper libjpeg62-dev automake
# ./configure
# make
# make install
# cp src/lib/.libs/libepeg.so* /usr/lib/
ทดสอบการใช้งาน
root@server:# time convert -resize 230 london-hq-sunny.jpg london-hq-sunny_230.jpg
real 0m0.889s
user 0m0.336s
sys 0m0.032s
root@server:# time epeg -w 230 -h 144 london-hq-sunny.jpg london-hq-sunny_230.jpg
real 0m0.016s
user 0m0.004s
sys 0m0.012s
เร็วสุดชีวิต!
ref:
http://superuser.com/questions/249646/fastest-jpeg-thumbnail-generator-for-linux
Posted: March 18th, 2013
Categories:
how-to,
linux
Tags:
epeg,
imagemagick
Comments:
No Comments.
ปัญหาแบบนี้
$ mv item_display/* ../item_display/
bash: /bin/mv: Argument list too long
แก้โดย
find /path/to/file -type f | xargs -i mv “{}” /path/to/move
หรือ
find /path/to/file -type f -name '*' -exec mv {} /path/to/move/. \;
หรือแบบยากๆเลย
http://www.linuxjournal.com/article/6060
Posted: March 18th, 2013
Categories:
how-to,
linux
Tags:
cli,
command
Comments:
No Comments.
เมื่อติดตั้ง drupal แล้วเจอปัญหาว่า
Requirements problem
The following error must be resolved before you can continue the installation process:
register_globals is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when register_globals is enabled. The PHP manual has instructions for how to change configuration settings. (Currently using PHP register globals Enabled (’1′))
แก้ได้ด้วยตัวเองโดยไม่ต้องบอกให้ system admin แก้ไขระบบ ด้วยการ
สร้าง php.ini ไว้ที่ root document โดยมีข้อมูลข้างใน คือ
[PHP]
register_globals = Off
ref :
http://drupal.org/node/216882
Posted: March 17th, 2013
Categories:
how-to,
linux
Tags:
drupal,
php
Comments:
No Comments.