XAMPP: Apache, MySQL and PHP on linux

Tips N Tricks January 17th, 2010

For those who do not want to configure their own webserver, sql server and modules to quickly test a random PHP code, XAMPP provides an easy bundled package to get things up and running quickly.

Adding apache server in your linux installation is easy using XAMPP. It was earlier called LAMPP and is now being called the XAMPP. The understanding is that

it stands for X (linux), A (apache), M (mysql), Php (php).

This is a nice way to develop php websites locally on your computer before wanting to deploy it online. You can even make your server visible to the internet by putting XAMPP online and open to the Internet. Doing that will allow you to run your own server. Some help from DynDNS will help you map a domain name to the ip address of your XAMPP on your computer. These will not be discussed here but lets continue towards linux installation of XAMPP.

Steps :

1) Download the XAMPP package:

Download XAMPP.

2) (Important) Extract ONLY using the following command

sudo tar xvfz xampp-linux-1.7.3a.tar.gz -C /opt

Warning: Please use only this command to install XAMPP. DON’T use any Microsoft Windows tools to extract the archive, it won’t work.

Good News: XAMPP is now installed below the /opt/lampp directory.

3) Start the server using :

/opt/lampp/lampp start

Good News if you see :
Starting XAMPP x.x.x…
LAMPP: Starting Apache…
LAMPP: Starting MySQL…
LAMPP started.

4) Test the server by opening firefox and typing

http://localhost

The document root will be called “www” in the /opt/lampp folder.

Send exe files in gmail

Tips N Tricks January 9th, 2010

Trying to send an exe file in Gmail throws up an error saying that your email cannot be sent with the attachment as it is a security risk to Gmail. The easy way out is to hide the extension.

Solution : 1

Rename the ABC.exe to ABC.txt . Attach the ABC.txt file in your Gmail and do the reverse at the receiving end.

Solution : 2

Use Winrar/Winzip/etc and make ABC.exe to ABC.rar/ABC.zip/etc.zip before sending.

Once you receive the file from the mail just reverse the step. Either change the extension of unzip the file.

Brightness not working : X60 + Mandriva + Thinkpad

Tips N Tricks January 7th, 2010

The issue is to tacked the functioning of brightness control on a Lenovo thinkpad X60 tablet PC running mandriva 2007 spring edition. The feature of screen brightness control does not work out of the box and a small tweak must be done in order to get that working.

Issue:

Brightness control not working in X60 tablet on Linux (mandriva)

Solution:

1) Obtain root privileges using “su root” from your terminal. Provide the password when prompted.
2) cd /etc
3) vi modprobe.conf
4) Add the line “alias video off”
5) use “!wq” to save and exit.

Reboot the computer and your brightness control should start working. Also install the thinkpad button support package from your package manager on Linux to increase compatibility of Linux with thinkpad laptops.

Unmount External Hard Disk in Linux

Tips N Tricks January 7th, 2010

External hard disks must be unmounted properly before you disconnect it off your system. After you mount hard drive for normal usage, unmount must be performed to safely remove the device. In some cases the HDD would still be running even after you had unmounted the HDD.

The below solution worked on Mandriva Linux 2007, Linux 2.6.17-13mdv on Gnome on a Western Digital (WD) 350 GB HDD . To start with, Identify the mount name of your HDD (say sdb1) .

From the command line interface :

1. su
2. Type password
2. umount /dev/sdb1
3. sdparm –command=sync /dev/sdb1
4. sdparm –command=stop / dev/sdb1

You would then hear the HDD go down to a stop. Go ahead and disconnect your hard drive.