Hi all
I'm trying to password-protect the access to the Proxmox web console with mod_auth. There are two possibilities which I've both tried but neither worked.
The first method is to use an .htaccess file in the pve-manager/root directory. The contents of that file are as follows:
"AllowOverride AuthConfig" is enabled in the corresponding Directory directive in the vhost config for the pve-manager.
This solution works so far as I'm prompted to enter a username and password but after that the Proxmox console breaks with the following error message:
I'm familiar with Perl but not with embperl. I had a look at the corresponding source and the line in question is the following:
$auth_type is declared a few lines earlier with the following statment:
Thus, the error message makes sense: $auth_type is supposed to be a reference but it isn't. It contains the string "Basic" as this is the authentication method I'm using. Perl then tries to use this string as the class name and invoke its method "key()" which, obviously, breaks as there is no class "Basic".
As I don't know what's going on under the hood there and I'm not at all familiar with embperl, I don't think I'll be able to fix this but maybe somebody else knows of a workaround.
On to the second method: You can also declare the AuthType directly in the vhost config. It then should look something like the following:
Oddly enough, this doesn't seem to do anything even though it should work (or break) exactly the same as the solution with the .htaccess file. I can access the site as if the AuthType configuration wasn't there.
The logs aren't too useful either. The only somewhat suspicious message is the following even though it doesn't seem to be connected with my problem:
I've been working for two days on this without success. Maybe someone can help me... 
TIA!
joran
I'm trying to password-protect the access to the Proxmox web console with mod_auth. There are two possibilities which I've both tried but neither worked.
The first method is to use an .htaccess file in the pve-manager/root directory. The contents of that file are as follows:
Code:
AuthType Basic
AuthName "Restricted Area"
AuthBasicProvider file
AuthUserFile /usr/share/pve-manager/pwd/passwords
Require valid-user
This solution works so far as I'm prompted to enter a username and password but after that the Proxmox console breaks with the following error message:
Code:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root and inform them of the time the error occurred, and anything you might have done that may have caused the error.
[13874]ERR: 24: Error in Perl code: Can't locate object method "key" via package "Basic" (perhaps you forgot to load "Basic"?) at /usr/share/pve-manager/root/base.epl line 30.
Code:
my $cookie = $auth_type->key ($req_rec);
Code:
my $auth_type = $req_rec->ap_auth_type;
As I don't know what's going on under the hood there and I'm not at all familiar with embperl, I don't think I'll be able to fix this but maybe somebody else knows of a workaround.
On to the second method: You can also declare the AuthType directly in the vhost config. It then should look something like the following:
Code:
<Directory /usr/share/pve-manager/root>
AuthType Basic
AuthName "Restricted Area"
AuthBasicProvider file
AuthUserFile /usr/share/pve-manager/pwd/passwords
Require valid-user
Options FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
allow from all
</Directory>
The logs aren't too useful either. The only somewhat suspicious message is the following even though it doesn't seem to be connected with my problem:
Code:
[Thu Feb 24 10:28:31 2011] [warn] The Alias directive in /etc/apache2/sites-enabled/pve.conf at line 45 will probably never match because it overlaps an earlier Alias.
[Thu Feb 24 10:28:31 2011] [warn] RSA server certificate CommonName (CN) `foo.eu' does NOT match server name!?

TIA!
joran