Libmcrypt, mcrypt e PHP
Vamos a pasta pacotes:
# cd /pacotes
1. Baixe o Libmcrypt 2.5.8:
# wget http://ufpr.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.bz2
2. Descompactando e Compilando:
# tar -vxjpf libmcrypt-2.5.8.tar.bz2
# cd libmcrypt-2.5.8
# ./configure
# make
# make install
# ldconfig
3. Volte a pasta pacotes:
# cd ..
Baixe o Mcrypt 2.6.8:
# wget http://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz/download
4. Descompactando e Compilando:
# tar zxvf mcrypt-2.6.8.tar.gz
# cd mcrypt-2.6.8
# ./configure
# make
# make install
5. Volte a pasta pacotes
# cd ..
6. Baixe o PHP:
# wget http://br2.php.net/get/php-5.3.6.tar.gz/from/this/mirror
7. Descompactando e Compilando
# tar zxvf php-5.3.6.tar.gz
# cd php-5.3.6
# ./configure --with-apxs2=/etc/apache/bin/apxs --prefix=/etc/php5 --with-mysql \
--with-gettext --with-pear --with-iconv --with-gd --with-openssl ---with-mhash \
--enable-ftp --with-mcrypt=/usr
# make
# make install
8. Copie o arquivo
php.ini-development para "/etc/php5/lib" e renomeie-o para
php.ini:
# cp php.ini-development /etc/php5/lib
# mv /etc/php5/lib/php.ini-development /etc/php5/lib/php.ini
9. Agora edite o
/etc/php5/lib/php.ini alterando por volta da linha 691,1, vai estar Off, deixe On:
register_globals = On
Salve e feche o arquivo.
10. Verifique no arquivo
/etc/apache/conf/httpd.conf se temos as seguintes linhas:
LoadModule php5_module modules/libphp5.so
<- (Por volta da linha 53,1)
AddType application/x-httpd-php .php .phtml
<- (Adicione por volta da linha 310,1)
DirectoryIndex index.html index.htm index.php
<- ( Por volta da linha 167,1)
Salve e feche o arquivo.
11. Reinicie o Apache:
# apachectl stop
# apachectl start
12. Teste o PHP:
Crie dentro de "/etc/apache/htdocs" um arquivo
info.php com seguintes linhas:
<?php phpinfo(); ?>
Salve e feche o arquivo.
Vá no navegador e digite
http://ip_servidor/info.php, se aparecer informações do php, esta ok!
Proftp
Configurando o proftpd, pois já vem por padrão no Slackware:
1. Para ficar mais fácil crie o arquivo "/etc/rc.d/rc.proftpd" e adicione o script:
#!/bin/sh
# Start/stop/restart the ProFTPD server:
case "$1" in
'start')
proftpd
;;
'stop')
killall proftpd
;;
'restart')
killall proftpd
proftpd
;;
*)
echo "usage $0 start|stop|restart"
esac
2. Atribuir a permissão de execução no "rc.proftpd" e crie os links simbólicos para iniciar o servidor durante o boot:
# chmod +x /etc/rc.d/rc.proftpd
# ln -s /etc/rc.d/rc.proftpd /etc/rc.d/rc0.d/K06proftpd
# ln -s /etc/rc.d/rc.proftpd /etc/rc.d/rc1.d/K06proftpd
# ln -s /etc/rc.d/rc.proftpd /etc/rc.d/rc2.d/K06proftpd
# ln -s /etc/rc.d/rc.proftpd /etc/rc.d/rc6.d/K06proftpd
# ln -s /etc/rc.d/rc.proftpd /etc/rc.d/rc3.d/S94proftpd
# ln -s /etc/rc.d/rc.proftpd /etc/rc.d/rc4.d/S94proftpd
# ln -s /etc/rc.d/rc.proftpd /etc/rc.d/rc5.d/S94proftpd
3. Edite o arquivo proftpd:
# vi /etc/proftpd.conf
4. Deixa as configurações da seguinte maneira:
ServerName "FTP CACIC"
ServerIdent on "Bem-vindo ao FTP"
ServerAdmin root@localhost
ServerType standalone
#ServerType inetd
DefaultRoot ~
DefaultServer on
Port 21
Umask 022
MaxInstances 30
MaxClients 20
MaxClientsPerHost 4
User nobody
Group nogroup
SystemLog /var/log/proftpd.log
TransferLog /var/log/xferlog
<Directory /*>
AllowOverwrite on
</Directory>
5. Aproximadamente da linha 50 a 82 comente tudo:
#<Anonymous ~ftp>
...
#</Anonymous>
Salve e feche o arquivo.
6. Crie um usuário cacic:
# adduser cacic
Obs.: Se for "useradd" não dá certo!
7. Startar o Proftp:
# proftp &
8. Teste a conexão:
# ftp ip_servidor
Vai ser mais ou menos assim :
logando...
ftp localhost
Connected to localhost.
220 Bem-vindo ao Servidor FTP
Name (localhost:root): usuario
331 Password required for usuario
Password: senha
230 User usuario logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
9. Crie uma pasta agente dentro do ftp:
ftp>
mkd agentes
ftp>
exit <- ( para sair)