LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Where should I put my phpmyadmin source? (https://www.linuxquestions.org/questions/linux-server-73/where-should-i-put-my-phpmyadmin-source-4175445717/)

sneakyimp 01-15-2013 11:43 AM

Where should I put my phpmyadmin source?
 
I'm setting up an EC2 instance with Amazon Linux (which is apparently derived from RHEL). Because this distro does not have a package for phpmyadmin, I am installing it manually. Where should I put the phpmyadmin source files? Is there some traditional location? Also, what about the apache conf to enable phpmyadmin? I expect the apache conf (named phpmyadmin.conf or something obvious) should go to /etc/httpd/conf.d or something?

Any advice would be much appreciated. I've been looking around my ubuntu machines and the package seems to scatter files all over creation.

tronayne 01-15-2013 12:05 PM

You might want to look here: http://wiki.phpmyadmin.net/pma/Quick_Install.

Hope this helps some.

sneakyimp 01-15-2013 12:12 PM

Quote:

Originally Posted by tronayne (Post 4870724)
Hope this helps some.

Sadly, it does not. I've been looking at this page which is more or less the same thing and neither page mentions where it should go beyond making it accessible to apache. I'd prefer NOT to have it in the /var/www/html directory (or any other specific web root) and would prefer instead to have it accessible as an Alias.

Where does one put libraries of code in a RHEL environment? That's really what it is, right?

Also, perhaps one should separate out the config from the library and separate out still the apache config.

tronayne 01-15-2013 12:41 PM

Well, I've always put it in the document root (/var/www/htdocs on my machines) as instructed and got it going by following the configuration instructions (and the automagic one, too). I suppose you could unpack it wherever you want and put a symbolic link in your document root and configure from there.

I would not try to separate anything out of the phpmyadmin directory -- you're just asking for grief if you do.

Try the symbolic link and see what that does for you.

John VV 01-15-2013 02:33 PM

do not leave the source on a remote machine !!!

keep it on your local copy of the web site

keep a known good copy of the code running the site at home ( or work)
and then keep a running back up of the site or the "working on" version that you are testing updates on

sneakyimp 01-15-2013 05:17 PM

Quote:

Originally Posted by John VV (Post 4870810)
do not leave the source on a remote machine !!!

Not sure what you mean. phpMyAdmin is PHP code. The source *has* to live on the machine.

John VV 01-15-2013 07:30 PM

then lay it out something like
/var/www/
/var/www/mysql
/var/www/phpmyadmin
/var/www/htdocs

"/var/www/htdocs" is set as the "Documentroot" in the httpd.conf
right ?

tronayne 01-16-2013 07:56 AM

I might note that PhpMyAdmin installed in the document root (/var/www/htdocs) is owned by root, its group is apache and the directory mode is 750:
Code:

drwxr-x---  8 root  apache  4096 Nov 29 16:58 phpmyadmin/
That is, root owns it, apache has access, public is unable to access. Within the phpmyadmin directory, all directories and files are owned by root, group apache; file mask is 640, directory mask is 750 (this is done by the config.php set up program you execute from the browser). All the files are PHP code or CSS code, some documentation, some JavaScript and so on -- it's a PHP application and does not contain any compilable source code whatsoever.

In order to use it, you will (probably) need to at least modify /etc/httpd/httpd.conf (or whatever the name and location of your httpd.conf file happens to be), adding "index.php" in this section:
Code:

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

then restart the httpd daemon.

Follow the installation instructions in the PhpMyAdmin documentation for any other changes to httpd.conf (I don't remember any others right now but there may some).

You can safely install PhpMyAdmin in your document root (the owner, group and mask given above make doing so feasible). You can install it above the document root and add a symlink in the document root so Apache can "see" it (that's a little harder, you have to all symlinks in httpd.conf); "above" here means in /var/www or, for example, /usr/local or any other spot you choose -- bear in mind that you then have to deal with symlinks in httpd.conf and, probably, a lot of screwing around to get it working.

Is it safe? Yes -- as long as your root password is not compromised, it is. There should not be a password on apache (either the account or the group), there is no need for one. If your root password is compromised, well, the entire system is hosed and all bets are off (guard it well).

Hope this helps some.


All times are GMT -5. The time now is 03:07 PM.