Doing a search with those keywords reveals a number of guides but most are now either old, incomplete or refer to the Ubuntu Server Build which has most of it pre-installed. My requirement was to put Linux (Ubuntu), Apache (web server), MySQL (database) and PHP (programming language) onto an existing desktop build (under VMware Fusion on a Mac) to serve as a WordPress development test-bed to save me having to keep uploading to a sandpit region on my web host.
The references used to achieve (and write) this were LAMP Installation On Ubuntu, Installing LAMP on Ubuntu 7.10 and Installing and configuring LAMP on Ubuntu.
The process will will mostly be done in a terminal (shell) window and a browser. The latter can be on a separate system on your network, in which case subtitute the Ubuntu IP address for “localhost” in the instructions below.
sudo apt-get install apache2
Change the ownership of the web area using
sudo chown -R [your Ubuntu account] /var/www
and test it by pointing a browser at http://localhost/
sudo apt-get install php5 libapache2-mod-php5
Restart Apache (sudo /etc/init.d/apache2 restart
), create a file /var/www/phpinfo.php
containing the line <?php phpinfo(); ?>
and test from the browser (http://localhost/phpinfo.php
).
sudo apt-get install mysql-server mysql-client
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
During this process you should be asked to set the MySQL root password. It is very important.
Edit /etc/php5/apache2/php.ini
and insert the line extension=mysql.so
(watch the spelling, the comment in the file is wrong) so that PHP can see MySQL. Also Apache needs to be told where myphpadmin is so edit /etc/apache2/apache2.conf
and add the line
Include /etc/phpmyadmin/apache.conf
Restart apache again and test by going to phpmyadmin (http://localhost/phpmyadmin/
). The login is root
and the MySQL root password (I think).
My immediate requirement was to use it for WordPress. Although you can download a WordPress package using apt-get, I found that this was rather out of date so I did it manually. You will need a database so login to phpmyadmin, create a database by entering the name (e.g. WordPressDB) in the box and click the create button. Now click the SQL button and execute the following command where WordPressDB, WPDBaccount and WPDBaccountPW are your choices.
GRANT ALL ON WordPressDB.* to WPDBaccount@localhost IDENTIFIED BY ‘WPDBaccountPW’;
Now in the WordPress directory (say /var/www/wordpress) copy the wp-config-sample.php file to wp-config.php and edit it thus
// ** MySQL settings ** //
define('DB_NAME', 'WordPressDB');
define('DB_USER', 'WPDBaccount');
define('DB_PASSWORD', 'WPDBaccountPW');
Now finish the install by surfing to http://localhost/wordpress/wp-admin/install.php
It will give you a WordPress admin password on the way.
That is it—the only problems I found were keeping track of which password was which and went where.
By the way, it is only for use on your home network, there are other things you will need to do if you are planning to set it up as a real internet visible server.
Hi,
Where can I get Ubuntu from and how much?
Cheers
Dave
Don’t plumbers do Google? http://www.ubuntu.com/ and it’s free.