.htaccess “Down For Maintenance” Page Redirect

I recently needed to move one website from a shared web host to our internal server. After some discussion, we decided to simply add a “Site Down For Maintenance” page to the site to prevent users from submitting orders during the hosting change. Using the following .htaccess code snippet, we were able to send all users to a maintenance.html page no matter which page they requested:

copyRewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ http://domain.com/maintenance.html [R=307,L]

Once we posted the maintenance.html page and .htaccess code on both the old hosting environment AND new hosting environment, we switched the DNS settings. Before making the switch, we had ported the website’s code to a “utility” domain and made adjustments so that the website would function well in the new hosting environment. Now that the DNS had been changed, we wanted to make sure that the website would function well on the new domain within the new hosting environment. Unfortunately the code above blocks EVERYONE from accessing any file besides the maintenance.html file. Fortunately my gifted IT team had the answer:

copyRewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^11\.111\.111\.111
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ http://domain.com/maintenance.html [R=307,L]

The above code sends all users to maintenance.html EXCEPT those with the specified IP, which just so happened to be us. We got to test the website while others were locked out. When we were satisfied with the website, we removed the .htaccess code and the site was back up immediately!

Quoted from: davidwalsh.name

Advertisements

Bersihin virus windows dengan antivirus livecd

Dunia windows selalu saja di hantui (pocong, kultilanak, genderwo, jurig, dkk…) oleh virus (HIV, campak, influenza, flu-burung, flu-babi, dkk…). Semua keluarga DOS & windows gak lepas dari virus mulai dari DOS jadul, sampe win7 tetep aja virus bergentayangan, dari disket, flashdisk, cdrom, internet dll lah.

Di lain pihak Dunia UNIX (Solaris, FreeBSD, MacOSX, Linux, dkk…) menikmati nikmatnya dunia tanpa virus…  ya gak nyombong sih, emang kenyataan sih kayak begitu, virus windows vs unix itu 1jt:1…

Tapi orang orang di dunia unix khusus nya linux enggak diam aja, melihat kawan kawan nya di dunia windows di keroyok virus… maka di buat lah bermacam macam antivirus under linux for windows… so bagai mana cara nya ? gampang di server biasanya ada antivirus for server, yang ngeliat traffik dan capture virus di situ, di mail server, samba server.

Nah bagi yang pc nya udah parah banget kena penyakit, gak bisa di boot, gak bisa jalan, mau nya tiduran mulu, buru buru bawa kedokter, dan di rawat inap… masuk UGD/IGD… apalagi di pasang antivirus baru, idup aja gak mau…

Tapi entar dulu sebelum di bawa ada cara lagi nih cari antivirus livecd, nah ini lumayan ampuh, ini beberapa yang aku dapet
1. pake linux livecd apa aja deh, ubuntu, debian, knoppix, fedora, what ever linux… install clamav, clamTK, Klamav (gui frontend buat clamav, update database virus nya, trus buka hardisk localnya dan scan semua disk nya.
2. download windows livecd biasanya di bitorrent, atau bikin pake bartpe yang udah ada antivirus nya, boot pake windows livecd, update dan scan semua disk nya
3. download salah satu antivirus live cd berikut ini
bitdefender http://download.bitdefender.com/rescue_cd/
panda  http://safecd.pl.pandasecurity.com/
AVG http://www.avg.com/us-en/avg-rescue-cd-download
Kaspersky http://support.kaspersky.com/viruses/rescuedisk?level=2
DrWeb http://download.geo.drweb.com/pub/drweb/livecd/
Avira http://www.avira.com/en/support-download-avira-antivir-rescue-system

aturan nya sama aja, update dulu db nya ke internet… jadi harus punya koneksi internet ya… dan scan hardisk nya, yang lucu nya… hampir semua nya pake linux livecd buat base system. Tapi yang di rescue windows kan… kalo gitu kenapa enggak pake linux aja sekalian, supaya gak capek kena virus mulu… ya itu terserah pemakai kan, ada beberapa software yang emang gak bisa di gantikan di linux, ada pengganti nya sih tapi kurang hebat…
Kurniadi


FAQ milis di http://wiki.linux.or.id/FAQ_milis_tanya-jawab
Unsubscribe: kirim email ke tanya-jawab-unsubscribe@linux.or.id
Arsip dan info milis selengkapnya di http://linux.or.id/milis

MySQL Change User Password

How do I change user password under MySQL server? I’d like to change a password for user called tom using UNIX / Linux command line option.

First, login to MySQL server, type following command at shell prompt to login as root
$ mysql -u root -p

2) Use mysql database (type command at mysql> prompt, do not include string “mysql>”):
mysql> use mysql;

3) Change password for user tom:
mysql> update user set password=PASSWORD("NEW-PASSWORD-HERE") where User='tom';

quoted from: www.cyberciti.biz