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<br><br>Post edited by: tbirnseth, at: 2008/11/20 08:01
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.
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 ;-)
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
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
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
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
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
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
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:1]
[Mon Nov 17 01:24:51 2008] [error] [client 192.168.101.114] client denied by server configuration: /usr/share/phpMyAdmin/
[/code:1]
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:1]
<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>
[/code:1]
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:1]
[Mon Nov 17 01:24:51 2008] [error] [client 192.168.101.114] client denied by server configuration: /usr/share/phpMyAdmin/
[/code:1]
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:1]
<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>
[/code:1]
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 only reference in httpd.conf is for the root.com domain and it references only the instance that's within it's public_html/phpmyadmin directory.
Yes, Fedora 8 comes with phpMyAdmin installed in /usr/share.
I will uninstall it and see what happens.
thanks,
tony
Perfect, that worked. I will get an SSL cert when I move this to production, but other than that, all is well.
Any thoughts on why roundcube sees the 'send from' address as the user within an aliased domain? I.e. 'test@test.ez-ms.com' versus 'test@test.com'?
I don't recall how exactly RoundCube chooses what address to use when sending a message -- but you can change it by logging into RoundCube, going into preferences, and changing the From address.
I do recall there being a mention of a RoubdCube plugin for Virtual Hosting that may help cases like this.
It looks like there's some discussion of it here:
http://www.virtualmin.com/forums/virtualmin/imap-addresses-picking-up-se...
I haven't tried that, but if you're interested in tinkering with it a bit, let us know how it goes!
-Eric
It appears from the roundcube config file that it is using /etc/postfix.virtual for translation.
This file looks a little like a mess so I'm not sure how VM updates it and cleans it up. I've deleted/created test.com so many times, even the smallest bug would end up severely compounded.
I tried it on another domain that hasn't been created/deleted so often. The return address looks reasonable 'ezms@ez-ms.com'. However, when I try to send an email to ezms@ez-ms.co it gets returned as undeliverable stating "<ezms@ez-ms.com>: User unknown in virtual alias table".
When I look at /etc/postfix/virtual, it has entries (in this order) like this for 'ezms'.
[code:1]
ezms ezms@ez-ms.com
ezms@ez-ms.com ezms
ez-ms.com ez-ms.com
[/code:1]
Assuming this is a linear parser (resolves first, the lookup/resolve 2nd, etc.) that would imply that user 'ezms' has an email address of 'ezms@ez-ms.com' (which is correct). Next it encounters 'ezms@ez-ms.com' and relates it to 'ezms' (still good since that should resolve to 'ezms@ez-ms.com'). And finallly it reaches 'ez-ms.co' which resolves to the same thing. So all "should" be well and that's why the From address in composed mail is okay.
I have no idea why mail can't be sent to 'ezms@ez-ms.com' considering the above defintions. Working backward (for receipt) it should end up resolving to user 'ezms' which should enable delivery.
I have no clue and don't believe the sent mail has anything to do with roundcube at that level. Any postfix experts care to comment?
thanks,
tony
CentOS 7.2 - Virtualmin Pro - installed on or about 11/2016. Trying to get phpMyAdmin installed. I tried to install the latest version as listed in the Virtualmin's 'Install scripts' dropdown -- phpmyadmin 4.6.5.1 but it said no - my php wasn't up to snuff although update routine claimed no updates available. So I tried to install the next older 'stable' version of phpmyadmin 4.4.15.9. That installed without errors, but gave me nothing for a login page - only html error can't display web page (security failure as it were I suppose) and after some tweaking the .conf files I got the "page of php code" misfire. Tried every recommended .conf solution on the web to no avail. But my solution was actually very simple. Went and fetched this version of php - PHP 5.6.28 (one higher than I had at the time php -- 5.4) Even though the system updater refused to work with me, I just manually PuTTy installed the newer (not the newest, btw) php and then the latest phpmyadmin 4.6.5.1 thru VirtualAdmin script installer - and the problem is resolved. I fetched the package at php.net - there's more newer versions, but I didn't want to jump too far ahead. In the end, there was no need to adjust any of the phpmyadmin conf settings, Just download, untar, install a newer php - I did it remote using PuTTy.
Tim Vger