The purpose of this little howto is to set up a LAMP box with (K,X)ubuntu desktop already installed focused on Joomla!
(Linux + Apache + MySQL + PHP/Perl together commonly known as LAMP Server)
This is wat
* Apache 2 - Linux Web server
* MySQL 5 - MySQL Database Server
* PHP5 - PHP Scripting Language
* phpMyAdmin - Web-based database admin software.
Please note, you need atleast 256 MB of RAM otherwise you will run into "cannot connect to mysql.sock" errors
First make sure you have a static ip address. Check your network settings of your desktop in Gnome/KDE/XFCE.
Before proceeding to install, update the necessary packages with this command.
sudo apt-get update
Let's start and copy the following text in your console:
sudo apt-get install apache2 php5 libapache2-mod-php5 php5-mcrypt
To avoid apache massages for having trouble to resolve your servername add or change this line in:
sudo nano /etc/apache2/apache2.conf
into (where "ip.address" is your static ip set above)
ServerName ip.address
Restart apache.
sudo /etc/init.d/apache2 restart
To check whether php is installed and running properly, just create a test.php in your /var/www folder with phpinfo() function exactly as shown below.
nano /var/www/test.php
<?php phpinfo(); ?>
Point your browser to
http://ip.address/test.php and this should show all your php configuration and default settings. If your browser wants to download the php file instead of showing it, just reboot.
It's recommended to create a separate home partion (It makes a clean upgrade sooo easy) Here is a nice tutorial how to do that:
http://www.psychocats.net/ubuntu/separatehomeIn /home I made a webserver directory with permissions.
sudo mkdir /home/www
sudo chmod 777 /home/www
Create the site in apache.
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mylittlewebserver
Open the new apache config file and change it into this.
sudo nano /etc/apache2/sites-available/mylittlewebserver
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
DocumentRoot /home/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /home/www/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /home/www/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Now disable the old and activate the new site.
sudo a2dissite default
sudo a2ensite mylittlewebserver
Restart apache.
sudo /etc/init.d/apache2 restart
Again point your browser to
http://ip.address/ you should see some files in your browser.
Installing mysql database server is always necessary if you are running a Joomla! site. Remember running mysql server to a fair extend requires atleast 256mb of RAM in your server.
sudo apt-get install mysql-server mysql-client php5-mysql
PhpMyAdmin is a nice web based database management and administration software and easy to install and configure under apache. Managing databases with tables couldnt be much simpler by using phpmyadmin.
sudo apt-get install phpmyadmin
Restart your server:
sudo /etc/init.d/apache2 restart
And at last install mod_rewrite for those nifty SEO URL's of Joomla 1.5.x
sudo a2enmod rewrite
Have fun!
Please note, it's not recommended to make your webserver worldwide visible. Don't forget configuring a safe webserver is a profession on it's own.