16
Instalando Apache2 no Debian:
1 | Debian 4.0 : # apt-get -y install apache2 |
Instalando Apache2 + PHP5:
1 | Debian 4.0 : # apt-get -y install libapache2-mod-php5 php5-cli php5-common php5-cgi |
Iniciando Apache:
1 | Debian 4.0 : # /etc/init.d/apache2 start |
Parando Apache:
1 | Debian 4.0 : # /etc/init.d/apache2 stop |
Reiniciando Apache:
1 | Debian 4.0 : # /etc/init.d/apache2 restart |
Habilitando Módulos no Apache2:
1 2 3 4 | Debian 4.0 : # a2enmod Which module would you like to enable? Your choices are: actions alias asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authnz_ldap authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta cgid cgi charset_lite dav_fs dav dav_lock dbd deflate dir disk_cache dump_io env expires ext_filter file_cache filter headers ident imagemap include info ldap log_forensic mem_cache mime mime_magic negotiation php5 proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy rewrite setenvif speling ssl status suexec unique_id userdir usertrack version vhost_alias Module name? |
** Após habilitar algum módulo é necessário reiniciar o apache **
Desabilitando Módulos no Apache2:
1 2 3 4 | Debian 4.0 : # a2dismod Which module would you like to disable? Your choices are: alias auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex cgi dir env mime negotiation php5 setenvif status Module name? |
** Após desabilitar algum módulo é necessário reiniciar o apache **
Instalando MySQL5:
1 | Debian 4.0 : # apt-get -y install mysql-common mysql-server mysql-server-5.0 |
Definindo senha de root para o MySQL:
1 | Debian 4.0 : # mysqladmin -u root -p password 'definir_senha_para_root' |
Criando Banco de dados:
1 2 | Debian 4.0 : # mysqladmin -p create nome_do_banco_de_dados Enter password: |
Definindo novo usuário e garantindo permissões:
1 2 3 4 5 6 | mysql -u root -p Enter Password: ***** mysql> create user 'NovoUsuario'@localhost identified by 'Password'; mysql> GRANT ALL PRIVILEGES ON </i><i>nome_do_banco_de_dados . * TO NovoUsuario@'localhost'; mysql> FLUSH PRIVILEGES; mysql> quit |
Instalando Adodb:
1 | Debian 4.0 : # apt-get -y install libphp-adodb |
Reiniciando Apache para que todas as mudanças entrem em vigor:
1 | Debian 4.0 : # /etc/init.d/apache2 restart |
Testando php:
1 2 | Debian 4.0 : # echo "<?php phpinfo(); ?>" >> /var/www/teste.php agora é só escolher o seu navegador e abrir http://localhost/teste.php ou ip_do_seu_servidor/teste.php |
abraço,
t++