Ubuntu Tutorials

Install LAMP on Ubuntu 12.04 (Linux, Apache, MySQL, PHP)

In this tutorial we will look at how to install Apache, MySQL, and PHP on an Ubuntu 12.04 system using the command line. This set of packages together is called a LAMP server or a LAMP stack. The LAMP stack is the most common form of software stack used on web servers today.

Apache is used to serve web pages, PHP works with Apache to enable you to create dynamic web pages, and MySQL works with PHP to enable it to communicate with a database backend. Note that any of these packages can be installed separately but for running a dynamic website, they are usually installed together.

Check the size of a directory in Linux

In this tutorial, we will look at how to check the size of a directory in Linux. This task is done using the du command which is a standard Unix/Linux program. The abbreviation du is short for disk usage.

Checking the size of a directory may be useful, for example, on something like a Linux web server where we may want to know what the size of our web root is for backup purposes. The simple fact is, being able to check the size of a directory in Linux is very useful in a number of ways.

Check Free Space on Linux

In this tutorial we will look at how to check free space on Linux or Unix from the command line. It is important to keep track of the amount of free disk space you have, especially on a server where it is of utmost importance that data loss or downtime be kept to a minimum.

Linux and Unix systems come with a handy utility called df (short for disk free) which is used to display the amount of free space on any filesystem that the user invoking the command has read access to.

Change MySQL Root Password in Ubuntu

In this tutorial we will look at how to change the MySQL root password in Ubuntu Linux if you have forgotten it or inherited a server and never knew it in the first place. To change the MySQL root password in Ubuntu you will need superuser privileges, i.e. root access, on the system. The following guide works on Ubuntu 10.04, 10.10, 11.04, 11.10, and possibly 12.04.

Enable mod_rewrite on Ubuntu

It is very easy to enable mod_rewrite in Ubuntu as you will see in the tutorial below. The rewrite module (mod_rewrite) is used by the Apache web server to rewrite requests on the fly. By rewriting requests, we mean that the URL that is sent by the user is changed to something different internally before it is passed to the script which is processing the request.

Newer servers which run Ubuntu 10, Ubuntu 11 or Ubuntu 12 with Apache2 installed, can have mod_rewrite installed with a single command.

Install GD on Ubuntu Linux

In this tutorial, we will look at how to install the GD image processing library for PHP5 on Ubuntu Linux. The GD library is a very popular module which allows dynamic image processing from within PHP.

The process for installing GD for use with PHP5 on Ubuntu outlined below works for Ubuntu 10.04, Ubuntu 10.10, Ubuntu 11.04, Ubuntu 11.10, Ubuntu 12.04, and on Debian as well.

To install the GD library, run the following command with superuser privileges:

apt-get install php5-gd

Linode Review 2012 (Xen VPS Hosting)

In this article, we will be doing a review of Linode, the Xen VPS hosting provider that Tutorial Arena has been using since December 2010. Here at Tutorial Arena, we are very satisfied with the level of service that we have gotten from Linode in the just over a year that we have been with them.

Check MySQL version

In this tutorial, we will look at how to check the version of the MySQL server that is running on a system. Different versions of MySQL behave differently and also have different features so it is important to know what version is running for compatibility reasons.

There are 3 basic ways of checking the MySQL version. We can do it from the command line without logging in to the server, or we can do it in 2 ways (using SQL queries) after logging in to the server.

After logging in to the MySQL server, execute:

Preserve permissions and ownership when copying files using cp

In this tutorial, we will look at copying files in Linux using the cp command and preserving the existing permissions and ownership on the files which are being copied. By default, the cp command will change the owner of the destination files to the person who did the copy. It will also change the permissions on these files to default permissions; usually 644.

How to run Python script in Ubuntu Linux

In this tutorial, you will learn how to run Python scripts in Ubuntu using the terminal. The process basically involves invoking the Python interpreter and passing the name of the Python script to be executed as an argument to it.

This tutorial also covers how to install Python if it is not currently installed on your system.

So if we wanted to use the terminal to invoke a Python script called helloworld.py which was in the current working directory we would do it like this:

python helloworld.py