Blog Archives

how does systemd load units?

I did not even notice the existence of systemd in the past. On CentOS 6, I used commands such as “service iptables restart/start/stop” to start/stop/restart a service. I used commands such as “chkconfig iptables on” to auto-start a service at

Posted in tips of hosting

service httpd restart failed

The problem of httpd is hard to debug because there are few ways to debug it. You can set LogLevel to debug in httpd.conf, but that does not help much in real situations. Today I encountered a weird problem that

Posted in tips of hosting

uid and euid

What uid/euid does a process get when it is started? I have misunderstood this issue for long time. In the past I thought a process gets its uid/euid from the owner of the program file. You can use “ls -l

Posted in tips of hosting

The least you need to memorize about sed and awk

If you search for the usage of the sed/awk command on the Internet, you will get tons of tutorials teaching you how to use them. I have learnt sed/awk for dozen of years but still cannot write a valid sed/awk

Posted in tips of hosting

How to prevent php from accessing files outside htdocs?

I’m investigating my hacked website under xampp environment. I put my website files in c:\xampp\htdocs\domainhostseotool\, and visit the site as localhost/domainhostseotool. I’m little worried about a possible security risk. Suppose the compromised website has an infected php file which contains

Posted in tips of hosting

yum repository

Yum repositories are like websites that you can download software from. Yum has default repositories to download packages so you do not need to configure repos to use yum to install/upgrade packages on your system. But that is not enough.

Posted in tips of hosting

domain ns server status

If you set name servers in your domain registrar but have not added the domain in your hosting company, what is the DNS status of your domain? nslookup xxx.com Server:  UnKnown Address:  yy.yy.yy.yy *** UnKnown can’t find xxx.com: Server failed

Posted in tips of hosting

lines in an email message

According to rfc2822, an email message is:    A message that is conformant with this standard is comprised of characters with values in the range 1 through 127 and interpreted as US-ASCII characters [ASCII].  For brevity, this document sometimes refers

Posted in tips of hosting

How to set up DMARC record?

Even after you set up a SPF record and a DKIM record, your email may also be rejected or delivered to junk box if you did not set up a DMARC DNS record. How to add a DMARC record in

Posted in tips of hosting

How to debug Cyrus-imap?

Cyrus-imap is an error-prone program. To debug it, you need to edit /etc/imap.conf to add “debug:1″ and create a user directory in /var/log/imap/log/admin to log the protocol messages. You need to know the log sequences for successful cases: Sep 14

Posted in tips of hosting