Mudanças entre as edições de "Roteiro de Instalação do Apache e SVN com autenticação NIS"

De LCAD
Ir para: navegação, pesquisa
(Configurando o Subversion)
(Configurando o Subversion)
Linha 103: Linha 103:
 
  #  SELinux
 
  #  SELinux
 
  #
 
  #
 
+
 
  #
 
  #
 
  # To create a new repository "http://localhost/repos/stuff" using
 
  # To create a new repository "http://localhost/repos/stuff" using

Edição das 13h28min de 14 de setembro de 2012

Objetivo desse roteiro

Este é um roteiro de como instalar o Apache (httpd), Mysql (mysqld) e Subversion com autenticação NIS para a LCAD 2 no LCAD.

Instalando os pacotes

Instale os pacotes necessários com o comando:

# yum install httpd php php-common mod_dav_svn subversion php-pecl-apc php-cli php-pear php-pdo php-mysql php-pgsql \
php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml mysql mysql-server \
mysql-workbench perl-ExtUtils-AutoInstall

Após instalar todos vamos configurar o Mysql

Configurando o Mysql

Execute na linha de comando:

# systemctl start mysqld.service
# systemctl enable mysqld.service

Logo após digite:

# mysql -u root -p

Entre com a nova senha de root.

Configurando o Apache (htttpd)

Edite o arquivo /etc/httpd/conf/httpd.conf

# vim /etc/httpd/conf/htttpd.conf

Na linha 261 que contém ServerAdmin, coloque:

ServerAdmin suporte@lcad.inf.ufes.br

Na linha 275 que contém ServerName, coloque:

ServerName www.lcad.inf.ufes.br

Na linha 365 que contém Userdir disabled, coloque:

Userdir enabled

Descomente a linha 372, ficando assim:

UserDir public_html

Apague as linhas de 380 até 391 e coloque:

<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes +FollowSymLinks Includes
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>

Na linha 401, adicione index.php, ficando assim:

DirectoryIndex index.php index.html index.html.var

Ao final do arquivo adicione para o log:

#Alias for the log files
Alias /log log

<Direcotory /log>
         Options +Indexes
         IndexIgnore *.html lost+found
         DirectoryIndex disabled
</Directory>

php_flag display_startup_erros off
php_flag display_errors off
php_flag html_errors off

Agora vamos iniciar o Apache e permitir sua inicialização automática:

# systemctl start httpd.service
# systemctl enable httpd.service

Configurando o Subversion

Baixe o arquivo [Net-NIS]. Instale usando os comandos:

tar xzf Net-NIS-0.34.tar.gz
cd Net-NIS-0.34/
perl Makefile.PL
make
make install

Baixe o arquivo [Apache2-AuthenNIS]. Instale usando os comandos:

tar xzf Apache2-AuthenNIS-0.15.tar.gz
cd Apache2-AuthenNIS-0.15
perl Makefile.PL
make
make install

Crie o arquivo /etc/httpd/conf.d/subversion.conf e coloque o conteúdo:

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
#PerlLoadModule Apache::AuthenNIS
#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn".  Each repository
# must be both:
#
#   a) readable and writable by the 'apache' user, and
#
#   b) labelled with the 'httpd_sys_content_t' context if using
#   SELinux
#

#
# To create a new repository "http://localhost/repos/stuff" using
# this configuration, run as root:
#
#   # cd /var/www/svn
#   # svnadmin create stuff   
#   # chown -R apache.apache stuff
#   # chcon -R -t httpd_sys_content_t stuff
#

<Location /svn>
       Order allow,deny
       Deny from all
       DAV svn
       SVNParentPath /var/www/svn/
       AuthName "LCAD Subversion repository"
       AuthType Basic
       Satisfy any
       PerlAuthenHandler Apache2::AuthenNIS
       PerlSetVar AllowAlternateAuth no
       #PerlAuthzHandler Apache::AuthzNIS
       Require valid-user
       AuthzSVNAccessFile /var/www/svn/accessvn
</Location>

Importando o banco de dados

Colocando os arquivos no /var/www/html/

Colocando o hd do log

Importando o SVN

Caso algo de errado

Procure na internet, especialmente: