Showing posts with label Internet. Show all posts
Showing posts with label Internet. Show all posts

Saturday, December 26, 2009

Verifying your wordpress.com blog on google webmaster central

Google webmaster is one of google's great application for every webmaster's to dig more on their on websites. Especially if the webmaster wanted to know how google bot sees their website. There we can see what does most people on our websites query for. Also, we can see which other websites that provide links to our website. Want to see it more clearly ? just open webmaster.google.com and type in your gmail's account to log in.

In google webmaster, first you need to register your own site, and then verifies that the site belongs to you. Google provides 2 mechanism for verifying your site. The first method asked the webmaster to add a new html page with some random name provided by google. We must upload it into our site directory and then ask google to verify it. The second method is to add meta tag in your website. If you're using free blog from wordpress, using wordpress.com domain, you will not be able to do the first verification method. Your best bet is to use the second one, which will be explained below.




After you add new site to google webmaster, it then brings you to a verification screen. Here, you choose Meta-tag for verification method.
Copy paste the meta-tag provided by google, and then go to your admin page of your wordpress.com blog.

In your admin dashboard for wordpress.com, go to menu Tools located on left bottom of your page. There should be a page written Webmaster tools Verification on center pane. Paste your Meta-tag there, and dont forget to Save changes.




Back to your google webmaster page, click Verify. After 10-15 minutes, check back to see if it's already verified.

Simple isn't ? First time I try this tools, I spent several hour to find the best verification methods in my wordpress.com, and suddenly when I click the Tools link in my admin dashboard, I found the one I looking for, google webmaster verification, and there it is :)

My other blog is at http://theprasojos.wordpress.com , how about you ?

Monday, December 22, 2008

Bye bye apache, welcome Nginx

Bagi saya, php tetap memiliki kenangan yang indah dalam mengisi hari-hari pemrograman saya terdahulu. Programming language yang fleksibel, dan nggak pake ribet. Justru kesulitan ditemui ketika deploy di server. Kebanyakan server yang tersedia sudah diinstall default dengan bundle apache, beserta modul-modul yang sudah di tentukan sebelumnya. Kalau pake keluarga Redhat, iya kalau kebetulan dapet rpm yang pas versinya, kalo nggak ? Cara paling enak memang tetap dengan compile dari source, karena kita bisa bongkar pasang modul yang kita inginkan, tambahkan semaunya, kurangi sesukanya. Jaman dulu(nggak dulu banget sih, 2004), saya hanya kenal Apache dan IIS buat jadi webserver untuk skrip php saya. Belakangan ini, muncul sebuah webserver yang tidak terlalu terkenal, tapi sepertinya ampuh. Kenapa ampuh ? Coba anda pergi ke netcraft.com, dan coba anda scan situs wordpress.com dan detik.com, apa webserver mereka ? Mereka pakai Nginx (baca:engine X). Ini dua situs besar loh, dan saya sangat yakin, tiap hari banyak diantara kita yang berinteraksi dengan kedua situs ini, ya tho ? Nggak mungkin dong mereka pake webserver yang kurang 'terkenal' kalo nggak karena mereka merasakan keampuhan dibaliknya, tul ndak ? Coba buka aja deh langsung di situsnya.


Ok, karena saya bukan pembuat Nginx, sejarahnya tidak akan saya beberkan disini. Berikut sebagai pengingat saja buat saya (syukur kalau berguna buat anda juga) untuk ngebangun server PHP siap pakai dengan Nginx dan lighttpd.
Berikut Linux saya, ubuntu 7.10 :
lintang@cygnus:~$ uname -a
Linux cygnus 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux
Disini kebetulan waktu nginstall, saya pake apt-get saja untuk nginx nya, baru php dan lighttpdnya yang compile dari source. Selain nginx, kita juga harus install dependenciesnya, terutama pcre dan zlib, serta openssl kalau anda ingin.
root@cygnus:~# apt-get install libpcre3 libpcre3-dev zlib1g zlib1g-dev nginx
Tunggu sejenak, bikin kopi dulu juga boleh. Atau kalau anda ingin waktu anda efisien, mari kita donlot dulu PHP dan Lighttpd nya :D
Saya ambil PHP versi 5.2.6, dan Lighttpd versi 1.4.19. Dari mana ? please deh, silakan googling, mudah didapat kok kedua-duanya.
Ok, kita mulai dengan PHP dulu, silakan ekstrak, compile, dan install. Berikut opsi yang saya gunakan untuk PHP saya.
lintang@cygnus:~$ ./configure --prefix=/usr/local/php-5.2.6 --with-mysql --enable-fastcgi --with-sockets --with-zlib
Ini berarti, kita akan instal PHP kita nanti di direktori /usr/local/php-5.2.6, mengikut-sertakan library koneksi php untuk mysql, membuat PHP yang berfungsi sebagai interpreter CGI ( nantinya skrip PHP bisa dijalankan dari shell, mirip /bin/bash atau /usr/bin/perl), lalu PHP tersebut dapat memiliki/membuka socket tersendiri (nantinya PHP akan berjalan sebagai process yang terpisah dari webserver, tidak seperti model Apache dimana PHP berjalan sebagai modul di dalamnya), lalu yang terakhir, mengikut sertakan library php untuk support kompresi dengan tipe Gzip.
Tunggu sejenak, setelah sukses, silakan lakukan langkah dibawah seperti biasa :
lintang@cygnus:~$ make
lintang@cygnus:~$ sudo make install
Nah, coba cek di direktori /usr/local/php-5.2.6/bin, seharusnya ada file executable bernama php-cgi. File inilah yang akan berjalan sebagai interpreter PHP anda dari shell.
Menurut beberapa sumber dari internet, sebenarnya php-cgi ini saja cukup untuk dipanggil dari Nginx nantinya untuk menjalankan PHP, namun akan lebih baik apabila kita mengambil spawner dari project Lighttpd. Spawner ini akan mengeksekusi php-cgi kita. Berikut langkah-langkahnya, seperti biasa, silakan ekstrak Lig
lintang@cygnus:~$ ./configure --prefix=/opt/lighttpd-1.4.19 --enable-static --disable-shared
Kira-kira maksudnya, kita akan menconfigure Lighttpd sebagai library static yang dependenciesnya mutlak terhadap file-file .so tertentu. Opsi static ini membuat program yang kita compile akan jauh lebih cepat, karena versi dependencies di dalamnya seperti di hardcode. Berkebalikan dengan ketika kita compile dengan modus dinamis, hasilnya program akan lebih lambat, namun dependencies terhadap versi library tertentu bisa dihindari. Kalau kita ingin membuat server yang cepat, siapa peduli dengan dinamisasi, bukan begitu ? :p
Lalu seperti biasa, kita jalankan make, tapi kali ini tanpa make install.
lintang@cygnus:~$ make
Seharusnya nanti, di direktori src/ akan ada file bernama spawn-fcgi. Kopikan file tersebut ke directory /usr/bin sebagai berikut :
lintang@cygnus:~$ sudo cp spawn-fcgi /usr/bin/
Lalu anda buat skrip .sh sederhana sebagai berikut :
lintang@cygnus:/usr/local/php-5.2.6$ cat > /usr/bin/php-fastcgi << EOF
#!/bin/sh

/usr/bin/spawn-fcgi -a 127.0.0.1 -p 8999 -f /usr/local/php-5.2.6/bin/php-cgi

EOF

Ini adalah skrip untuk menjalankan PHP sebagai proses CGI yang terpisah dari webserver anda nantinya. PHP akan membuka socket di port 8999, dan akan binding di interface lo(127.0.0.1) anda, sehingga hanya bisa diakses dari mesin anda sendiri.
Ok, langkah terakhir tinggal setup nginx.conf anda, punya saya ada di sini /etc/nginx/nginx.conf.
Berikut isi file konfigurasi Nginx saya :
user www-data;
worker_processes 4;

error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

access_log /var/log/nginx/access.log;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;

include /etc/nginx/sites-enabled/*;

}
Perhatikan baris yang di bold, bahwa Nginx saya berjalan atas nama user www-data, sehingga user ini mutlak harus ada sebelumnya, sepertinya kalau di Ubuntu, user ini dibuatkan otomatis ketika kita install Nginx yah, saya lupa sih :D.
Baris selanjutnya, worker_processes, saya isi 4. User yang mengakses webserver saya disini kurang dari 100 orang, dan selama ini, 4 worker sudah cukup sih.
Lalu selanjutnya, gzip on, ini modul gzip compress yang kita aktifkan setelah sebelumnya kita install zlib. Dan yang terakhir, kita akan meng-include kan semua file konfigurasi di direktori /etc/nginx/sites-enabled. Berikut contoh file konfigurasi saya di direktori tersebut :
Filename : atutor.conf
server {
listen 80;
server_name atutor;

access_log /var/log/nginx/atutor.access.log;

location / {
root /var/www/nginx-default;
index index.html index.htm index.php;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default/ATutor;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:8999;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}

Konfigurasi ini mengatakan bahwa, saya memiliki sebuah aplikasi (kebetulan aTutor), yang saya letakkan di /var/www/nginx-default, dan untuk semua URL yang berakhiran .php, maka saya akan lemparkan requestnya ke CGI interpreter PHP yang berjalan di port 8999 seperti konfigurasi PHP diatas.

And that's it, kita bisa mengetes konfigurasi nginx kita dengan perintah :
lintang@cygnus:~$ sudo nginx -t
Lalu untuk menjalankan nginx bisa dengan perintah sbb :
lintang@cygnus:~$ sudo nginx
Kalau kita ada perubahan konfigurasi nginx, setelah selesai mengedit file konfigurasi, untuk merestart nginx bisa dengan perintah sbb :
lintang@cygnus:~$ sudo killall -HUP nginx

Udah deh, silakan arahkan browser anda di port 80, aplikasi anda siap melayani user :)

Thursday, December 18, 2008

Speedy Vs Matrix Broadband 3.5G

Uhm, ok let's get this straight, here's my opinion for those written titles above. We will compare only the 'unlimited' versions of them. I'm currently using the Speedy personal with 1Gb quota, and 1024 Kbps bandwidth (but it's free from 8pm to 8am - next morning, so I consider this unlimited too). And for the backup, I'm using Matrix Broadband 3.5G with Isat Eco package.It's unlimited quota, the bandwidht was around 256 Kbps, but if your usage reaches 2Gb, they will limit your bandwidth until up to 64 Kbps. Both costs me around Rp 100rb per month.
Speedy
After upgrading their speed to 1024 Kbps (well yes, actually the speed was never reach 1024Kbps~128KBps), but still - in terms of 'unlimited', speedy still the best. Imagine after a day full of hardwork, you're going home, arrived at home on 6.30pm, playing with your son/daughter, and finally after they sleep, you open up your laptop and start browsing without having any worries that your quota this month will reached. Speedy gave me 1Gb quota every month, and yet no matter how crazy I download something from the internet, as long as I do that from 8pm to 8am, it's free.
But still, speedy has some flaws. Usually during 8pm to 10pm, the connection can not be stable enough. Sometime I have to reconnect-force my DSL connection. Well, it's annoying if you're in the middle of downloading something or connecting to your office via VPN. For now, my Free Download Manager can handle this, but sure this is something to be fixed by the Speedy team. Can't wait until they launch the IPTV services, wonder what would it be.

Matrix Broadband 3.5G
I got this package for free, those Customer Service offered it to me via phone, and I took it. It's stable enough ( if you're not that mobile ), my VPN connection hold very stable on this. But the limited bandwidth speed is also annoying. Being used to with 1024 Kbps with speedy and then switch to Isat Eco with only 256Kbps sometimes make me sick. nd the worst thing is that if you fall into GPRS mode, you'll better choose TelkomNet instan for this. It's back to where your position is, and how strong the signal from your place. In my place here, I have 2-3 bars of signal, and yet the bandwidth speed I considered to be 'slow', not fast enough, although your modem shows that it supports until 7.2 Mbps...well, it's only on your dream :)

Having both of this services in parallel, I decided that both must be used optimally, and if I can, I have to earn something back from it. Still trying to look at how internet marketing works, combined with how to use google adSense in our websites.

Any clue/wisdom words for me ? Please fill in your comment.