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 Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas
On Wed, Jan 5, 2011 at 11:42 AM, Paul Johnson pauljohn32@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.
Paul Johnson 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
<snip> The typical php "method": scatter things every-bloody-where.
Two suggestions, instead of copying: 1) modify the php.ini to have its path point everywhere, or 2) instead of copying, make symbolic links, so that there's only one copy.
mark
On 1/5/2011 10:42 AM, Paul Johnson 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.
What is keeping it from working with the supplied: Alias /phpMyAdmin /usr/share/phpMyAdmin (i.e. to the install location)?
On Wed, Jan 5, 2011 at 11:46 AM, Les Mikesell lesmikesell@gmail.com wrote:
On 1/5/2011 10:42 AM, Paul Johnson wrote:
What is keeping it from working with the supplied: Alias /phpMyAdmin /usr/share/phpMyAdmin (i.e. to the install location)?
-- Les Mikesell lesmikesell@gmail.com
You mean to say it does work for you, as delivered? Or that it ought to work for me, but you are just guessing?
In RedHat 6, at least, I cannot get ANY application to work if it does not offer files up from /var/www/html (no matter what the http config says). I now *THINK* the reason is SELinux. I understand http configuration, SELinux is a whole different problem. I understand the concept, but the tools to configure it are mysterious. The system will not offer things from /usr/share or whatnot, even if I alter the httpd config to allow it. The mediawiki RPM comes along with an httpd.conf file that tries to allow it. But the system won't allow it. Today I realized will not allow symbolic links from /var/www/html pointing into "safe" parts of the file system.
Yesterday I solved part of my mediawiki trouble. mail from php/CGI programs was not going to the users. I found out that SELinux was blocking mediawiki's attempted use of /usr/sbin/sendmail and learned how to fix that (see: http://www.mediawiki.org/wiki/Project:Support_desk#SOLVED:_RedHat_6_SELinux_...).
I have not been able to find anybody who is running Fedora or RedHat with SELinux turned on who was able to use mediawiki as it was delivered. If it works for you, please raise your hand.
For example:
http://www.johnson.homelinux.net/mywiki/Installing%20and%20configuring%20Med...
http://www.linuxquestions.org/questions/linux-software-2/how-to-install-medi...
http://dailypackage.fedorabook.com/index.php?/archives/120-Productive-Monday...
It may just be that we are all following some mistaken example from somebody who did not understand this any better than we do.
I had the same experience with phpMyAdmin. Not in /var/www/html. No Go.
pj
On 1/6/2011 10:31 PM, Paul Johnson wrote:
What is keeping it from working with the supplied: Alias /phpMyAdmin /usr/share/phpMyAdmin (i.e. to the install location)?
You mean to say it does work for you, as delivered? Or that it ought to work for me, but you are just guessing?
It works as-is on Centos 5.5 w/SELinux disabled. Which is why I asked what is stopping it on your system. It can either be changes you've made to your httpd.conf or it could be SELinux and you should be able to tell by the logged error messages.
In RedHat 6, at least, I cannot get ANY application to work if it does not offer files up from /var/www/html (no matter what the http config says). I now *THINK* the reason is SELinux. I understand http configuration, SELinux is a whole different problem. I understand the concept, but the tools to configure it are mysterious. The system will not offer things from /usr/share or whatnot, even if I alter the httpd config to allow it. The mediawiki RPM comes along with an httpd.conf file that tries to allow it. But the system won't allow it. Today I realized will not allow symbolic links from /var/www/html pointing into "safe" parts of the file system.
Your httpd.conf can permit symlinks or not. After that, what happens should depend on file system permissions and SELinux. If the SELinux labels are wrong, you can complain to the RPM packager, fix them, move the files to a place where the default is right, or disable SELinux.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 01/06/2011 11:31 PM, Paul Johnson wrote:
On Wed, Jan 5, 2011 at 11:46 AM, Les Mikesell lesmikesell@gmail.com wrote:
On 1/5/2011 10:42 AM, Paul Johnson wrote:
What is keeping it from working with the supplied: Alias /phpMyAdmin /usr/share/phpMyAdmin (i.e. to the install location)?
-- Les Mikesell lesmikesell@gmail.com
You mean to say it does work for you, as delivered? Or that it ought to work for me, but you are just guessing?
In RedHat 6, at least, I cannot get ANY application to work if it does not offer files up from /var/www/html (no matter what the http config says). I now *THINK* the reason is SELinux. I understand http configuration, SELinux is a whole different problem. I understand the concept, but the tools to configure it are mysterious. The system will not offer things from /usr/share or whatnot, even if I alter the httpd config to allow it. The mediawiki RPM comes along with an httpd.conf file that tries to allow it. But the system won't allow it. Today I realized will not allow symbolic links from /var/www/html pointing into "safe" parts of the file system.
Yesterday I solved part of my mediawiki trouble. mail from php/CGI programs was not going to the users. I found out that SELinux was blocking mediawiki's attempted use of /usr/sbin/sendmail and learned how to fix that (see: http://www.mediawiki.org/wiki/Project:Support_desk#SOLVED:_RedHat_6_SELinux_...).
I have not been able to find anybody who is running Fedora or RedHat with SELinux turned on who was able to use mediawiki as it was delivered. If it works for you, please raise your hand.
For example:
http://www.johnson.homelinux.net/mywiki/Installing%20and%20configuring%20Med...
http://www.linuxquestions.org/questions/linux-software-2/how-to-install-medi...
http://dailypackage.fedorabook.com/index.php?/archives/120-Productive-Monday...
It may just be that we are all following some mistaken example from somebody who did not understand this any better than we do.
I had the same experience with phpMyAdmin. Not in /var/www/html. No Go.
pj
SELinux expects apache content to be labeled as apache content. The default label for read only content in httpd_sys_content_t. If you put this in a random location or some packager does, they need to make sure the content has the correct label.
man httpd_selinux
explains some of this.
# semanage fcontext -a -t httpd_sys_content_t "/myapp(/.*)?"
Tells SELinux the default label for all content under /myapp will be httpd_sys_content_t.
Restorecon will then actually put the labels on your system.
# restorecon -R -v /myapp
Now you have permanently changed your SELinux labeling, and full relabel will maintain this. If you know of an application that puts content in a different location, please tell us and we will setup the default labeling for that directory, to be apache content.
On Thu, 6 Jan 2011 22:31:58 -0600 Paul Johnson pauljohn32@gmail.com wrote:
On Wed, Jan 5, 2011 at 11:46 AM, Les Mikesell lesmikesell@gmail.com wrote:
On 1/5/2011 10:42 AM, Paul Johnson wrote:
What is keeping it from working with the supplied: Alias /phpMyAdmin /usr/share/phpMyAdmin (i.e. to the install location)?
-- Les Mikesell lesmikesell@gmail.com
You mean to say it does work for you, as delivered? Or that it ought to work for me, but you are just guessing?
In RedHat 6, at least, I cannot get ANY application to work if it does not offer files up from /var/www/html (no matter what the http config says). I now *THINK* the reason is SELinux. I understand http configuration, SELinux is a whole different problem. I understand the concept, but the tools to configure it are mysterious. The system will not offer things from /usr/share or whatnot, even if I alter the httpd config to allow it. The mediawiki RPM comes along with an httpd.conf file that tries to allow it. But the system won't allow it. Today I realized will not allow symbolic links from /var/www/html pointing into "safe" parts of the file system.
In case this helps, this was the setup I had for the beta of RHEL v6 (still have, I just don't boot to that partition much) in my httpd.conf file for an alias for phpmyadmin, I just followed the example for the Alias icons already in the file:
Alias phpMyAdmin "/usr/share/phpMyAdmin"
<Directory "/usr/share/phpMyAdmin"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
And for virtual hosts under localhost I had the 'default' under /var/www/html and the others under /var/www (i.e. testsite1 and 2). No SELinux issues then, but that was the beta.
Cia W
On 5 January 2011 16:42, Paul Johnson pauljohn32@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.
I don't think that step is necessary. The contents of /etc/httpd/conf.d/phpMyAdmin.conf (specifically the two Alias lines) should ensure that the software works fine without moving it.
I don't have a Centos box that I can test on right now, but I've just installed phpMyAdmin on this Fedora 14 box for the first time (using yum) and it all just works. All I did was to restart the server.
If it's not working for you, then are you sure that your Apache is configured to use the files in /etc/httpd/conf.d? If the config file is being loaded successfully, then I can't see why it wouldn't work.
Dave...
On Fri, 7 Jan 2011 11:08:39 +0000 Dave Cross davorg@gmail.com wrote:
On 5 January 2011 16:42, Paul Johnson pauljohn32@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.
I don't think that step is necessary. The contents of /etc/httpd/conf.d/phpMyAdmin.conf (specifically the two Alias lines) should ensure that the software works fine without moving it.
I don't have a Centos box that I can test on right now, but I've just installed phpMyAdmin on this Fedora 14 box for the first time (using yum) and it all just works. All I did was to restart the server.
If it's not working for you, then are you sure that your Apache is configured to use the files in /etc/httpd/conf.d? If the config file is being loaded successfully, then I can't see why it wouldn't work.
I just checked the conf.d for RHEL v6 beta and there isn't a phpmyadmin.conf, which is probably why I added the alias to the httpd.conf file. fwiw.
So perhaps it's added on Fedora but not on RHEL / CentOS when you install phpmyadmin?