Point a subdomain to phpmyadmin installed on an ubuntu 12.04

Solution 1:

All you need to do is setup a subdomain for apache. You can do this by creating a configuration file in /etc/apache2/sites-available.

Here's mine ..

<VirtualHost *:80>
   ServerAdmin [email protected]
   ServerName phpmyadmin.example.local
   DocumentRoot /usr/share/phpmyadmin
   <Directory />
       Options FollowSymLinks
       AllowOverride None
   </Directory>
   LogLevel notice
   CustomLog /var/log/apache2/access.log combined
   ErrorLog /var/log/apache2/error.log
   ServerSignature On
</VirtualHost>

Save that to /etc/apache2/sites-available/phpmyadmin.conf and enable the subdomain.

a2ensite phpmyadmin

And restart the apache server

service apache2 reload

Now you should be able to use phpmyadmin from phpmyadmin.example.local.