I want to create a page for setting up a LAMP server for hobbyists. The current LAMP server page is too confusing for this purpose.

Purpose and scope

A lot of people are trying out the turn-key LAMP installer from the Dapper server cd. Most people who ask about this on the forums are surprised that there is no GUI. It is also very easy to break the working setup. This guide will help guide the user to install, configure, troubleshoot and use the LAMP stack installed on Ubuntu Dapper. It will also show the user how to install Wordpress for blogging, PhpBB2 forums and Drupal Content Management software on the server.

This guide is aimed at the absolute beginner.

Installation of LAMP

You can install LAMP on any computer running Ubuntu. You just have to install the packages. There is nothing preventing you from installing the Ubuntu Desktop on a machine and then adding on the Apache2, Mysql and Php packages.

You probably will not want to run any desktop applications or even a graphical system (Xorg) on a mission-critical server since this goes against best security practices. But you are not prohibited from doing this to experiment and learn about LAMP.

Installing from scratch

You may download the Server CD from http://www.ubuntu.com/download. Burn it to disk and boot from it. Pick "Install LAMP server" and continue the installation. When you reboot, you will now have a running ubuntu server setup with LAMP.

You can proceed with configuration either locally, using your keyboard and monitor, or remotely by installing SSH and accessing your ubuntu server from another computer on your LAN.

https://help.ubuntu.com/community/SSHHowto

For example, if you want to run a LAMP server seperate from your desktop, you can install ubuntu onto the seperate machine which does not have it's own monitor. You can borrow the monitor from your desktop to install and then use that server headless (without a screen).

Installing on an existing Ubuntu machine

To install the LAMP stack on an existing Ubuntu server or desktop, run

sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server

Accessing your machine - DynamicDNS

Test apache by obtaining a dynamic DNS address and accessing your box trhough it. Troubleshoot things like Router configuration, port forwarding and ISPs who block port 80.

Configuration

The Apache, Mysql and PhP configuration is mostly done via the command line. This is in general because they are not used in a GUI environment. It is actually fairly painless to use the command line to install and configure these applications to work together. That is probably a good reason why there is no GUI tool to configure them presently.

2. Configuration of database

3. Dynapmic DNS

sudo apt-get install apache2 php5 mysql-server ibapache2-mod-auth-mysql php5-mysql phpmyadmin


mysql_install_db --user=mysql

mysql -u root

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

mysql> GRANT ALL PRIVILEGES ON *.* TO 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION; 

mysql> \q

Wordpress

sudo apt-get install wordpress php5-gd

sudo ln -s /usr/share/wordpress /var/www/wordpress

sudo sh /usr/share/doc/wordpress/examples/setup-mysql -n (your mysql user) localhost

Browse localhost/wordpress

click on the install.php link

The configuration changes the password of the mysql user. You need to create a different mysql user if you want to set up other web applications.

phpbb2

sudo apt-get install phpbb2-conf-mysql

This will also install phpbb2. The configuration of the phpbb2-conf-mysql will prompt you for the mysql username and password.

read /usr/share/doc/phpbb2/README.Debian

sudo ln -s /usr/share/phpbb2/site /var/www/phpbb

Browse your webserver/phpbb

Moinmoin wiki

sudo apt-get install python-moinmoin libapache2-mod-python2.4 python2.4-twisted miscfiles

read /usr/share/doc/python2.4-moinmoin/README.Debian.gz

Drupal

http://drupal.org/node/260

wge http://ftp.osuosl.org/pub/drupal/files/projects/drupal-4.7.2.tar.gz tar xvzf drupal-4.7.2.tar.gz mv drupal-4.7.2/* drupal-4.7.2/.htaccess /var/www/drupal

mysql -u username -p databasename < /var/www/drupal/database/database.4.1.mysql

edit sites/default/settings.php $db_url = "mysql://joe:mypassword@localhost/mysql";

AndrewZajac/comments (last edited 2008-08-06 17:00:04 by localhost)