You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Kaplan, Andrew H." <AH...@PARTNERS.ORG> on 2011/01/04 17:56:23 UTC

[users@httpd] Problem with setting up authentication on an Apache2 server

Hi there --

I am running the LogAnalyzer application on an Ubuntu 10.04 distribution with
the Apache 2.2.14 server. My plan is to have both the application's internal
authentication and the .htaccess file set up for acess control. I placed the
.htaccess file in the directory that contains the webpage in question. The name
of the page is index.php, and it is located in the /var/www/logs directory. I
confirmed the /etc/apache2/apache2.conf file has the following entry within it:

AccessFileName .htaccess

The text of the .htaccess file is shown below:

AuthName "Log Server Access"
AuthType Basic
AuthUserFile
/etc/apache2/htpasswd.users
require valid-user

I then ran the htpasswd command to create a user account with its password.

After I completed the above steps, I restarted the computer, and brought up a
connection to the server. I was not prompted for a password, so the next step
that I took was to add the following to the apache2.conf file:

<Directory /var/www/logs>
AllowOverride AuthConfig
order allow,deny
allow from all
</Directory>
When I restarted the computer, and tried to access the page in question, I was
confronted with a 500 Internal Server Error message. 

The setup that I used is normally meant for authentication to html pages, while
the target page is php-based although I did not think that made a difference. I
did install the pacakge php-auth-pam that is available with Ubuntu, but I am not
sure how to configure it. 

Is the first method that I mentioned the correct way to set up authenication,
and if so what am I missing there? If the php-auth-pam package is the way to go,
how do I configure it?

Thanks.



The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

RE: [users@httpd] Problem with setting up authentication on an Apache2 server

Posted by "Kaplan, Andrew H." <AH...@PARTNERS.ORG>.
Hi there --

Thanks for your reply. I checked the error.log file, and I came across the
following entry:

[Tue Jan 04 11:08:34 2011] [alert] [client 132.183.12.230]
/var/www/logs/.htaccess: AuthUserFile takes 1-2 arguments, text file containing
user IDs and passwords.

I checked the .htaccess file, and it turns out there was a 'white space' in the
file that was causing the problem.
Once I removed that, the authentication worked. 

Thanks for the help.

 

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com] 
Sent: Tuesday, January 04, 2011 12:04 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Problem with setting up authentication on an Apache2
server

> When I restarted the computer, and tried to access the page in question, I
> was confronted with a 500 Internal Server Error message.

What does your error log say?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with setting up authentication on an Apache2 server

Posted by Eric Covener <co...@gmail.com>.
> When I restarted the computer, and tried to access the page in question, I
> was confronted with a 500 Internal Server Error message.

What does your error log say?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org