Sidebar

Chapter 1: Internet, Networks and TCP/IP

Chapter 2: The LINUX operating system - Setting up a Linux Web Server

Chapter 3: Your first webpage, Learning HTML and CSS

Chapter 4: Building Dynamic Websites with PHP in progress

Chapter 5: Web forms under construction

Chapter 6: Developing your first Bioinformatics web application under construction

Chapter 7: The PHP programming language: strings, arrays, functions, cycles, conditional statements, regular expressions under construction

Chapter 8: Sample Bioinformatics Web Applications under construction

chapter_2_-_the_linux_operating_system:installing_linux_apache_php_mysql_lamp_server

This is an old revision of the document!


Installing a LAMP (Linux, Apache PHP, MySQL) Server

Open a web browser on your linux machine, for example Firefox, and type:

localhost

in the address bar. You should get a connection failed message. If you try to visit the machine IP address from a remote computer, you will get the same. Our linux machine is still not a web server, as it misses any web server software.

We will now install the apache2 web server software. We will also install support for the PHP programming language and for MySQL databases. The full bundle is known as LAMP (Linux-Apache-PHP-MySQL) server.

There is a longer way, and a very short and easy way to install LAMP. We will take the latter. For information, thought, these are the commands for the long way:

andrea@ubuntu:~$ sudo apt-get install apache2

andrea@ubuntu:~$ sudo apt-get install php5-mysql

andrea@ubuntu:~$ sudo apt-get install libapache2-mod-php5

andrea@ubuntu:~$ sudo apt-get install mysql-server

Let's instead take advantage of the “tasksel” shell command. Tasksel allows to install bundles of different programs grouped together to achieve a certain functionality such as for example a full desktop environment, a full mail server, a full web server etc.., without having to install individual software packets.

Here's the short procedure required to install LAMP:

Let's update the repositories:

andrea@ubuntu:~$ sudo apt-get update

Installing tasksel:

andrea@ubuntu:~$ sudo apt-get install tasksel

Installing LAMP:

andrea@ubuntu:~$ sudo tasksel install lamp-server

While MySQL is installed you will be required to input a password for the root user. It is important that you enter a good password and then remember it or securely store it for eventual later usage.

You can use a tool such as this one to generate a secure password. 8 characters passwords are fine, however you might want to generate a 12 characters password for added security.

Once the installation is over, open again firefox and visit

localhost

and/or visit your Linux machine IP address from a remote computer.

If everything went fine during installation you will now see the default apache web page:

Figure 2-5-1: The default apache web page at localhost

Congratulations, you were able to successfully set up a Linux web server!

In order to use it, we need to understand a few things about how the web server is configured by default. In the next section we will look at a few important configuration details, that will allow us to use the server at best for this course and to use it as the course server, that will host a web development account for each student. To achieve this a few tweaks will be required to modify the behavior of the default apache installation. Keep reading here.

Chapter Sections

Discussion

Enter your comment. Wiki syntax is allowed:
ILEIN
 
chapter_2_-_the_linux_operating_system/installing_linux_apache_php_mysql_lamp_server.1359156042.txt.gz · Last modified: 2013/01/25 18:20 by cellbiol