I'm currently having issues setting up PHPMyAdmin as a subdomain. I was able to do this on Ubuntu 12.04 no problem but since upgrading can't seem to get it properly configured. Here's the conf I'm trying to load:

    <VirtualHost *:80>
    ServerName sub.domain.com
    ServerAlias www.sub.domain.com
    DocumentRoot "/usr/share/phpmyadmin"
    <Directory /usr/share/phpmyadmin>
    Options 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_admin_flag allow_url_fopen Off
    php_value include_path .
    php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
    php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/$
    <Directory /usr/share/phpmyadmin/libraries>
    # AllowOverride All
    # Require all granted
    Order Deny,Allow
    Deny from All
    <Directory /usr/share/phpmyadmin/setup/lib>
    # AllowOverride All
    # Require all granted
    Order Deny,Allow
    Deny from All
  • Could you update your question with error you got? – Lety Aug 18 '14 at 7:49

Follow these steps. I'm going to use 'example' as the file/subdomain name. You can name it something like 'phpmyadmin'

sudo nano /etc/apache2/sites-available/example.conf

Add this inside example.conf

<VirtualHost *:80>

    ServerAdmin user@domain.com
    ServerName domain.com
    ServerAlias example.domain.com
    DocumentRoot /usr/share/phpmyadmin

        <Directory /usr/share/phpmyadmin>
            Require all granted

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


Save the file and then from your terminal run

sudo a2ensite example.conf

Now just restart apache2

sudo service apache2 reload

That's all you have to do for it to work in Ubuntu 14.04 with Apache 2.4.7 and to get to your PHPMyAdmin just type this in your browser.

| improve this answer | |
  • you are missing the closing </VirtualHost> – pixeline Jan 31 '15 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.