phpmyadmin help

I have Ubuntu 10.04 installed on my Linode, and am trying to put phpmyadmin on it. So I just ran sudo apt-get install phpmyadmin and went through the default installation steps. I see the apache.conf file in /usr/share/phpmyadmin, and everything looks right. But I have no idea where or how to access phpmyadmin now.

I have apache set up for virtual hosting, and already have a few websites hosted. Going to example.com/phpmyadmin doesn't work on any of them, and same thing when I go to my ip address /phpmyadmin.

So now I'm lost. If anybody could help that would be awesome. Thanks in advance!

8 Replies

The default setting makes phpmyadmin inaccessible unless you take further steps, for the sake of security.

You'll need to copy the contents of the apache.conf file, and paste it into one of your virtual host files. If you want phpmyadmin to be accessible at your IP address, paste it into /etc/apache2/sites-available/default

But don't leave phpmyadmin accessible from the web after you're done with it. Disable it as soon as possible. It's a security risk.

@kohnmd:

I have Ubuntu 10.04 installed on my Linode, and am trying to put phpmyadmin on it. So I just ran sudo apt-get install phpmyadmin and went through the default installation steps. I see the apache.conf file in /usr/share/phpmyadmin, and everything looks right. But I have no idea where or how to access phpmyadmin now.

I have apache set up for virtual hosting, and already have a few websites hosted. Going to example.com/phpmyadmin doesn't work on any of them, and same thing when I go to my ip address /phpmyadmin.

So now I'm lost. If anybody could help that would be awesome. Thanks in advance!

I ran the install command and set the relevant user name and pass word for mysql.

Then went to my site address and placed " /phpmyadmin/ " on the end for example

http://www.yoursite.com/phpmyadmin/

This gave me the login screen for my php admin.

And yes as "hybinet" said you should disable it as of the security issues that it poses.

Thanks to both of you for the responses! I did what hybinet suggested and pasted the contents of the apache.conf file into /etc/apache2/sites-available/default and it worked like a charm.

I only need it briefly from time-to-time, so it's no hassle to turn it on only as needed. I'll definitely take your advice and disable it at all other times.

I do a symlink of apache.conf to /etc/apache2/conf.d/

ln -s /path/to/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf

Restart apache to load that config.

Another approach to securing PHPMyAdmin…

1. Restrict it to localhost in its Apache virtual host settings

2. Then, when you want to access PHPMyAdmin, SSH tunnel into your Linode

ssh -L 8080:localhost:80 yourusername@yourdomain.com

3. And type http://localhost:8080/phpmyadmin in your web browser

This approach requires being connected to your Linode via SSH to access PHPMyAdmin. If you have SSH keys, it's far less likely someone could hack into it then.

@jzimmerlin:

Another approach to securing PHPMyAdmin…

1. Restrict it to localhost in its Apache virtual host settings

2. Then, when you want to access PHPMyAdmin, SSH tunnel into your Linode

ssh -L 8080:localhost:80 yourusername@yourdomain.com

3. And type http://localhost:8080/phpmyadmin in your web browser

This approach requires being connected to your Linode via SSH to access PHPMyAdmin. If you have SSH keys, it's far less likely someone could hack into it then.

Live and learn… I did not know you could "tunnel" to it ! nice one I will give that a go some time soon. :)

@kohnmd:

Thanks to both of you for the responses! I did what hybinet suggested and pasted the contents of the apache.conf file into /etc/apache2/sites-available/default and it worked like a charm.

I only need it briefly from time-to-time, so it's no hassle to turn it on only as needed. I'll definitely take your advice and disable it at all other times.

Go to the following dir;

/etc/apache2/conf.d/

And comment out the Alias from the file phpmyadmin.conf , so it reads;

# Alias /phpmyadmin /usr/share/phpmyadmin

then use the following to reload your apache config;

/etc/init.d/apache2 reload

I think that does a global lockout rather than per site. :)

@zppadmin:

@jzimmerlin:

Another approach to securing PHPMyAdmin…

1. Restrict it to localhost in its Apache virtual host settings

2. Then, when you want to access PHPMyAdmin, SSH tunnel into your Linode

ssh -L 8080:localhost:80 yourusername@yourdomain.com

3. And type http://localhost:8080/phpmyadmin in your web browser

This approach requires being connected to your Linode via SSH to access PHPMyAdmin. If you have SSH keys, it's far less likely someone could hack into it then.

Live and learn… I did not know you could "tunnel" to it ! nice one I will give that a go some time soon. :)

Yes, it's a nice little trick. Wish I could take credit for thinking of it, but I learned it from someone else here on the forum.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct