[CentOS] if you install cgi programs from rpm, how to configure for actual use in /var/www/html ?

Brian Mathis brian.mathis at gmail.com
Wed Jan 5 17:00:37 UTC 2011


On Wed, Jan 5, 2011 at 11:42 AM, Paul Johnson <pauljohn32 at gmail.com> wrote:
> In Centos 5.5, I've had this same experience over and over.  I have no
> trouble installing CGI programs the old fashioned way (untar into
> /var/www/html and configure), but don't like un-rpm managed files
> floating about.  So I can install, for example, phpMyAdmin, from EPEL.
>
> That phpMyAdmin RPM drops files into a bunch of locations, the php
> files are under /usr/share/phpMysql
>
> and then there are also:
>
> /etc/httpd/conf.d/phpMyAdmin.conf
> /etc/phpMyAdmin
> /etc/phpMyAdmin/config.inc.php
>
> and this:
>
> /var/lib/phpMyAdmin
> /var/lib/phpMyAdmin/config
> /var/lib/phpMyAdmin/save
> /var/lib/phpMyAdmin/upload
>
> In order to make this actually work on the web server, I copy the
> directory /usr/share/phpMyAdmin into /var/www/html and then I edit the
> /etc/httpd/conf.d/phpMyAdmin.conf.  Then it works.
>
> Then a new version of the phpMyAdmin RPM is released on EPEL, it gets
> installed, and I have no idea what I'm supposed to do to keep my thing
> in /var/www/html working.
>
> I had the exact same experience with the mediawiki RPM from EPEL.  It
> installs its files into /var/www/
>
> var/www/mediawiki116
>
> and
>
> /usr/share/mediawiki116
>
> The web server required everything to b e under /var/www/html/, so I
> copy files in there.  The mediawiki116 documentation does not mention
> this problem, but I've googled long enough until I found this, which
> agrees with me that it is necessary to copy the files over in order to
> use the media wiki.
>
> http://www.wikihow.com/Install-MediaWiki-on-Fedora
>
> Unfortunately, now the upgrade path is obscured. When RPM updates its
> files (scattered over the file system), what to do?
>
> ---
> Paul E. Johnson


You're right... what you are doing now is unmaintainable.  What you
should be doing instead is configuring apache separately for each
software you install.  If mediawiki installed itself in
/var/www/mediawiki, then you would set up an alias to that in the
apache config, something like "Alias /wiki /var/www/mediawiki".  When
you access the URL http://example.com/mediawiki, the files will be
served from the default install location.

You should also take a look at what's in /etc/httpd/conf.d to see how
to use the more modularized approach that is the default way apache is
installed with CentOS.  There might even already be some default conf
files from the ones you installed from rpm.  Use "rpm -ql
<packagename>" to see all the files installed by that package.  There
might be some clues in there about sample apache configs.

You might find docs about this somewhere in
/usr/share/doc/<packagename>, but I'm not aware of any documents that
actually explain this approach other than reading through the default
apache configs.  Maybe someone else can enlighten.



More information about the CentOS mailing list