Tuesday, May 31, 2011

remove  character on centos

https://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&order=DESC&topic_id=1761&forum=27

1. verify: echo $LANG

2. export LANG="en_US"

done!

UPDATE: to permanently set language each time for each time logi you can edit profile and add new line


 vi .bash_profile  

 press i  
 go to last line and create new line  
 paste this code  
 export LANG="en_US"  

 press escape, enter :wq  

Wednesday, May 25, 2011

Monday, May 23, 2011

Wednesday, May 18, 2011

Sunday, May 15, 2011

faster than original cpanel

i use nginx as cpanel wrapper.

server {
error_log /var/log/nginx/vhost-error_log warn;
# Use alternative port eg: port 2073
listen _PUBLIC_IP_:2073;

ssl on;


# redirect error page ssl
# this prevent nginx error 400 http://nginx.org/pipermail/nginx/2009-August/014521.html

error_page 497 https://$host$request_uri;

#ssl on; this can be turned off since the above will automatically enable it
ssl_certificate /etc/ssl/certs/domain.pem;
ssl_certificate_key /etc/ssl/private/domain.key;

server_name domain.com www.domain.com;
access_log /usr/local/apache/domlogs/domain.com-bytes_log bytes_log;
access_log /usr/local/apache/domlogs/domain.com combined;
root /home/smartcha/public_html;
location / {
location ~.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ {
expires 7d;
try_files $uri @backend;
#try_files $uri @redirSSL;
}
error_page 405 = @backend;

add_header X-Cache "HIT from Backend";
proxy_pass https://_PUBLIC_IP_:2083;
include proxy.inc;
}
#try n error by apis
#location @redirSSL {
#proxy_connect_timeout 15;
#proxy_redirect off;
#proxy_set_header Host $host;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-Proto https;
#}
location @backend {
internal;
proxy_pass https://_PUBLIC_IP_:2083;
include proxy.inc;
proxy_set_header X-Forwarded-Proto https;
}
location ~ .*\.(php|jsp|cgi|pl|py)?$ {
proxy_pass https://_PUBLIC_IP_:2083;
include proxy.inc;
}
location ~ /\.ht {
deny all;
}
}

now you can access http://domain.com:2073

3 days no blogspot

http://news.netcraft.com/archives/2011/05/13/blogger-maintenance-causes-extended-outage.html

i use gmail to store url for reference.
now back to blogspot. here:

1. i'm not able to start my dedicated server. it is scandisk (e2fck) scanning your disk.

after waiting about 15minutes server back online


another reference.

glad blogspot come back online. :)

Tuesday, May 10, 2011

how to monitor temperature every hour (CentOS)

today, i will guide how to monitor your server temparature

1. intall mutt

# yum install mutt
2. create monitor_temp.sh

# vi monitor_temp.sh

type i for insert
sensors | grep Core
hddtemp /dev/sda

type esc and :wq

to quit and save the file

type

3. Create report script
# vi report.sh

sh monitor_temp.sh > data.txt
mutt -s "Report: Temperature report" your@email-server.com < ~/data.txt
again, save the file

test the script by typing

# sh report.sh
if this success, check your email.

make this file executables:
#chmod 755 report.sh

4. create cron job to run every 1 hour

#vi /etc/crontab
* 1 * * * /root/scripts/report.sh

Reference:


monitor cpu temparature


and if you do not have any problem (like me!):
refer this guide how to install coretemp module.

http://www.question-defense.com/2010/03/24/lm_sensors-on-cent-os-5-4-how-to-get-and-install-the-coretemp-module

finally:

coretemp-isa-0000
Adapter: ISA adapter
Core 0: +54°C (high = +100°C)

coretemp-isa-0001
Adapter: ISA adapter
Core 1: +49°C (high = +100°C)

In nicer look:
[root@linux lm_sensors-3.3.0]# sensors |grep "Core"
Core 0: +39°C (high = +100°C)
Core 1: +36°C (high = +100°C)


getting ipv6 with APNIC.

i'm sending email to helpdesk@apnic.net requesting ipv6 address.

the reply so far positive. i hope my website have ipv6 without tunnel soon. tunguu... :)

person in charge: Wita Laksono via RT

Sunday, May 08, 2011

Good online marketing

Another good example for online marketing is always let user's know your website is always active.

For example.

once every 2 weeks or a month, we just can say hi or greeting to all user registered on your shopping cart system telling that you're happy they register on your website.

you can use,

Subject:

Greetings from Yourwebsite.com


Dear Apis,

We hope you enjoy your stay with us at yourwebsite.com

Thank you.

This is some good example. maybe giving you idea in another creative way. :)

Thursday, May 05, 2011

nginx pid error (using nginxcp)

pid      /var/run/nginx.pid;

error:
fopen `/var/run/nginx.pid': No such file or directory [ ok ]

reference: http://bugs.alpinelinux.org/issues/559

vi /etc/nginx/nginx.conf

add

pid /var/run/nginx.pid;

between worker process and error log line.

kill previous nginx process

now you can use:

service nginx restart
success!!

alternative ./configure --pid-path=/var/run/nginx.pid

tunnel route problem

http://www.tunnelbroker.net/forums/index.php?topic=1486.0

storing this for future reference.

update: install radvd

yum install radvd -y


sysctl -w net.ipv6.conf.all.forwarding=1

vi /etc/radvd.conf

enable for interface eth0

service radvd start

Starting radvd: [ OK ]

check connection later.

disk cleanup on centos

today i've learn new command

du (disk usage)

use disk usage with -s (summary) and -h (human readable)


du -sh /*

Good luck! :)

updating from 5.0 lenny to 6.0 squeeze

http://www.howtoforge.com/how-to-upgrade-debian-lenny-debian-5.0-to-squeeze-debian-6.0-on-xen-vps

posted for future reference.

apt-get failed (debian)

http://serverfault.com/questions/163891/apt-get-update-fails-on-debian-etch

updating debian source.list

add another entries:

deb http://archive.debian.org/debian/ etch main contrib

now updating & waiting to see update status. :)

Wednesday, May 04, 2011

Tuesday, May 03, 2011

i am now sage.

Sage: Wikipedia



Finally:

How to complete?
1. read my previous entries to get clues.

2. go to domain control panel, add new nameserver with ipv6 ip address

3. point your 3rd nameserver to the nameserver created.

done!

final level, sage

post this for future reference:

4gb seg fixup on debian

linux02:~# apt-get install libc6-xen

trying this on debian.

Updates:

after install libc6-xen successfully, you need to fire:
echo 'hwcap 0 nosegneg' > /etc/ld.so.conf.d/libc6-xen.conf && ldconfig

Then reboot.. message gone! :)
another debian problems solved.

iptables problem with debian on xen

module-init-tools

the error

stats:/etc/snmp# iptables -L -v
Note: /etc/modules.conf is more recent than /lib/modules/2.6.18-8.1.15.el5xen/modules.dep
modprobe: QM_MODULES: Function not implemented

modprobe: QM_MODULES: Function not implemented

modprobe: Can't locate module ip_tables
iptables v1.3.6: can't initialize iptables table `filter': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

sh-2.05b# depmod depmod: QM_MODULES: Function not implemented 

Solution
apt-get install module-init-tools
done!
ref: http://forum.lxcenter.org/index.php?t=msg&goto=56813&

install apache on debian

http://techpatterns.com/forums/about390.html

apt-get update
# install mysql first so it's running so apache sees it.
apt-get install mysql-server-5.0
# for basic installs, unless you know why you do otherwise, use this apache
apt-get install apache2-mpm-prefork
# add php5-pgsql if you're going to run postgre
apt-get install libapache2-mod-php5 php5-mysql

And that's it, it will be running.

You may need to issue this command as root to get it started:
:: Code ::
apache2 -k restart

then visit:
:: Code ::
http://localhost/

switched to debian

since centos not able to support ipv6 correctly with ip6tables now i'm using debian. :)

first error:
apt-get update

Failed to fetch blabla.. file not found
Search accross and found:

The file you are looking for is /etc/apt/sources.list.

Chances are your host is using one of the older XEN templates which had bad repo URLs.

Try my list: (Credits to John T)

deb http://security.debian.org/ lenny/updates main contrib non-free deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free  deb http://ftp.us.debian.org/debian/ lenny main deb-src http://ftp.us.debian.org/debian/ lenny main deb-src http://security.debian.org/ lenny/updates main deb-src http://volatile.debian.org/debian-volatile lenny/volatile main
Now updating my packages :)

submit ipv6 whois information

http://www.tunnelbroker.net/forums/index.php?topic=1241.0

command: whois -h whois.arin.net -i 2607:f128:42:c5::2

if you get invalid query, use -i before your ip address.

for asia, whois.apnic.net

........

Monday, May 02, 2011

guru level



now i'm guru level:

How to complete?

read presentation & there is answer there >:)

check dns server for ipv6

netstat -an | grep ':53'

uneble to query whois on centos

[root@local ~]# whois apis17.info
[Querying whois.afilias.info]
[Unable to connect to remote host]

it is firewall blocking your query.

open outgoing port 43 and all done.. :)

update: whois query for IPV6 failed . then you should use debian or disable firewall temporarily (for centos)

Configserver Firewall


Click to enlarge

So far so good.

Sunday, May 01, 2011

debug ipv6 connection

tcpdump -n -i eth0 proto 41

ipv6 day

http://www.webstershome.co.uk/content/world-ipv6-day

What is World IPv6 day? - It is a trial period where a number of major web sites will provide their content on both IPv4 and IPv6. This is being sponsored by the Internet Society (ISOC) more information is posted on their World IPv6 Day page
Related Posts Plugin for WordPress, Blogger...