Lamp Stack
Lamp Stack
2-4
Quick Start Guide
BitNami LAMPStack 1.2-4
Release 1.2-4 2010-12-15
This product and its documentation are protected by copyright. The information in this document is provided on an
"as is" basis, without warranty. Although every precaution has been taken in the preparation of this document, the
authors will not have any liability to any person or entity with respect to any loss or damage caused or alleged to be
caused directly or indirectly by the information contained in this work.
Trademark names may appear in this document. All registered and unregistered trademarks in this document are the
sole property of their respective owners.
Acknowledgements
You can find the individual licenses for the above projects as part of the installation.
BitNami LAMPStack Overview
BitNami LAMPStack is an easy to install and easy to use open source Web Platform. It combines leading open
source projects, such as Apache, MySQL and PHP with BitNami's extensive open source expertise to provide a
consistent, painless way to deploy LAMP in any Linux environment.
Components
BitNami LAMPStack includes Apache 2.2.17, MySQL 5.1.50, PHP 5.2.15 and phpMyAdmin 2.11.11.1.
Apache is the most popular HTTP server on the Internet. It provides a secure, efficient and extensible web platform.
It is maintained by the Apache Software Foundation. You can find more information about Apache at
http://www.apache.org.
MySQL is the world's most popular open source database. It is a relational database management system that
combines speed, reliability and ease of use. It is developed and maintained by MySQL AB. You can find more
information about MySQL at http://www.mysql.com.
PHP is a web development scripting language that can be embedded into HTML. Powerful and easy to use, it is the
most popular Apache module. It is maintained by the PHP Group. You can find more information about PHP at
http://www.php.net.
phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL through a web interface. It
allows you to manage anything from a single database to a complete MySQL server. You can find more information
about phpMyAdmin at http://www.phpmyadmin.net.
Requirements
This section describes where to download BitNami LAMPStack and the different installation modes that are available.
You can download the BitNami LAMPStack binary file from http://bitnami.org. It will be named bitnami-lampstack-
1.2-4-linux-installer.bin. The same binary file will work on any Linux distribution.
Once you have downloaded the file, make sure it has read and executable permissions: From your Desktop
environment, right-click on the file, select "Properties" and then set the appropriate permissions. Alternatively, you
can issue the following shell command:
$ chmod 755 bitnami-lampstack-1.2-4-linux-installer.bin
You can install BitNami LAMPStack in graphical, text and unattended modes. By default the graphical mode will be
used.
Graphical Mode
To begin the installation process, double-click on the file from your Desktop environment or invoke it directly from the
command line with:
$ ./bitnami-lampstack-1.2-4-linux-installer.bin
You will be greeted by the 'Welcome' screen. The next step is to select the installation directory. The default
installation path will be a folder on your home directory if you are running the installer as a regular user, or
/opt/lampstack-1.2-4, if you are running the installation as root. If the destination directory does not exist, it will be
created as part of the installation.
After selecting the installation directory you will be asked for the password to the initial MySQL root and anonymous
accounts. This password cannot be empty.
The default listening port for Apache is 8080 and for MySQL is 3006. If those ports are already in use by other
applications, you will be prompted for alternate ports to use. Remember that if you plan to run both applications as a
regular user you should select port numbers above 1024.
Finally, the installer will ask you for the initial password to access the your phpMyAdmin installation through the web.
This password cannot be empty.
You are now ready to begin the installation, which will start when you press 'Next'. Once the installation process has
been completed, you will see the 'Installation Finished' page. You can launch the browser at this point.
If you receive an error message during installation, please refer to the Troubleshooting section.
The rest of this guide assumes that you installed BitNami LAMPStack in /home/user/lampstack-1.2-4 and that you
use port 8080 for Apache and 3306 for MySQL.
Text Mode
This installation mode is designed for remote installation or installation on servers without X-Window support. It is
started by default when a graphical environment is not available or by issuing the following command:
$ ./bitnami-lampstack-1.2-4-linux-installer.bin --mode text
You will be greeted by the 'Welcome' message. The next step is to select the installation directory. The default
installation path will be a folder on your home directory if you are running the installer as a regular user, or
/opt/lampstack-1.2-4, if you are running the installation as root. If the destination directory does not exist, it will be
created.
After selecting the installation directory you will be asked for the password to the initial MySQL root and anonymous
accounts. This password cannot be empty.
The default listening port for Apache is 8080 and for MySQL is 3006. If those ports are already in use by other
applications, you will be prompted for alternate ports to use. Remember that if you plan to run both applications as a
regular user you should select port numbers above 1024.
Finally, the installer will ask you for the initial password to access the your phpMymyAdmin installation through the
web. This password cannot be empty.
You are now ready to begin the installation process, which will start when you press 'Enter'. Once the installation
process has been completed, you will see the 'Installation Finished' message.
Unattended Mode
It is possible to perform an unattended or silent installation using the --mode unattended command line option. This
is useful for automating installations or for inclusion in shell scripts, as part of larger installation processes. You will
not be asked for anything during the installation.
However you will need to pass to the installer the values of the password to the initial MySQL root and anonymous
accounts and the initial password to access phpMyAdmin. You can do that using the options --rootpasswd and --
phpmyadminpasswd. For example:
You can also modify the default installation directory by passing the --prefix /path/to/installdir command line
option to the installer.
Apache will use by default the port 8080 and MySQL the port 3306. You can change those values as well using the
command line options --dbport and --webport:
$ ./lampstack-1.2-4-linux-installer.bin --mode unattended --rootpasswd mysqlpasswd --
phpmyadminpasswd pmapasswd --dbport 3309 --webport 8085
Please make sure that the ports you specify are not already in use by other applications and remember that if you
plan to run both applications as a regular user, you should select port numbers above 1024.
If you receive an error message during installation, please refer to the Troubleshooting section.
The rest of this guide assumes that you installed BitNami LAMPStack in /home/user/lampstack-1.2-4 and that you
use port 8080 for Apache and 3306 for MySQL.
Directory Structure
The installation process will create several subfolders under the main installation directory:
As part of the installation, an uninstall program will be created at /home/user/lampstack-1.2-4/. The uninstallation
can also be performed in graphical, text and unattended modes. You can run the uninstaller by double-clicking on the
uninstall application or through the command line:
$ /home/user/lampstack-1.2-4/uninstall
Apache Web server
This section describes how to start Apache for the first time and gives a basic introduction to the Apache
configuration and log files.
Starting Apache
This indicates the server is up and running. You can test so by opening a browser and accessing the following URL
http://127.0.0.1:8080, which will take you to the test page.
If you receive an error message, the server cannot start or you cannot see the test page, please refer to the
Troubleshooting section.
Stopping Apache
The main Apache configuration file is called httpd.conf which you can find at /home/user/lampstack-1.2-
4/apache2/conf/httpd.conf.
Once Apache starts, it will create two log files, the access_log and the error_log. You can find both files at the
/home/user/lampstack-1.2-4/apache2/logs directory.
The access_log file is used to track client requests. When a client requests a document from the server, Apache
records several parameters associated with the request in this file, such as: the IP address of the client, the
document requested, the HTTP status code, and the current time.
The error_log file is used to record important events. This file includes error messages, startup messages, and any
other significant events in the life cycle of the server. This is the first place to look when you run into a problem when
using Apache.
If you already have a web page and you want to serve its content with Apache, you can do so simply by copying your
files to the default document root directory: /home/user/lampstack-1.2-4/apache2/htdocs/.
With the default configuration, Apache will wait for requests in the port 8080. You can change that by editing the
httpd.conf file and modifiying the value specified in the Port directive.
You can find more information about Apache in the technical documentation that is located in the
/home/user/lampstack-1.2-4/apache2/htdocs/manual directory.
MySQL Database
This section describes how to start the MySQL database and gives you a few basic security tips. You can find the
MySQL technical documentation at http://dev.mysql.com/doc/.
MySQL's grant tables are created during the BitNami LAMPStack installation process. The grant tables define the
initial MySQL user accounts and their access privileges. The default configuration consists of:
Two privileged accounts with a username of 'root'. The initial passwords for these two accounts
are the ones that you specified in the setup wizard.
Two anonymous-user accounts, both with an empty username. The initial passwords for these
two accounts are the ones that you specified in the setup wizard.
It is strongly recommended that you do not have empty passwords for any user accounts before using the server for
any production work.
Starting MySQL
After installing BitNami LAMPStack you can start the MySQL server issuing:
$ /home/user/lampstack-1.2-4/ctlscript.sh start mysql
You can verify that MySQL is up and running using mysqladmin, for example, issuing:
$ /home/user/lampstack-1.2-4/mysql/bin/mysqladmin -p version
You will then be asked for the anonymous user password you set during the installation process.
Once the MySQL server has been started, you can test that you can retrieve information from the server using the
following examples:
$ /home/user/lampstack-1.2-4/mysql/bin/mysqlshow -p
You will then be asked for the anonymous user password you set during the installation process.
$ /home/user/lampstack-1.2-4/mysql/bin/mysqlshow -u root -p mysql
You will then be asked for the root user password you set during the installation process.
Stopping MySQL
You will then be asked for the root user password you set during the installation process.
PHP
This section describes how to test your PHP installation. You can find the PHP technical documentation at
http://www.php.net/manual/en/index.php
The easiest way to test your PHP installation is to create a test script using the phpinfo() function. Open your favorite
text editor and type:
<?php phpinfo(); ?>
This sections describes how to access your phpMyAdmin installation. You can find more information about
phpMyAdmin in http://www.phpmyadmin.net/home_page/docs.php
phpMyAdmin is an easy to use management tool for MySQL that allows you to create and drop databases, create,
drop and modify tables, delete, edit and add fields, execute SQL statements, manage keys on fields, manage
privileges and export data in various formats through a web-based interface.
Access to phpMyAdmin
To test your phpMyAdmin installation first make sure that your Apache and MySQL servers are up and running. You
can access your phpMyAdmin installation by opening a browser and typing http://127.0.0.1:8080/phpmyadmin. You
will then asked for a username and password. As user name, use "administrator" and as password use the value
specified during installation.
Initially only requests from 127.0.0.1 will be allowed access to that section. You can change this behavior editing the
Apache main configuration file located at /home/user/lampstack-1.2-4/apache2/conf/httpd.conf.
Troubleshooting
This section describes some of the most common problems you may find when installing BitNami LAMPStack.
Installer
You may get the following error while trying to run the installer from the command line:
The installer binary is not complete, likely because the file was not downloaded correctly. You will need to download
the file and repeat the installation process.
You are probably overwriting a previous LAMPStack installation and therefore a previous MySQL with a different
MySQL root password. Remove or move your previous LAMPStack installation and try to install LAMPStack again.
Apache
If you find any problem starting Apache, the first place you should look at is the error log file that will be created at
/home/user/lampstack-1.2-4/apache2/logs/error_log. There you will likely find useful information to determine
what the problem may be. For issues not covered in this Quick Start guide, please refer to the Apache documentation
included as part of the installation, which is located at /home/user/lampstack-1.2-4/apache2/htdocs/manual.
If the server seems to start correctly (i.e. you can see the ./apachectl start: httpd started message) but you
cannot see the test page when you type http://127.0.0.1:8080/ in your browser, it may be that there is already a
server running in that port.
[Mon Oct 9 19:52:10 2007] [crit] (98)Address already in use: make_sock: could not bind to port
8080
This means that the port 8080 is already being used by another program. You can either stop the program that is
using that port or edit the httpd.conf configuration file and change the port Apache will listen for requests in.
If you change the default listening port for Apache and get the following error in error_log:
[Mon Oct 9 20:09:50 2007] [crit] (13)Permission denied: make_sock: could not bind to port 80
MySQL
If you encounter any problems starting MySQL, the first place to look in is the "Problems and Common Errors"
section of the MySQL manual, which you will find at http://dev.mysql.com/doc/
If you get an Access Denied message while trying to connect to MySQL, make sure you are using the correct
username and password.