Thursday, September 03, 2009

Installing LAMP to CentOS 5.x

This is assuming CentOS was installed properly and connected to the internet.

Installing MySQL



yum install mysql mysql-server

Confirm the install and by answering yes, and yum will download all packages needed to install MySQL.

We need to make sure MySQL is started on boot

chkconfig --levels 235 mysqld on

You can now start the MySQL server by issuing the following command:

/etc/init.d/mysqld start

You can also start it using the command below:

service mysqld start

Once MySQL server is running it will display initial startup text and will instruct you to set "root" user password.

mysqladmin -u root password rootpassword
mysqladmin -h server1.example.com -u root password rootpassword


Make sure you change the highlighted items with the correct information.

Installing Apache (http server)


yum install httpd

Make it run on boot.

chkconfig --levels 235 httpd on

Start the service

service httpd start

Install PHP

yum install php


Tuesday, February 10, 2009

Removing the Firefox Scroll Bars

I was developing for a MID (Mobile Internet Device) and needed to remove the vertical scroll bar of Firefox, the default browser, because of the page shift that happens when viewing a long page. MID supports touch so scrolling doesn't require the vertical scroll bar.

The solution is a simple CSS rule:


<body style="overflow:hidden">

Friday, January 02, 2009

Watching Remote Logs

We sometimes need to monitor log files on remote servers.

A simple method, that doesn't require us to log in to the remote host, is to run GNU tail command over the network using ssh.

Example, if we want to monitor the file /var/log/sample.log on the remote host hostname.


$ ssh hostname tail -retry -follow=name /var/log/sample.log

Saturday, December 20, 2008

UNIX time to human readable

You can easily convert a UNIX time to human readable using the shell command date.



$ date -d @1212312323
Sun Jun 1 13:25:23 GST 2008