/phpmyadmin alias not working
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
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
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?
Alias /phpmyadmin /phpmyadmin/
Options None
AllowOverride None
Order allow,deny
Allow from all
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
[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?
-
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. 0 -
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! 0 -
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: [url=http://docs.cpanel.net/twiki/bin/view/EasyApache/Apache/ModRuid]Apache Module: Ruid2 Thank you. 0
Please sign in to leave a comment.
Comments
3 comments