Welcome, Guest
Please Login or Register.
Lost Password?
Re:phpMyAdmin (1 viewing)
Post Reply

TOPIC: Re:phpMyAdmin

#17895
tbirnseth (User)
Posts: 95
graphgraph
phpMyAdmin - Mostly Resolved 2008/11/15 22:57  
I setup VM to install phpMyAdmin via the default Script Installer for my Virtual Server template.

It copied the full path/directory structure to public_html (not sure why it wants to copy versus a directive to link to the installed location).

However, when I open the page in the browser, the phpMyAdmin index page comes up fine but it does not have any databases configured. There is a database associated with this server (test_com_cart - since ${PREFIX} is broken) and I would have expected the installer to adjust the configuration file(s) appropriately so the user would see their database(s).

What am I missing? I selected the 'Main Database' option for the 'DB name'. Maybe this is wrong.

Is there a reason the whole tree of the home location for phpMyAdmin is copied (rather than referenced) in the public_html directory? Seems that if VM created a config file in the installed directory then either an s-link or an alias might work to keep everything referenced versus copied.

How do I tell it to use the virtual server's databases? I.e. all databases that the user has permissions to see or act on?

thanks,
tony

Post edited by: tbirnseth, at: 2008/11/20 08:01
Tony Birnseth
EZ Merchant Solutions
http://www.ez-order-manager.com
  The administrator has disabled public write access.
#17896
tbirnseth (User)
Posts: 95
graphgraph
Re:phpMyAdmin 2008/11/15 23:09  
Okay, selecting None for the DB name seems to work. Would still like to know if there's a more effecient way of associating phpMyAdmin to a site rather than copying the whole tree to each server's public_html.
Tony Birnseth
EZ Merchant Solutions
http://www.ez-order-manager.com
  The administrator has disabled public write access.
#17906
andreychek (Moderator)
Posts: 859
graphgraph
Re:phpMyAdmin 2008/11/16 08:53  
Well, the way I do that is to offer customers a central page they can go to that offers links to all the services being offered -- Roundcube, Squirrelmail, Usermin, phpMyAdmin, etc etc.

Each of those applications are setup within the primary domain of the server.

And then, I bought an SSL cert for the primary domain I can use for each of those apps.
-Eric
I definitely wouldn't setup a phpMyAdmin instance for each Virtual Server though, that'd be a pain to maintain ;-)
  The administrator has disabled public write access.
#17910
tbirnseth (User)
Posts: 95
graphgraph
Re:phpMyAdmin 2008/11/16 10:18  
Can you provide any details on how you set this up by reference?
Let's say I have VM setup with the primary domain as 'root.com' (just an example). Do you mean that you create a virtual server of 'root.com' and then have all the other domains as sub domains within it so they can be aliased to different sub-directories of the parent domain?

I'm new at this so please account for my lack of understanding....

Right now I have each domain being created as a separate virtual server with an alias setup to another top-level domain on the server. I.e. I have 'root.com' and 'test.com'. I have it setup so that an alias is created for 'test.root.com' for each new virtual server that is created.

Are you saying that I can then just add phpMyAdmin to 'root.com' and then do a rewrite rule that says something like: "if file accessed is 'test.com/phpmyadmin' then redirect to 'root.com/phpmyadmin'?

Sorry if this is long and may not use terms correctly....

tony
Tony Birnseth
EZ Merchant Solutions
http://www.ez-order-manager.com
  The administrator has disabled public write access.
#17931
andreychek (Moderator)
Posts: 859
graphgraph
Re:phpMyAdmin 2008/11/16 20:04  
Hey Tony,

Well, what you're saying is fairly close to what I have setup.

I did indeed make root.com a Virtual Server -- and I setup phpMyAdmin within it (amongst some others).

But no other domains are sub-servers of it.

So, let's say I go to create a new Virtual Server (test.com) -- I set it up to create a DNS CNAME for phpmyadmin.test.com (which I configured in the DNS Server Template).

At that point, if I were to browse to phpmyadmin.test.com, since it's not currently aliased to any Virtual Host, I'd end up viewing the default Virtual Host, which I setup to be root.com (to make it the default, it just has to be the first Virtual Host listed in the Apache config).

Then, I edited the Apache Virtual Host config for root.com, and added this:

RewriteCond %{HTTP_HOST} ^phpmyadmin..*$ [NC]
RewriteRule ^(.*) https://root.com/phpmyadmin/

That says that anytime a URL beginning with "phpmyadmin." is seen, to redirect to "https://root.com/phpmyadmin".

And that's it -- now, anytime a new Virtual Server is added -- it creates a DNS CNAME for phpmyadmin, and whenever they go to it, it redirects to the central phpMyAdmin install in root.com.
-Eric
  The administrator has disabled public write access.
#17934
tbirnseth (User)
Posts: 95
graphgraph
Re:phpMyAdmin 2008/11/16 21:08  
Hi Eric,

Thanks for the concise and precise description...
Isn't this basically what the aliasing is supposed to do in VM? I haven't started playing with aliasing yet but it seems that is close to what it does without having to modify the DNS records. But I can do this if I can't figure out the aliasing part...

thanks again...

tony
Tony Birnseth
EZ Merchant Solutions
http://www.ez-order-manager.com
  The administrator has disabled public write access.
#17936
tbirnseth (User)
Posts: 95
graphgraph
Re:phpMyAdmin 2008/11/16 23:16  
Okay, I set things up as you indicated for phpmyadmin and for roundcube. It seems to redirect properly (physically) but phpmyadmin gives me an "you don't have permission to access /phpmyadmin/ on this server" message. I am not using https, but only http in the rewrite rule. Could this be the culprit?

Also, I would have thought I'd have an email in the inbox in roundcube from the server creation. But there's nothing.

Interesting though since I have 'test.com' setup as an alias for 'test.ez-ms.com', the "Sent From" in roundcube is showing 'test@test.ez-ms.com' but when the test message arrived, it was from 'test@test.com'.... Any idea why it's seeing the aliased server?

I want to create alias servers for each domain created so clients can access their sites before DNS is turned on.

toughts?

tony
Tony Birnseth
EZ Merchant Solutions
http://www.ez-order-manager.com
  The administrator has disabled public write access.
#17940
andreychek (Moderator)
Posts: 859
graphgraph
Re:phpMyAdmin 2008/11/17 05:11  
Well, you're right, and there's certainly plenty of ways to accomplish this, there definitely isn't just one.

If you'd rather create an alias domain -- I don't believe Virtualmin can do that "automatically", but you can accomplish that by setting up a CNAME in the DNS template, and a ServerAlias entry in the Apache template.

As for the trouble you're having with phpMyAdmin -- no, whether you're using http or https shouldn't matter.

I'd ignore the redirect for a moment, and just try going directly to root.com/phpmyadmin/ -- and assuming that errors, look in Apache's error log to try and troubleshoot the issue (it's in the logs dir associated with root.com).
-Eric
  The administrator has disabled public write access.
#17942
tbirnseth (User)
Posts: 95
graphgraph
Re:phpMyAdmin 2008/11/17 05:55  
No I can't get to it via www.root.com/phpmyadmin or via phpmyadmin.test.com.

The error in the error log is pretty generic:
Code:

[Mon Nov 17 01:24:51 2008] [error] [client 192.168.101.114] client denied by server configuration: /usr/share/phpMyAdmin/


So I'm assuming it is something in my httpd.conf. The relevant piece (the virtual server for root.com) looks like below. I have no idea where the issue might lie. Hopefully my cut/paste is accurate.

tony
Code:

<VirtualHost 192.168.101.2:80> SuexecUserGroup "#503" "#504" ServerName root.com ServerAlias www.root.com ServerAlias webmail.root.com ServerAlias admin.root.com ServerAlias lists.root.com ServerAlias email.root.com ServerAlias phpmyadmin.root.com DocumentRoot /home/root.com/public_html ErrorLog "|/etc/webmin/virtual-server/writelogs.pl 12269081376352 /home/root.com/logs/error_log" CustomLog "|/etc/webmin/virtual-server/writelogs.pl 12269081376352 /home/root.com/logs/access_log" combined ScriptAlias /cgi-bin/ /home/root.com/cgi-bin/ ScriptAlias /awstats /home/root.com/cgi-bin DirectoryIndex index.html index.htm index.php index.php4 index.php5 <Directory /home/root.com/public_html> Options -Indexes IncludesNOEXEC FollowSymLinks ExecCGI allow from all AllowOverride All AddHandler fcgid-script .php AddHandler fcgid-script .php5 FCGIWrapper /home/root.com/fcgi-bin/php5.fcgi .php FCGIWrapper /home/root.com/fcgi-bin/php5.fcgi .php5 </Directory> <Directory /home/root.com/cgi-bin> allow from all </Directory> <Directory /home/root.com/public_html/phpmyadmin> allow from all </Directory> RewriteEngine on RewriteCond %{HTTP_HOST} =webmail.root.com RewriteRule ^(.*) https://root.com:20000/ [R] RewriteCond %{HTTP_HOST} =admin.root.com RewriteRule ^(.*) https://root.com:10000/ [R] RewriteCond %{HTTP_HOST} ^phpmyadmin..*$ [NC] RewriteRule ^(.*) http://root.com/phpmyadmin/ RewriteCond %{HTTP_HOST} ^email..*$ [NC] RewriteRule ^(.*) http://root.com/roundcube/ RemoveHandler .php RemoveHandler .php5 IPCCommTimeout 31 IPCCommTimeout 31 <Files awstats.pl> AuthName "root.com statistics" AuthType Basic AuthUserFile /home/root.com/.awstats-htpasswd require valid-user </Files> PerlRequire /etc/webmin/virtualmin-google-analytics/apachemod.pl PerlOutputFilterHandler Virtualmin::GoogleAnalytics Alias /dav /home/root.com/public_html Alias /pipermail /var/lib/mailman/archives/public <Location /dav> DAV On AuthType Basic AuthName root.com AuthUserFile /home/root.com/etc/dav.digest.passwd Require valid-user ForceType text/plain Satisfy All RemoveHandler .php RemoveHandler .php5 </Location> RedirectMatch /cgi-bin/mailman/([^/]*)(.*) https://root.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$2 RedirectMatch /mailman/([^/]*)(.*) https://root.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$2 <Location /svn> DAV svn SVNParentPath /home/root.com/svn AuthType Basic AuthName root.com AuthUserFile /home/root.com/etc/svn.basic.passwd Require valid-user AuthzSVNAccessFile /home/root.com/etc/svn-access.conf Satisfy Any </Location> php_value memory_limit 32M </VirtualHost>

Tony Birnseth
EZ Merchant Solutions
http://www.ez-order-manager.com
  The administrator has disabled public write access.
#17945
andreychek (Moderator)
Posts: 859
graphgraph
Re:phpMyAdmin 2008/11/17 06:17  
I suspect something on your system is hijacking the phpMyAdmin request -- as it's trying to use a phpMyAdmin installed in /usr/share/phpMyAdmin, but that's not what you setup so far as I can see.

For example, if you have phpMyAdmin installed with your distro, that could happen.

I'd look in your Apache configs and see if you can find the culprit. I'm guessing you're running CentOS or RHEL, so look in /etc/httpd/conf.d, and see if any of those files make a reference to phpMyAdmin. If so, either comment them out, or move the file somewhere else, then restart Apache.
-Eric
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.