PMA Errors | Odd redirect to localhost

Ryan Schmidt ryandesign at macports.org
Wed Aug 18 08:38:48 PDT 2010


On Aug 18, 2010, at 00:52, Jasper Frumau wrote:

> 1/I Installed PHPMyAdmin using MacPorts. When I go to localhost/phpmyadmin I get the logon screen where I can login as root. But after logging in I only see ��5:q! Very odd. Here the access log:

":q!" looks familiar as the command you would use to exit vi(m) without saving. Perhaps you somehow managed to insert that into your phpmyadmin config file, or another phpmyadmin file you edited. You could grep recursively in your document root for ":q!" and see what turns up.

> (I changed DocumentRoot about a week ago as I prefer things to be in www and I wanted to start working with virtualhost as well..)

Ok, just make sure your cgi-bin directory isn't inside your DocumentRoot. (By default, MacPorts would put a cgi-bin inside /opt/local/www.)


> And these are the CHMOD/CHOWN right on phpmyadmin and all files is www for that matter:
> jaspersmbp:www jasper$ ls -l | grep phpmyadmin
> drwxr-xr-x  100 jasper  admin     3400 Jul 29 12:11 phpmyadmin
> 
> Should I change the group pma is in and all files for that matter?

I don't think it matters. As long as the web server can read, but not write, the web files, you can use whatever permissions and ownership pleases you.


> 2/When I enter gmail in the address bar or Facebook the browser - Firefox - now redirects me to localhost instead of forwarding me to Google. This is my hosts file:
> 
> jaspersmbp:extra jasper$ cat /etc/hosts
> ##
> # Host Database
> #
> # localhost is used to configure the loopback interface
> # when the system is booting.  Do not change this entry.
> ##
> 127.0.0.1    localhost
> 127.0.0.1    jaspersmbp
> 255.255.255.255    broadcasthost
> ::1             localhost 
> fe80::1%lo0    localhost
> 
> 
> Any ideas how this could happen?


Hard to know. If I remember correctly, when you type something into the Firefox address bar that is not an address, Firefox does a Google search for you. You can turn this off in Firefox's "about:config". If you turned it off, or are using a browser like Safari that doesn't do this anyway, then the browser just hands what you typed to the DNS server; in that case, perhaps your DNS server is responding with the IP address of some HTTP server instead of telling you what you typed is not a valid hostname. These types of "helpful" DNS servers are becoming more popular, and usually the HTTP server whose IP address they give you will then display a search page of its own. But maybe it is misconfigured and redirecting to localhost. Or maybe your DNS server is handing you the IP address of localhost in the first place. You can test this by doing some DNS lookups of nonexistent servers and seeing what IP addresses you get back, and what happens when you visit those IPs in a web browser.



More information about the macports-users mailing list