Wednesday, October 3, 2012

การทำลิ้งค์ภาษาไทย wordpress ให้ยาว ๆ

การทำลิ้งค์ภาษาไทย wordpress ให้ยาว ๆ

เทคนิคการทำลิ้งค์ภาษาไทยของ wordpress ให้ยาว ๆ

การทำบล็อกภาษาไทย ด้วย wordpress เมื่อใช้การ rewrite url มักจะโดยตัดข้อความให้ขาดหาย ถ้าใครพบกับปัญหานี้บ่อย ๆ เรามีเทคนิคในการแก้ไขง่าย ๆ มาฝาก

1. ให้เข้าไปค้นหาไฟล์ที่ชื่อ formatting.php ซึ่งอยู่ในไดเร็คทอรี่ wp-includes

2. ทำการเปิดไฟล์ formation.php แล้วค้นหา

$title = utf8_uri_encode($title, 200);

ตรงนี้แหละครับคือส่วนปัญหาเพราะมีการตัดส่วนไตเติ้ลให้เหลือแค่ 200 ตัวอักษร ซึ่งถ้าเป็นภาษาอังกฤษน่าจะพอเพียงแต่พอเป็นภาษาไทยหนึ่งคำในภาษาไทยใช้หลาย ตัวอักษร ให้ลองแก้ค่าให้มากขึ้นครับ เช่นแก้เป็น 1000

$title = utf8_uri_encode($title, 1000);

แล้วลองดูว่าบทความของเรามีลิ้งค์ที่สวยพอดีหรือยัง ถ้ายังมีตัดคำหายอยู่ก็ลองเพิ่มค่าดังกล่าวให้มากขึ้น

3. เข้าไปแก้ไขไฟล์ดาต้าเบส โดยเข้าไปที่ตาราง wp_posts ทำการแก้ไขฟิลด์ post_name ทำการเปลี่ยนค่าของ varchar(200) เป็น varchar(1000) หรือค่าที่เราทำการเปลี่ยนแปลง

ง่าย ๆ แค่ 4 ขั้นตอน แค่นี้ลิ้งค์ภาษาไทย wordpress ของเราก็สวยงามแล้ว

Kloxo error "Some of Horde's configuration files are missing or unreadable conf.php"

Kloxo error "Some of Horde's configuration files are missing or unreadable conf.php"

วันนี้ติดตั้ง kloxo ใหม่ ปรากฏว่า webmail ทั้ง Horde และ RoundCube ใช้ไม่ได้ ขึ้น error ทั้งคู่

Error ของ Horde
"Some of Horde's configuration files are missing or unreadable conf.php"

ลองค้นหาวิธีแก้ไขใน LxCenter พบทางแก้ที่ได้ผลคือใช้คำสั่ง

chmod 644 /home/kloxo/httpd/webmail/horde/config/conf.php

ปัญหาคือไฟล์ conf.php ได้เปลี่ยน Permission เป็น 600 ทำให้ใช้งานไม่ได้

Error ของ RoundCube
Roundcube had "Configuration Error: db.inc.php"

ปัญหาเกิดขึ้นอย่างเดียวกันคือ Permission ของ db.inc.php เป็น 600
ทางแก้ก็ใช้ putty เข้าไปใช้คำสั่ง

chmod 644 /home/kloxo/httpd/webmail/roundcube/config/db.inc.php

WordPress Rewrite on Lighttpd

WordPress Rewrite on Lighttpd
 
 สำหรับคนที่ใช้ kloxo แล้วเลือกใช้ Lighttpd เป็น Web Server ครับ   เหตุที่เขียนเรื่องนี้ เพราะวันนี้ได้ลองลง WP ไว้บนโดเมนอักหนึ่ง (ของชาวบ้านเขา) แล้วเจ้า htaccess ดันไม่ทำงานบน Lighttpd ผมเลยต้องนั่งแก้ยาวเลย ดูภาพเอาง่ายกว่าครับ (ขี้เกียจอธิบาย) ขั้นตอนที่สอง url.rewrite-final = ( # Exclude some directories from rewriting “^/(wp-admin|wp-includes|wp-content|gallery2)/(.*)” => “$0″, “^/(.*.php)” => “$0″, “^/(.*)$” => “/index.php/$1″ ) แล้วกด Update ซะ เท่านั้นก็เพียงพอแล้วครับ     ขอขอบคุณ Teetenblog.com ที่เป็นหนูทดลองยาให้ O_o iChethost.ez.lv โฮสราคาประหยัด อยู่กันเหมือนญาติ


This blog now runs on a Lighttpd (Lighty) webserver instead of Apache, and this means the configuration for ‘pretty URLs’ or permalinks of WordPress doesn’t work like it used to.
(As you might have noticed, I use permalinks like /2007/02/this-is-permalink/)

Whereas WordPress can automatically adapt the Apache .htacccess file to something like
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

it does not do anything automatically for your Lighty .conf configuration file (which is logical, since an application should not be allowed to mess with a central config file).

So what you have to use is:
  1. a WordPress blog installed in the root of your (sub-) domain:
    $HTTP["host"] =~ "{yourdomain}" {
    var.app = "{yourdomain}"
    accesslog.filename = base + "/logs/" + app + ".access.log"
    server.errorlog = base + "/logs/" + app + ".error.log"
    load php app
    url.rewrite = (
    "^/(wp-.+).*/?" => "$0",
    "^/(sitemap.xml)" => "$0",
    "^/(xmlrpc.php)" => "$0",
    "^/(.+)/?$" => "/index.php/$1"
    )
    }
  2. a WordPress blog installed in a subfolder (e.g. /blog/)
    $HTTP["host"] =~ "{yourdomain}" {
    var.app = "{yourdomain}"
    accesslog.filename = base + "/logs/" + app + ".access.log"
    server.errorlog = base + "/logs/" + app + ".error.log"
    load php app
    url.rewrite = (
    "^/?$" => "/blog/index.php",
    "^/blog/(wp-.+)$" => "$0",
    "^/blog/xmlrpc.php" => "$0",
    "^/blog/sitemap.xml" => "$0",
    "^/blog/(.+)/?$" => "/blog/index.php/$1"
    )
    }
The xmlrpc.php rule is necessary for external access (like, publishing from del.icio.us or Flickr), and the sitemap.xml file is something for Google Sitemaps.
For those stubborn visitors who always precede their URLs with www, you can also add a redirect:

$HTTP["host"] =~ "www.blog.forret.com" {
url.redirect = ( ".*" => "http://blog.forret.com")
}

วิธีแก้ SuPHP บน Kloxo 6.1.12 ไม่ Work ขึ้น Internal Server Error 500

วิธีแก้ SuPHP บน Kloxo 6.1.12 ไม่ Work ขึ้น Internal Server Error 500

 รื่องโดยสรุปของปัญหานี้ก็มีอยู่ว่า SuPHP ของ Kloxo มันยังไม่สเถียรนั้นเองครับ วิธีแก้ไขเบื้องต้นตอนนี้ก็ทำได้โดย Downgrade version ของ PHP ลงมา
ขั้นตอน
1. ssh ไปยัง server ของคุณ
2. ใช้คำสั่ง

yum list php
ถ้ามันบอกมาว่าเป็นเวอร์ชัน php.i386(x86_64) 5.2.17-13 แสดงว่าคุณติดตั้ง patch ล่าสุด(แต่ไม่ work)แล้ว และนี่ก็เป็นสาเหตุทำให้เกิด error ดังกล่าวต้อง Downgrade มันลงมาซะ
3. ใช้คำสั่งนี้เพื่อ Downgrade ได้เลยครับ
yum downgrade php* --disablerepo=* --enablerepo=lxcenter-updates
4. ทีนี้ก็ลองกลับไปเลือก mode php ให้เป็น suphp ดูครับ แล้วก็อย่าเผลอสั่ง yum update อีกละ
ถ้าจะ update ระบบให้สั่ง yum upgrade เป็นราย package ไปแทนครับ
จบ


How to get SuPHP working on Kloxo 6.1.12



We all know that SuPHP is almost unusable in lastest version of Kloxo panel (6.1.12). You will always get an “Error 500″ after enabling “SuPHP” in you server. The cause for such error is the php-fpm patch in your latest php installation. Executing php-cgi calls directly will create problems for fastcgi for lighttpd & suphp for apache. The temporary solution for this problem is to get rid of the latest version and try downgrading your php.
Let’s Begin with Putty Commands:
01. First type “yum list php“, If you see “php.i386(x86_64) 5.2.17-13” then it means you have the latest version installed with the php-fpm patch. This is the one which is creating problem.
02. All you have to do is to downgrade your php installation. You can do that by typing “yum downgrade php*
What Will Happen Next?
It will downgrade your php installtion to “5.2.17-1″ and you can now use SuPHP with ease. Most of the people who were using WordPress platform for their content management (Like me) were having problems in installing plugins (Quick Cache etc) due to this new Kloxo update. I hope there will be a permanent solution in the near future.

Incoming search terms:

suphp kloxo error,kloxo 6 1 12 suphp,kloxo php type,kloxo suphp,kloxo suphp internal server error,kloxo suphp setup,kloxo wordpress 500,latest php version for kloxo 6 1 12,lxadmin 6 1 13 suphp,permalink suphp

One Response to “How to get SuPHP working on Kloxo 6.1.12”



แหล่งข้อมูล : http://www.dewesh.com/server-management/how-to-get-suphp-working-on-kloxo-6-1-12/

 

 
Design by Laikeng | Bloggerized by Storesu - sutoday | Court