The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

/phpmyadmin alias not working

Discussion in 'Database Discussions' started by Jibbs, Oct 28, 2013.

  1. Jibbs

    Jibbs Registered

    Joined:
    Oct 28, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello all,

    I'm trying to create a /phpmyadmin alias to use externally from cpanel.

    I created a directory named "/phpmyadmin" on my server as a top level folder and added this to my httpd.conf

    Code:
    Alias /phpmyadmin /phpmyadmin/
    <Directory "/phpmyadmin">
            Options None
            AllowOverride None
            Order allow,deny
            Allow from all
    </Directory>
    
    So if i go to mysite.com/phpmyadmin i get a 404 error. I put in a file, test.txt and when to mysite.com/phpmyadmin/test.txt and saw the contents so that works

    I do a
    tail -f /etc/httpd/logs/error_log
    and get the following when trying to access mysite.com/phpmyadmin

    Code:
    [Mon Oct 28 15:42:52 2013] [error] [client 00.00.00.00] SoftException in Application.cpp:422: Mismatch between target UID (512) and UID (99) of file "/phpmyadmin/index.php"
    [Mon Oct 28 15:42:52 2013] [error] [client 00.00.00.00] Premature end of script headers: index.php
    00.00.00.00 is my ip omitted

    the target UID of 512 is the same UID of mydomain.com so it seems that apache wants the UID of the files/folders to be the same as whatever domain its being called from, but I want it to be accessible for every domain.

    Is there a way I can make apache ignore this for this folder?
     
  2. Jibbs

    Jibbs Registered

    Joined:
    Oct 28, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I suppose I should also add that I put the phpmyadmin files from the website into the /phpmyadmin folder and that if i chown the folder and files to the same user as the domain i am trying to access it works just fine.
     
  3. Jibbs

    Jibbs Registered

    Joined:
    Oct 28, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Ok so I may have answered my own question so I will post what I did here and someone can tell me if it's a bad thing.

    The problem was the UID not matching, which after some googling determined that its because the php handler Suphp runs the php process as the user it's calling it from.

    I switched the scripts running to DSO (mostly because people hosting on my server don't ever access their files directly anyway) and because it's supposed to run faster so sure, why not. DSO runs php as the user "nobody" so I chown'ed my /phpmyadmin directory to that.

    I also moved my httpd.conf changes to /usr/local/apache/conf/includes/post_virtualhost_global.conf so that it won't be overwritten anymore

    Nextly, I have open_basedir enabled and I want to leave it enabled so I had to edit my httpd.conf entries for all my sites, which would get erased after a rebuild so i had to edit my template file in /var/cpanel/templates/apache2/vhost.default (in the lines containing "open_basedir" I added ":/phpmyadmin" to the path variables allowing it for inclusion, for reference this is in 5 places

    I then rebuilt my httpd config using /scripts/rebuildhttpdconf and restarted apache, and all seems to be working.

    Now my sites can access theirdomain.com/phpmyadmin without having to log into cpanel!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    While the method you described appears to work, it would likely be more secure if you installed a manual copy of phpMyAdmin on any account that prefers direct access to it. You may also want to consider using Mod_Ruid2 with DSO:

    Apache Module: Ruid2

    Thank you.
     
Loading...

Share This Page