Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Installing and upgrading phpMyAdmin on a VPS using ssh

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
Taher
Posts: 9
Joined: 2010-03-08 21:24

Installing and upgrading phpMyAdmin on a VPS using ssh

#1 Post by Taher »

Hello all

I am trying to install phpMyAdmin using ssh (I use putty to connect to my Virtual Private server from my windows home computer)

I have managed to download the latest phpMyAdmin from sourceforge and I have renamed it to phpMyAdmin.tar.gz

Now I don't know how to install it. I have tried "apt-get install phpMyAdmin.tar.gz" but that gives me:

Code: Select all

Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package phpMyAdmin.tar.gz
So I assume I should not use apt-get

I also tried "pear install phpMyAdmin.tar.gz" but receive the following error:

Code: Select all

parsePackageName(): invalid package name "phpMyAdmin.tar.gz" in "phpMyAdmin.tar.gz"
could not extract the package.xml file from "phpMyAdmin.tar.gz"
Cannot initialize 'phpMyAdmin.tar.gz', invalid or missing package file
Package "phpMyAdmin.tar.gz" is not valid
install failed
I'm heading of to bed now so I won't be able to answer follow-up questions until tomorrow.

/Taher
Last edited by Taher on 2010-03-10 12:57, edited 1 time in total.

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Installing phpMyAdmin

#2 Post by Absent Minded »

tar.gz files are compressed archives and need to be extracted. once extracted typically there is a file inside that will give you instructions of how to install things.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

Taher
Posts: 9
Joined: 2010-03-08 21:24

Re: Installing phpMyAdmin

#3 Post by Taher »

Thank you Absent Minded.
When reading the installation guide it said that I need to have php5.2 or later. The VPS I am using comes with php5.0 so I need to upgrade that as well. Perhaps it is better if I describe my goal and perhaps the kind people of this forum can guide my way forward.

Goal: Having Magento installed on my updated and secure VPS.

Steps on the way: (as I understand it)
  • 1. Upgrade PHP from 5.0 to the latest stable version
    2. Upgrade mySQL to the latest stable version
    3. Install latest version of phpMyAdmin
    4. Install latest version of Magento
Backgrond: The VPS I am using has an administrative Panel called Parallels Power Panel. According to the information about installed applications it says that my installed version of mySQL is "MySQL for Debian GNU/Linux 5.0 EZ Template" and that my version of PHP is "PHP for Debian GNU/Linux 5.0 EZ Template". The VPS comes with 1-click (or other simplified installtion) installation options for mySQL, PHP, phpMyAdmin and Magento from the Power Panel. However I have noticed that the applications installed are all old and some of them even missing critical upgrades. This is part of why I want to install fresh application, but also because I want to lear how to do that.

Most information that I have found about working with Debian is for people installing it on their own home computer or for people who know what they are doing. If you know of any good place to learn more about working(installing, uninstalling and upgrading) with a already installed debian OS on a remote server I would be more than happy to read, or buy that book!

In the mean time... Any and all help is apreciated!

Now I do not know if the steps I mentioned above are the best steps forward so don't be afraid to let me know if there are better ways of achieving what I am trying to achieve!

Questions
  • 1. How do I verify which version of PHP and mySQL that I am running?
    2. How do I know if the latest versions of PHP and mySQL and phpMyAdmin wotk together?
    3. How do I upgrade PHP to the latest stable version?
    4. How do I upgrde mySQL to the latest stable version?
    5. How do I check which web-server I have?
A more general question. What is Pear?

BR
/Taher

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Installing phpMyAdmin

#4 Post by Absent Minded »

okay, the first thing i would do is ssh in to the VPS and check that the /etc/apt/sources.list file has valid sources to get updates from. One of those lines "should" be labeled security updates. Then from the command line i would run apt-get update to refresh the source list. When that is done run aptitude and select to install all available updates. Once you have gotten that far let us know where you stand. of course feel free to ask questions at any time as well as doing some searching in your faviorate search engine.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

User avatar
bluesdog
Posts: 2077
Joined: 2006-02-01 09:02
Location: Similkameen, British Columbia, Canada
Been thanked: 1 time

Re: Installing phpMyAdmin

#5 Post by bluesdog »

You can use a small php script to find out a lot of information about your apache/php/sql site.

type the following in a plain text editor, and name it info.php

Code: Select all

<?php phpinfo(); ?>
upload it to your server root, and call it in your browser

Example,

Code: Select all

http://yourservername/info.php
As Absent-Minded suggests, most of what you want to do can by done via ssh, including editing scripts via nano, updates, package installs etc. Note that if you're running any program via ssh, closing the shell will terminate whatever process you're running in it, unless you append an & disown at the end of the command. For example, if you type in a shell

Code: Select all

aptitude update & disown
you may then close the shell before the process finishes, and the process will continue until it completes.

ssh is extremely powerful and useful

Welcome to Debian

Taher
Posts: 9
Joined: 2010-03-08 21:24

Re: Installing phpMyAdmin

#6 Post by Taher »

sources.list gives med the following:

Code: Select all

deb http://ftp.de.debian.org/debian lenny main contrib non-free
deb http://ftp.de.debian.org/debian-volatile lenny/volatile main contrib non-free
deb http://ftp.de.debian.org/debian-security lenny/updates main contrib non-free
I had already run "apt-get update" and "apt-get upgrade"
Nothing happens when I try typing "aptitude" but I assume that apt-get upgrade does the actual upgrades, It sure looked like it =)

I went a step further and ran "apt-get install php5"
No error messages and everything seemed to have gone well.

Then I ran "apt-get install phpMyAdmin"
A 'screen' pops up asking me which web-server I use. I didn't select anyone of them so I assume I will have to uninstall phpMyAdmin and reinstall it now that I actually know which server it is I am using.
The phpinfo() vas very useful and I will definetly revisit that to learn more! Thanx.

I am going to try and fix so that phpMyAdmin gets the correct web server selected. There is however the issue of where the files I install end up.

Here are the steps I am planning on taking during the day.
  • Reinstalling phpMyAdmin with correct web server.
    Finding phpMyAdmin installed files and move them to a sub-folder in the www-root.
    If the above works I will get and install Magento.
Two questions though
Is it dangerous to leave the info.php file in the www-root? Is this the kind of information that ill-doers would like to know to exploit possible security problems?

I will come back with my progress as soon as I have made any =)

Taher
Posts: 9
Joined: 2010-03-08 21:24

Re: Installing phpMyAdmin

#7 Post by Taher »

running

Code: Select all

# apt-get --purge remove phpMyAdmin
let me know that there are three other packages that are no longer needed (which seems correct as 3 additional packages where installed when I installed phpMyAdmin)
apt-get also gave me the suggestion to run

Code: Select all

apt-get autoremove
so I did and it removed the three orphaned packages.

running
apt-get install phpMyAdmin
and choosing Apache2 this time to be reconfigured.

I receive this line and I am worried that it will cause a problem later.

Code: Select all

Could not reliably determine the server's fully qualified domain name, using [My servers IP] for ServerName
This is correct as I don't want people to access the site until I have it up and running. Will this cause problems when I get a more proper domain-name?

After some looking I found the phpMyAdmin files located in /usr/share/phpmyadmin
Should I move the whole folder to the www-root?
I tried doing that and then I directed my browser there. Firefox wants to download the index-file. I don't understand why?!

So to the best of my knowledge my current situation is that I have php5 correctly installed and I have phpMyAdmin installed but not in the correct place.

This means that I am almost here! =)

What I am currently working on is figuring out if I should move the phpmyadmin folder to www-root or if I should have some form of link from www-root to phpmyadmin instead.

I have no understanding of any security issues with either solution or how to implement them so tips and best practice is apreciated even if I succeed with it =)

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Installing phpMyAdmin

#8 Post by Absent Minded »

you shouldn't have to copy the phpmyadmin files to your root web directory. you should be able to access phpmyadmin just by going to http://youripaddress/phpmyadmin
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

Taher
Posts: 9
Joined: 2010-03-08 21:24

Re: Installing phpMyAdmin

#9 Post by Taher »

When I direct my browser to server/phpmyadmin/ I get to download a file. The file that is downloaded is the index.php-file. This makes me assume that something is wrong with my php-configuration.

However when I go to server/info.php it loads a correct html page with a lot of information loaded by phpinfo(). This would suggest that php is working (properly?)

I don't know how to continue with me error detection from here. =/

/Taher

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Installing phpMyAdmin

#10 Post by Absent Minded »

have you restarted apachie2 since your install of phpmyadmin?
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

Taher
Posts: 9
Joined: 2010-03-08 21:24

Re: Installing phpMyAdmin

#11 Post by Taher »

nope

Now I have googled it and come to the conclusion that I should run

Code: Select all

apache2ctl graceful
This returned the following:
apache2: Could not reliably determine the server's fully qualified domain name, using IP for ServerName

When going to server/phpmyadmin/ I'm still asked to download the index.php instead of actually seeing the html it should generate.

when just going to server/ the index.html loads properly.

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Installing phpMyAdmin

#12 Post by Absent Minded »

this is very bizzare behavior. what web browser are you using? Would you be willing to pm me the IP so I can verify that it is your apache config? I have read that in certain cases that apache has to be told what to serve up as a web page. I haven't had this experience on any of my web servers though.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

Taher
Posts: 9
Joined: 2010-03-08 21:24

Re: Installing phpMyAdmin

#13 Post by Taher »

I have sent you private message with my ip.

I'm using firefox and I have tried internet explorer as well.

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Installing phpMyAdmin

#14 Post by Absent Minded »

once the directory is back in place try running dpkg-reconfigure phpmyadmin and see if that will fix things.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Installing phpMyAdmin

#15 Post by Absent Minded »

Absent Minded wrote:once the directory is back in place try running dpkg-reconfigure phpmyadmin and see if that will fix things.
come to think of it you may want to use dpkg-reconfigure php5 as well as it "should" have been what setup apache to use php.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

Taher
Posts: 9
Joined: 2010-03-08 21:24

Re: Installing phpMyAdmin

#16 Post by Taher »

Where is in place? Is it usr/share?

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Installing phpMyAdmin

#17 Post by Absent Minded »

according to my home server, yes that is correct
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Installing phpMyAdmin

#18 Post by Absent Minded »

okay, i see you have things back in place and they are working on my end.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

Taher
Posts: 9
Joined: 2010-03-08 21:24

Re: Installing phpMyAdmin

#19 Post by Taher »

I just your PM

The file exists where it should be
I have moved back the phpmyadmin directory to /usr/share/
I have now run dpkg-reconfigure phpmyadmin and php5
I have restarted the apache2 server using apache2ctl graceful

when I go to server/phpmyadmin I am still asked to download the index.php file (in firefox) but it works in internet explorer! go figure =/

When I go to http://server/phpmyadmin/index.php using firefox it works.. This would indicate that my firefox won't open index.php per default anymore so that should be a setting in firefox that I must have changed in the process somewhere..

Now I can move forward with my installation of Magento..

Many thanks!
Perhaps we should change the topic name so that people can find this thread in the future?!

User avatar
Absent Minded
Posts: 3464
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.
Been thanked: 3 times

Re: Installing phpMyAdmin

#20 Post by Absent Minded »

you are welcome. i am glad it is working now on your end. To change the topic heading you just edit your first post.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012

Post Reply