Jan 11
On the old post with Vhcs2 and Ubuntu Dapper Drake, Now a day it’s necessary to up them again but http://wael.nasreddine.com website has down. Then I see the article that use with Ubuntu Edgy Eft, then need to upgrade Ubuntu, let’s upgrade with below instruction
คราวก่อนลง Vhcs2 บน Ubuntu Dapper Drake ไปแล้ว คราวนี้ จำเป็นต้องใช้มันก็เลยจะลงอีกรอบ แต่ website ที่ vhcs.sh เกิด down ซะก่อน เลยต้องมีการเปลี่ยนแผน หาไปหามา ก็เลยเห็นมีบทความ Vhcs2 บน Ubuntu Edgy Eft เลยทำการ Upgrade Ubuntu ซะเลย วิธีการก็ง่ายๆ
sed 's/\sdapper/ edgy/g/ -i /etc/apt/source.list
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get -f install
sudo dpkg --configure -a
How to check Ubuntu version?
วิธีการตรวจสอบ Ubuntu version
sudo lsb_release -a
Partition size (note for forgotten)
Partition ที่ควรต้องแบ่ง (จดไว้กันลืม)
/usr : 500M
/var : 500M
/boot : 150M
/tmp : 1G
and install instruction at
ส่วนขั้นตอนการทำก็ตามนี้เลย
http://vhcs.net/new/modules/newbb/viewtopic.php?topic_id=7116&forum=2&post_id=33421#forumpost33421
used with eaccelerator at
เพิ่มเติมอีกนิด อยากให้ php ใช้ eaccelerator ด้วย ก็ทำตามนี้เลย
http://www.debianadmin.com/php-cache-accelerators-with-installation-tutorials.html
, That’s done.
แค่นี้ก็น่าจะสมบูรณ์แล้ว เป็นอันจบพิธี
Tagged with: edgy-eft • ubuntu • vhcs2
Jan 05
Begin to use AJAX with signup form, I found that my function have some error with IE (innerHTML), cannot delete node or replace text in element id (but just work with Firefox). Then I use moo.ajax to replace that function and below code is work for IE (v.6 and later) and Firefox.
Include this javascript in header
Use this function to post and get reply from server
function ajax_req() {
new ajax('check.php', { postBody: pars, onComplete: chState });
}
function chState(request) {
var rs=request.responseText;
alert(rs);
}
Useful links
Tagged with: ajax • moofx
Nov 30
It’s not difficult but make sure about some config in your application before doing them. Because Ubuntu will not support Breezy-Badgers in 6 months, but Dapper Drake is LTS (Long Term Support) it suitable for server.
My step is
- backup old sources.list : cp /etc/apt/sources.list /etc/apt/sources.list.breezy
- change sourcelist to
deb http://th.archive.ubuntu.com/ubuntu/ dapper main restricted
deb-src http://th.archive.ubuntu.com/ubuntu/ dapper main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://th.archive.ubuntu.com/ubuntu/ dapper-updates main restricted
deb-src http://th.archive.ubuntu.com/ubuntu/ dapper-updates main restricted
## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://th.archive.ubuntu.com/ubuntu/ dapper universe multiverse
deb-src http://th.archive.ubuntu.com/ubuntu/ dapper universe multiverse
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://th.archive.ubuntu.com/ubuntu/ dapper-backports main restricted univer se multiverse
deb-src http://th.archive.ubuntu.com/ubuntu/ dapper-backports main restricted un iverse multiverse
deb http://security.ubuntu.com/ubuntu dapper-security main restricted
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted
deb http://security.ubuntu.com/ubuntu dapper-security universe multiverse
deb-src http://security.ubuntu.com/ubuntu dapper-security universe multiverse
- use apt-get update : to update list file
- use apt-get dist-upgrade : to upgrade your server to dapper (beware need dist-upgrade not upgrade)
- reboot your system
After this process may check your application, just run fine or not.
Tagged with: breezy-badger • dapper-drake • server • ubuntu
Nov 25
In some cases, your web server have attacked by someone how to resolve this problem?
Use mod_evasive to resolve this problem
When mod_evasive detects attack, it will create hash table and deny that ip following :
- Requesting the same page more than a few times per second
- Making more than 50 concurrent requests on the same child per second
- Making any requests while temporarily blacklisted (on a blocking list)
You can get this module via : http://www.zdziarski.com/projects/mod_evasive/mod_evasive_1.10.1.tar.gz
Continue reading »
Tagged with: apache • dos-attack • mod-evasive
Oct 18
สำหรับคนที่ใช้ iptables นะครับ กรณีที่ยังไม่ได้ใช้ความสามารถ ของ recent module ใน iptables การป้องกันในอีกวิธีหนึ่งคือ นับจำนวน connection ในช่วงเวลาหนึ่งและ block ซึ่งก็เป็นวิธีที่ใช้การได้ดีในระดับหนึ่ง
ลองเอาไปใช้ดูนะครับวิธีการมีมากมาย ขึ้นอยู่กับความเหมาะสม และ การนำไปใช้นะครับ แต่ไม่ได้หมายความว่าจะดีที่สุด เราก้ต้องศึกษาหาข้อมูลกันต่อไป
iptables -A INPUT -m tcp -p tcp --dport 22 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m tcp -p tcp -s My.local.Lan.0/24 --dport 22 -j ACCEPT
iptables -A INPUT -m tcp -p tcp -s Trusted.Internet.Machine --dport 22 -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 22 -m state --state NEW -m limit --limit 1/min --limit-burst 2 -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 22 -j LOG --log-prefix SSHBRUTE
iptables -A INPUT -m tcp -p tcp --dport 22 -j DROP
ความหมายคร่าวๆ
The effect is that the firewall will only admit two (for example) incoming new SSH connections per minute (it will reset the “burst” counter every minute).
อ้างอิงจาก http://lwn.net/Articles/192057/
Tagged with: firewall • iptables • linux