Apache-SecSess
view release on metacpan or search on metacpan
or die "Cannot connect to Postgres: $DBI::errstr.";
#
# populate tables
#
## groups
$gsth = $dbh->prepare(<<'ENDSQL');
INSERT INTO groups VALUES (?, ?)
ENDSQL
for $gid (keys %groups) {
$gsth->execute($gid, $dbh->quote($groups{$gid}));
}
## authen-methods
$asth = $dbh->prepare(<<'ENDSQL');
INSERT INTO authens VALUES (?, ?, ?)
ENDSQL
for $aid (keys %authens) {
$asth->execute($aid, $dbh->quote($authens{$aid}[0]), $authens{$aid}[1]);
}
$urec = $users{$uid};
## add user record to users
$defgrp = $urec->{group};
if ($groups{$defgrp}) { die "Default group for user '$uid' in use.\n"; }
$usth->execute($uid, quote($urec->{name}), $defgrp, 'enabled', time);
## process default group in groups and usergroup tables
$gsth->execute($uid, "Default group: $defgrp");
$ugsth->execute($uid, $defgrp);
## process other group memberships
if (defined($gref = $urec->{groups})) {
for $gid (@{$gref}) {
$ugsth->execute($uid, $gid);
}
}
## process authentication methods
for $auth (keys %authens) {
next unless $urec->{$auth};
$uasth->execute($uid, $auth, quote($urec->{$auth}), 0);
}
}
#
demo/httpdconf/httpd.sec2.conf view on Meta::CPAN
</IfDefine>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# . On SCO (ODT 3) use "User nouser" and "Group nogroup".
# . On HPUX you may not be able to use shared memory as nobody, and the
# suggested workaround is to create a user www and use that user.
# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
# when the value of (unsigned)Group is above 60000;
# don't use Group nobody on these systems!
#
User nobody
Group nobody
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents.
( run in 0.913 second using v1.01-cache-2.11-cpan-5735350b133 )