Fixin’ issues one ticket at a time!
Posts tagged SSH
Server time keeps resetting
Oct 16th
Last night I came across a ticket where a customers time kept resetting on their dedicated server. Typically I would fix the time by using the date command because most of issues I came across the servers were only minutes off. After reading through the clients ticket history I realized that the timezone and minutes were correct, but the hour was still off. After a nice little google search I came across a post on a popular linux forum, where a member had the same issue the client was having. In the post a member suggested creating a symlink for /etc/localtime to point to the clients timezone in the /usr/share/zoneinfo folder. I figured it was worth a shot and tried this fix out, and it worked perfectly ![]()
Since the client was located in Pakistan, he needed the server to be set to the Asai/Karachi time zone.
root@server [/]# ln -sf /usr/share/zoneinfo/Asia/Karachi /etc/localtime
Before the symlink the time showed in EST but listed the timezone as GMT +5
root@server[/]# date
Mon Jan 26 02:46:24 GMT+5 2009
root@server[/]#
After the symlink the time showed in Asia/Karachi (or GMT +5)
root@server [/]# date
Mon Jan 26 12:48:14 PKT 2009
root@server[/]#
Your localtime file should look like this now:
lrwxrwxrwx 1 root root 32 Jan 26 12:47 localtime -> /usr/share/zoneinfo/Asia/Karachi
I’m not entirely sure why the date wasn’t correct to begin with as the timezone was correct (+5GMT) when checking with the date command. But, things are fixed now so I really can’t complain since the customer is happy ![]()
Hide your Shell commands
Oct 15th
Today I came across a neat, but pointless shell command. By running the following in shell, it will hide any commands you run.
root@server2 [/]# stty -echo
In order to disable this mode, simply remove the “-” before echo.
root@server2 [/]# stty echo
I guess there really is no point to the command, though you could always mess with your coworkers if they leave their shell prompt open ![]()
Enable PHP5 when PHP4 is default
Oct 14th
The following tutorial will show how to enable PHP5 on your site, when Apache has PHP4 as default. I normally do everything through SSH, so here are the steps.
root@thelinuxnoob.com [/]# cd home/thelinux/public_html/
root@thelinuxnoob.com [~/public_html]# nano .htaccess
Add the following line to the .htaccess: AddType application/x-httpd-php5 .php
ctrl + x
ctrl + y
enter
root@thelinuxnoob.com [~/public_html]# cat .htaccess | grep php5
AddType application/x-httpd-php5 .php
root@thelinuxnoob.com [~/public_html]# chmod 644 .htaccess
root@thelinuxnoob.com [~/public_html]# chown thelinux.thelinux .htaccess
root@thelinuxnoob.com [~/public_html]#
Via FTP
Open favorite text editor
AddType application/x-httpd-php5 .php
Save as “.htaccess”
Upload through FTP client
That’s my quick tutorial of the day, tune in next time for more tutorials ![]()