[SOLVED] Apache Perl_mod installation - Apache guru needed

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] Apache Perl_mod installation - Apache guru needed

Postby mark9117 » Aug 25th, '13, 09:09

I may need an Apache guru here, but I'm trying to reinstall BackupPC after a system disc failure. I've installed everything I can find related to perl, installed modules via cpan, and setup ssh, but when I pull up the BackupPC admin web page, it has no administrative links and I can't configure it.

As near as I can tell, the issue is httpd isn't configured for me to authenticate on the backuppc stuff. The most obvious reason for that seems to be that the perl_mod module isn't loading.

Code: Select all
# httpd -l | egrep mod_perl
#


Yields nothing - the module isn't loading, and I'm at a loss to find any help configuring httpd.conf

So far I have added this to httpd.conf:

Code: Select all
# Include sites configuration
Include conf/sites.d/*.conf


And this installed with backuppc:

Code: Select all
ls sites.d/backuppc.conf
sites.d/backuppc.conf


Backuppc.conf looks like this:

Code: Select all
# BackupPC Apache configuration
Alias /backuppc /var/www/backuppc

<Directory /var/www/backuppc>
    Require all granted
    Options ExecCGI
    <Files BackupPC_Admin>
        SetHandler cgi-script
    </Files>
    DirectoryIndex BackupPC_Admin
    Allow from All
</Directory>


I have an .htaccess file in the /var/www/backuppc directory:

Code: Select all
# cat /var/www/backuppc/.htaccess
AuthGroupFile /etc/group    # <--- change path as needed
AuthUserFile /etc/passwd     # <--- change path as needed
AuthType basic
AuthName "access"
require valid-user


I am also running this instance of httpd as user=backuppc, group=backuppc.

As I said above, the web page comes up just fine, but there is no challenge for credentials and there are no administrative links on the web page.

Help?

Thanks.

Mark
Last edited by mark9117 on Aug 26th, '13, 00:29, edited 2 times in total.
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Apache Perl_mod installation - Apache guru needed

Postby djennings » Aug 25th, '13, 18:30

First of all do not run apache as backuppc user. That is a huge security risk.

# httpd -l | egrep mod_perl
Yields nothing - the module isn't loading, and I'm at a loss to find any help configuring httpd.conf


httpd -l list the compiled in modules, not the dynamically loaded ones.
When you install backuppc using urpmi it should install all the required packages. You do not need anything from CPAN.
Code: Select all
# urpmq --requires backuppc
--requires behaviour changed, use --requires-recursive to get the old behaviour
sendmail-command
apache
systemd[*][>= 195]
rpm-helper[*][>= 0.24.8-1]
rpm-helper[*][>= 0.24.8-1]
/bin/sh[*]
/bin/sh[*]
/bin/sh[*]
/bin/sh[*]
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
perl(Archive::Zip)
perl(CGI)
perl(CGI::Carp)
perl(Carp)
perl(Compress::Zlib)
perl(Config)
perl(Cwd)
perl(Data::Dumper)
perl(Digest::MD5)
perl(DirHandle)
perl(DynaLoader)
perl(Encode)
perl(Exporter)
perl(Fcntl)
perl(File::Compare)
perl(File::Copy)
perl(File::Find)
perl(File::Listing)
perl(File::Path)
perl(Getopt::Std)
perl(IO::Handle)
perl(Net::FTP)
perl(POSIX)
perl(Scalar::Util)
perl(Socket)
perl(Time::ParseDate)
perl(XML::RSS)


You do not need to add anything to httpd.conf


From my (working) backuppc config
/etc/httpd/conf/webapps.d/backuppc.conf
Code: Select all
Alias /backuppc /var/www/backuppc

<Directory /var/www/backuppc>
    Options ExecCGI
    <Files BackupPC_Admin>
   SetHandler cgi-script
    </Files>
    DirectoryIndex BackupPC_Admin
    AuthType Basic
    AuthName "My Login"
    AuthUserFile /etc/httpd/passwords
    Require user derek
    Order Deny,Allow
    Deny from All
    Allow from 192.168.1.0/24
</Directory>


It is necessary to use a secure login with backuppc or else it does not know who you are and will not permit control.
Your .htaccess file is not being read because you do not have an "AllowOverride" statement in backuppc.conf . Better to put the authority info in the conf file as I have done.
User avatar
djennings
 
Posts: 613
Joined: Jun 2nd, '11, 23:51
Location: Wokingham, UK

Re: Apache Perl_mod installation - Apache guru needed

Postby mark9117 » Aug 25th, '13, 20:27

Okay, thanks djennings. I'm at work now but will look at making those changes as quickly as I can.

I set this thing up years ago and survived several upgrades, but now I've had a system disc failure and guess what -- my backup server has no backup.

That's not entirely true. The BackupPC configs are backed up, but not the httpd stuff.

So, if I don't run the httpd server as the backuppc user (as instructed by backuppc and as I have done so successfully for years) how do I run it? Setuid backuppc?

Again, thanks for the response. This looks enormously helpful and I will get on it first chance.

I do appreciate it.

Mark
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Apache Perl_mod installation - Apache guru needed

Postby mark9117 » Aug 25th, '13, 22:18

Much to my employer's chagrin (it's slow today) and I decided to work on this issue remotely via my ssh connection to my LAN.

I implemented your changes and spent a long time trying to overcome a "password mismatch" error on Apache. I finally stumbled onto this resolution and wanted to post it here in hopes of saving someone else hours of grief. I quote from http://stackoverflow.com/questions/1575 ... d-mismatch

To witt: you have to create your password for Apache in batch mode to get this to work. It's a bug in this version of Apache.

Steve Bennett wrote:Did you create your password with 'htpasswd'?

htpasswd in httpd-2.4.4 is broken (https://issues.apache.org/bugzilla/show ... i?id=54735).

As I understand it, the problem is specific to htpasswd in httpd-2.4.4, and only occurs if you enter the password manually, so you can work around the issue by doing one of:

supply the password on the command line (e.g. "htpasswd -nb user password"); <=================== My Solution
use the version of htpasswd out of httpd-2.4.3;
use Digest Authentication instead of Basic Authentication (htdigest isn't affected);
wait until httpd-2.4.5 is released;
apply the patch in the bug report (which seems to work) and rebuild htpasswd from source


Just wanted to get that out there.

Again, thanks much for your guidance here. I do appreciate it.

Mark
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

[SOLVED] Re: Apache Perl_mod installation - Apache guru need

Postby mark9117 » Aug 25th, '13, 23:28

I should also mention that I ran into this:

http://www.linuxquestions.org/questions ... as-559628/

solution is to configure /etc/ssh/sshd_config from

Code: Select all
AuthorizedKeysFile      .ssh/authorized_keys


to

Code: Select all
AuthorizedKeysFile      /root/.ssh/authorized_keys


BUGS!
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest