Mudanças entre as edições de "Autenticação no Apache pelo NIS"
(28 revisões intermediárias por 2 usuários não estão sendo mostradas) | |||
Linha 1: | Linha 1: | ||
− | + | [[category:Instalação]] | |
+ | __TOC__ | ||
+ | ===Pacotes Necessários=== | ||
+ | ---- | ||
+ | Para realizar a Autenticação no Apache pelo NIS, os seguintes pacotes devem ser instalados: | ||
+ | :*Apache 2.2; | ||
+ | :*perl-ExtUtils-AutoInstall; | ||
+ | :*mod_perl; | ||
+ | :*perl-Net-NIS; | ||
+ | :*Apache-AuthenNIS; | ||
+ | :*Apache-AuthZNIS; | ||
− | + | Os pacotes '''perl-Net-NIS''', '''Apache-AuthenNIS''', '''Apache-AuthZNIS''' e os arquivos '''AuthenNIS''' e '''AuthzNIS''' estão no ''/root/apache+nis/'' da lcad10. | |
− | perl-Net-NIS | ||
− | |||
− | |||
− | |||
− | |||
− | Apache- | + | ===Apache 2.2=== |
− | + | ---- | |
− | + | Na distribuiçao Fedora Core 6 o Apache 2.2 é instalado durante a instalação dessa distruibuição. Enventuais dúvidas sobre a instalação consulte o [http://httpd.apache.org/ Apache HTTP]. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ===perl-ExtUtils=== | ||
+ | ---- | ||
+ | Digite no terminal: | ||
+ | yum install perl-ExtUtils-AutoInstall.noarch | ||
− | + | ===mod_perl=== | |
+ | ---- | ||
+ | Digite no terminal: | ||
+ | yum install mod_perl | ||
− | + | ===perl-Net-NIS=== | |
− | cd Apache-AuthZNIS-0.11 | + | ---- |
− | perl Makefile.PL | + | Digite no terminal: |
− | make | + | |
− | make install | + | tar -xzvf Net-NIS-0.34.tar.gz |
− | Substitua o arquivo AuthezNIS.pm em /usr/lib/perl5/site_perl/5.8.8/Apache/ por | + | cd Net-NIS-0.34/ |
+ | perl Makefile.PL | ||
+ | make | ||
+ | make install | ||
+ | |||
+ | ===Apache-AuthenNIS=== | ||
+ | ---- | ||
+ | O Apache-AuthenNIS é utilizado para autenticar usuários do NIS. Digite no terminal: | ||
+ | |||
+ | tar -xzvf Apache-AuthenNIS-0.13.tar.gz | ||
+ | cd Apache-AuthenNIS-0.13 | ||
+ | perl Makefile.PL | ||
+ | |||
+ | **************** NOTICE ********************* | ||
+ | If you are planning to use mod_perl2 and Apache2, please, do not | ||
+ | answer yes when prompted to install mod_perl. You will need to | ||
+ | download mod_perl2 manually from | ||
+ | http://perl.apache.org/download/index.html | ||
+ | ********************************************* | ||
+ | *** ExtUtils::AutoInstall version 0.63 | ||
+ | *** Checking for dependencies... | ||
+ | [Core Features] | ||
+ | - Net::NIS ...loaded. (0.34) | ||
+ | - mod_perl ...missing. | ||
+ | ==> Auto-install the 1 mandatory module(s) from CPAN? [y] '''n''' | ||
+ | ==> The module(s) are mandatory! Really skip? [n] '''y''' | ||
+ | *** ExtUtils::AutoInstall configuration finished. | ||
+ | Checking if your kit is complete... | ||
+ | Looks good | ||
+ | Writing Makefile for Apache::AuthenNIS | ||
+ | |||
+ | make | ||
+ | make install | ||
+ | |||
+ | Substitua o arquivo AuthenNIS.pm em ''/usr/lib/perl5/site_perl/5.8.8/Apache/'' pelo arquivo localizado no diretório apache+nis. | ||
+ | |||
+ | Para verificar o pacote foi instalado, dentro do diretório de instalação existe um arquivo chamado test.pl. Digite no terminal | ||
+ | perl test.pl | ||
+ | |||
+ | O pacote foi instalado com sucesso se aparecer no terminal a seguinte resposta: | ||
+ | 1..1 | ||
+ | ok 1 | ||
+ | |||
+ | ===Apache-AuthZNIS=== | ||
+ | ---- | ||
+ | O Apache-AuthZNIS é utilizado para autenticar grupos de usuários no NIS. Digite no terminal: | ||
+ | |||
+ | tar -xzvf Apache-AuthZNIS-0.11.tar.gz | ||
+ | cd Apache-AuthZNIS-0.11 | ||
+ | perl Makefile.PL | ||
+ | make | ||
+ | make install | ||
+ | |||
+ | Substitua o arquivo AuthezNIS.pm em ''/usr/lib/perl5/site_perl/5.8.8/Apache/'' pelo arquivo localizado no diretório apache+nis. | ||
+ | |||
+ | Para verificar o pacote foi instalado, dentro do diretório de instalação existe um arquivo chamado test.pl. Digite no terminal | ||
+ | perl test.pl | ||
+ | |||
+ | O pacote foi instalado com sucesso se aparecer no terminal a seguinte resposta: | ||
+ | 1..1 | ||
+ | ok 1 | ||
+ | |||
+ | ===Apache http.conf=== | ||
+ | ---- | ||
+ | Para indicar ao Apache que realizará a autenticação de usuários pelo NIS, deve-se editar o arquivo httpd.conf localizado em ''/etc/httpd/conf/''. Insira as seguintes linhas nesse arquivo após a tag ''<Location /server-status> ... </Location>'': | ||
+ | |||
+ | <Location /repos> | ||
+ | Order allow,deny | ||
+ | Deny from all | ||
+ | AuthName "Subversion repository" | ||
+ | AuthType Basic | ||
+ | Satisfy any | ||
+ | PerlAuthenHandler Apache::AuthenNIS | ||
+ | PerlSetVar AllowAlternateAuth no | ||
+ | PerlAuthzHandler Apache::AuthzNIS | ||
+ | Require group CVS | ||
+ | </Location> | ||
+ | |||
+ | O nome ''/repos'' indica para o Apache realizar a autenticação quando o usuário acessar essa localização pela Web. | ||
+ | |||
+ | Na linha ''Require group CVS'' substitua o grupo ''CVS'' pelo grupo que deseja autenticar. Caso queira autenticar por usuário substitua a linha ''Require group CVS'' por ''Require user login_usuario login_usuário''. Para autenticar qualquer usuário substitua a linha ''Require group CVS'' por ''Require valid-user''. | ||
+ | |||
+ | ===Repositório SVN=== | ||
+ | ---- | ||
+ | Para o Apache validar os usuários que devem acessar os repositórios do SVN, insira as seguintes linhas no arquivo httpd.conf: | ||
+ | |||
+ | <Location /svn> | ||
+ | Order allow,deny | ||
+ | Deny from all | ||
+ | DAV svn | ||
+ | SVNParentPath /var/www/svn/ | ||
+ | AuthName "Subversion repository" | ||
+ | AuthType Basic | ||
+ | Satisfy any | ||
+ | PerlAuthenHandler Apache::AuthenNIS | ||
+ | PerlSetVar AllowAlternateAuth no | ||
+ | PerlAuthzHandler Apache::AuthzNIS | ||
+ | Require valid-user | ||
+ | AuthzSVNAccessFile /var/www/svn/accessvn | ||
+ | </Location> |
Edição atual tal como às 11h04min de 18 de fevereiro de 2008
Índice
Pacotes Necessários
Para realizar a Autenticação no Apache pelo NIS, os seguintes pacotes devem ser instalados:
- Apache 2.2;
- perl-ExtUtils-AutoInstall;
- mod_perl;
- perl-Net-NIS;
- Apache-AuthenNIS;
- Apache-AuthZNIS;
Os pacotes perl-Net-NIS, Apache-AuthenNIS, Apache-AuthZNIS e os arquivos AuthenNIS e AuthzNIS estão no /root/apache+nis/ da lcad10.
Apache 2.2
Na distribuiçao Fedora Core 6 o Apache 2.2 é instalado durante a instalação dessa distruibuição. Enventuais dúvidas sobre a instalação consulte o Apache HTTP.
perl-ExtUtils
Digite no terminal:
yum install perl-ExtUtils-AutoInstall.noarch
mod_perl
Digite no terminal:
yum install mod_perl
perl-Net-NIS
Digite no terminal:
tar -xzvf Net-NIS-0.34.tar.gz cd Net-NIS-0.34/ perl Makefile.PL make make install
Apache-AuthenNIS
O Apache-AuthenNIS é utilizado para autenticar usuários do NIS. Digite no terminal:
tar -xzvf Apache-AuthenNIS-0.13.tar.gz cd Apache-AuthenNIS-0.13 perl Makefile.PL
**************** NOTICE ********************* If you are planning to use mod_perl2 and Apache2, please, do not answer yes when prompted to install mod_perl. You will need to download mod_perl2 manually from http://perl.apache.org/download/index.html ********************************************* *** ExtUtils::AutoInstall version 0.63 *** Checking for dependencies... [Core Features] - Net::NIS ...loaded. (0.34) - mod_perl ...missing. ==> Auto-install the 1 mandatory module(s) from CPAN? [y] n ==> The module(s) are mandatory! Really skip? [n] y *** ExtUtils::AutoInstall configuration finished. Checking if your kit is complete... Looks good Writing Makefile for Apache::AuthenNIS
make make install
Substitua o arquivo AuthenNIS.pm em /usr/lib/perl5/site_perl/5.8.8/Apache/ pelo arquivo localizado no diretório apache+nis.
Para verificar o pacote foi instalado, dentro do diretório de instalação existe um arquivo chamado test.pl. Digite no terminal
perl test.pl
O pacote foi instalado com sucesso se aparecer no terminal a seguinte resposta:
1..1 ok 1
Apache-AuthZNIS
O Apache-AuthZNIS é utilizado para autenticar grupos de usuários no NIS. Digite no terminal:
tar -xzvf Apache-AuthZNIS-0.11.tar.gz cd Apache-AuthZNIS-0.11 perl Makefile.PL make make install
Substitua o arquivo AuthezNIS.pm em /usr/lib/perl5/site_perl/5.8.8/Apache/ pelo arquivo localizado no diretório apache+nis.
Para verificar o pacote foi instalado, dentro do diretório de instalação existe um arquivo chamado test.pl. Digite no terminal
perl test.pl
O pacote foi instalado com sucesso se aparecer no terminal a seguinte resposta:
1..1 ok 1
Apache http.conf
Para indicar ao Apache que realizará a autenticação de usuários pelo NIS, deve-se editar o arquivo httpd.conf localizado em /etc/httpd/conf/. Insira as seguintes linhas nesse arquivo após a tag <Location /server-status> ... </Location>:
<Location /repos> Order allow,deny Deny from all AuthName "Subversion repository" AuthType Basic Satisfy any PerlAuthenHandler Apache::AuthenNIS PerlSetVar AllowAlternateAuth no PerlAuthzHandler Apache::AuthzNIS Require group CVS </Location>
O nome /repos indica para o Apache realizar a autenticação quando o usuário acessar essa localização pela Web.
Na linha Require group CVS substitua o grupo CVS pelo grupo que deseja autenticar. Caso queira autenticar por usuário substitua a linha Require group CVS por Require user login_usuario login_usuário. Para autenticar qualquer usuário substitua a linha Require group CVS por Require valid-user.
Repositório SVN
Para o Apache validar os usuários que devem acessar os repositórios do SVN, insira as seguintes linhas no arquivo httpd.conf:
<Location /svn> Order allow,deny Deny from all DAV svn SVNParentPath /var/www/svn/ AuthName "Subversion repository" AuthType Basic Satisfy any PerlAuthenHandler Apache::AuthenNIS PerlSetVar AllowAlternateAuth no PerlAuthzHandler Apache::AuthzNIS Require valid-user AuthzSVNAccessFile /var/www/svn/accessvn </Location>