LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-18-2010, 10:21 AM   #1
tomehb
LQ Newbie
 
Registered: Feb 2010
Posts: 11

Rep: Reputation: 0
Post Apache 2.2 AuthType Digest, PAM Module, MySQL - Configuration & guidance needed..


Hi Guys,

Just setup an Apache2 server, and I would like to setup a login. I also wanted to use the same method that is setup for vsftpd....

For vsftpd I've created a mysql database.... structured as:

Code:
mysql> use vsftpd
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> describe accounts;
+----------+-------------+------+-----+---------+----------------+
| Field    | Type        | Null | Key | Default | Extra          |
+----------+-------------+------+-----+---------+----------------+
| id       | int(11)     | NO   | PRI | NULL    | auto_increment |
| username | varchar(30) | NO   | UNI | NULL    |                |
| pass     | varchar(50) | NO   |     | NULL    |                |
+----------+-------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
So not really sure what I was doing I proceeded to attempt to get this to work with Apache 2.2.......



My apache config is the following:
Code:
        # Website Dir
        <Directory /var/wwws/>

                #Server Auth
                AuthType Digest
                AuthName "Authentication Required"
                AuthPAM_Enabled on
                AuthPAM_FallThrough Off
                AuthBasicAuthoritative off
                Require valid-user

                Options -ExecCGI -FollowSymLinks -Indexes
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>


my /etc/pam.d/apache2 configuration:
Code:
auth required pam_mysql.so user=vsftpd passwd=**** host=localhost db=vsftpd table=accounts usercolumn=username passwdcolumn=pass crypt=2

account required pam_mysql.so user=vsftpd passwd=**** host=localhost db=vsftpd table=accounts usercolumn=username passwdcolumn=pass crypt=2

However I get the following error found in /var/log/error.log:

Code:
[Wed Feb 17 01:54:02 2010] [notice] Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g configured -- resuming normal operations
[Wed Feb 17 01:54:08 2010] [crit] [client 81.23.57.*] configuration error:  couldn't check user.  No user file?: /
[Wed Feb 17 01:54:09 2010] [crit] [client 81.23.57.*] configuration error:  couldn't check user.  No user file?: /favicon.ico
and when you navigate to the site: www.tomehb.co.uk (click secure & ignore SSL Cert to bypass error or download the certs lol!) you get....

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.




Q1) Is it possible?
Q2) Any Guidance on what I need to read?
Q3) Is This Just a Stupid Method?
 
Old 02-18-2010, 06:51 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If I follow your design, then the problem is that the 'login credentials' you are checking are stored as data inside MySQL; fine.
However, you also need Apache to have MySQL credentials to login to the DB to read that table ...
 
Old 02-18-2010, 07:20 PM   #3
tomehb
LQ Newbie
 
Registered: Feb 2010
Posts: 11

Original Poster
Rep: Reputation: 0
Arrow ok...

Quote:
Originally Posted by chrism01 View Post
If I follow your design, then the problem is that the 'login credentials' you are checking are stored as data inside MySQL; fine.
However, you also need Apache to have MySQL credentials to login to the DB to read that table ...
Hi, I thought that pam would do that?
 
  


Reply

Tags
apache, apache2, mysql, pam



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache hangs when starting -> Digest: generating secret for digest authentication ... jma Linux - Networking 4 02-22-2007 01:02 AM
ssh-pam module configuration thobias.reaper Linux - Security 1 07-16-2006 10:24 AM
apache 2 + ssl + authtype collen Linux - Networking 0 03-10-2005 03:46 AM
AuthType Digest Issue in CUPS ananthn Debian 0 08-11-2004 12:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration