Build Ubuntu Server 9.10 64 bit All-in-One LAMP server – Linux Apache MySQL PHP Subversion Trac and Samba – Part 2

This guide is provided for users who want to test these in testing environment. Please use this guide at your own risk.

Part 2 will focus on LAMP server installation and configuration

Install Linux Apache MySQL PHP server

tasksel install lamp-server

Add Fully Qualified Domain Name to Apache

echo "ServerName ubuntu.jakeyoon.com" > /etc/apache2/conf.d/fqdn

Restart Apache

/etc/init.d/apache2 restart

Enable remote MySQL connection from other hosts and enable innoDB file per table option

emacs /etc/mysql/conf.d/my.cnf

Example file content

[mysqld]
bind-address = 0.0.0.0
innodb-file-per-table

Restart mysql

/etc/init.d/mysql restart

Install PHPMyAdmin

aptitude install phpmyadmin

Create VirtualHost for phpmyadmin with different port [Optional]
Move default phpmyadmin configuration to available site configuration for apache

mv /etc/apache2/conf.d/phpmyadmin.conf /etc/apache2/sites-available/phpmyadmin

Add VirtualHost configuration to phpmyadmin

emacs /etc/apache2/sites-available/phpmyadmin

Example file content

# phpMyAdmin default Apache configuration

Listen 8080
#Alias /phpmyadmin /usr/share/phpmyadmin

<VirtualHost *:8080>
DocumentRoot /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
Options Indexes FollowSymLinks
DirectoryIndex index.php

<IfModule mod_php5.c>
AddType application/x-httpd-php .php

php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IfModule>

</Directory>

# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
<IfModule mod_authn_file.c>
AuthType Basic
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.setup
</IfModule>
Require valid-user
</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
Order Deny,Allow
Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
Order Deny,Allow
Deny from All
</Directory>
</VirtualHost>  

Enable edited site phpmyadmin.conf

a2ensite phpmyadmin

Restart Apache

/etc/init.d/apache2 restart

Now phpmyadmin is available at http://192.168.1.10:8080/

Leave a Reply

Your email address will not be published. Required fields are marked *