Jan 25
ใช้ทุกครั้งก็ต้องมาหาทุกครั้ง เลยมาจดไว้กันลืม
เป็นการสร้าง Database และ Grant ให้ User สามารถใช้งานร่วมกับ Database ได้
mysqladmin -u username -p create databasename
หลังจากนั้น login เข้าไปใน MySql
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON databasename.* TO 'username'@'localhost' IDENTIFIED BY 'password';
เท่านี้ก็จะได้ User ที่สามารถใช้ร่วมกับ Database ที่สร้างขึ้นอย่างง่ายดาย
อ้อ อย่าลืม
FLUSH PRIVILEGES
Tagged with: create • database • grant • mysql
Jun 28
วิธีการป้องกันไม่ให้ Users มีสิทธิ์ แก้ไข IP Address ได้เองบน Windows XP มีขั้นตอนดังนี้
Start -> Run -> gpedit.msc
แล้วจะได้หน้าตาดังรูปด้านล่าง
ทำการแก้ไข ตามข้อในรูป ให้เป็น Enable
แต่จะมีผลกับ Users และ Network Operation เท่านั้นครับ
อ้างอิงจาก
http://technet.microsoft.com/en-us/library/bb457072.aspx
May 17
วันนี้นั่งเล่น maildrop มา ก็เลยหยิบมาแบ่งปันกันให้คนอื่นได้ใช้นะครับ
อันนี้เป็นไฟล์ mailfilter ซึ่งอยู่ใน /var/vpopmail/domains/example.net/
[code lang='bash']
SHELL="/bin/sh"
import EXT
import HOST
VPOP="| /var/vpopmail/bin/vdelivermail '' bounce-no-mailbox"
VHOME=`/var/vpopmail/bin/vuserinfo -d $EXT@$HOST`
#logfile "/var/log/maildrop.log"
log "=== BEGIN maildrop processing for $EXT@$HOST ==="
if ( $VHOME eq "" )
{
#log " ERROR: VHOME isn't set, falling back to vdelivermail"
#log "=== EXIT === "
to "$VPOP"
}
# make special folder
`test -d $VHOME/Maildir/.Spam`
if( $RETURNCODE == 1 )
{
log " INFO: Make .Spam directory"
`/usr/local/bin/maildirmake -f Spam $VHOME/Maildir`
}
`test -d $VHOME/Maildir/.Drafts`
if( $RETURNCODE == 1 )
{
log " INFO: Make .Drafts directory"
`/usr/local/bin/maildirmake -f Drafts $VHOME/Maildir`
}
`test -d $VHOME/Maildir/.Sent`
if( $RETURNCODE == 1 )
{
log " INFO: Make .Sent directory"
`/usr/local/bin/maildirmake -f Sent $VHOME/Maildir`
}
`test -d $VHOME/Maildir/.Trash`
if( $RETURNCODE == 1 )
{
log " INFO: Make .Trash directory"
`/usr/local/bin/maildirmake -f Trash $VHOME/Maildir`
}
# try filtering it using user-defined rules
`test -r $VHOME/.mailfilter`
if( $RETURNCODE == 0 )
{
#log " INFO: including $VHOME/.mailfilter"
exception {
include $VHOME/.mailfilter
}
}
if (/^X-Spam-Status: *Yes/)
{
# then try delivering it to a Spam folder
exception {
# to "$VPOP"
to "$VHOME/Maildir/.Spam/"
}
# ah well, I guess they'll just have to live with disappointment
exception {
to "$VPOP"
}
}
else
{
exception {
#log " INFO: message is clean"
to "$VPOP"
}
}
[/code]
ต่อจากนั้นแก้ไข /var/vpopmail/domains/example.net/.qmail-default
[code lang='bash']#| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox
| /usr/local/bin/maildrop /home/vpopmail/domains/example.net/mailfilter[/code]
เป็นอันเสร็จพิธี ใครจะ debug ก็ uncomment logfile ด้วยนะ
อ้างอิง
Tagged with: maildrop • qmail
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
Tagged with: apache2 • php • php_source • ubuntu
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 »
Tagged with: dapper-drake • dell • ubuntu