abril 12, 2013

LAMP en Chakra

MySQL/MariaDB

Instalación
pacman -S mysql
Iniciar el servicio y correrlo automácticamente al inicio
systemctl start mysqld
systemctl enable mysqld




APACHE

Instalación
pacman -S apache
Iniciar el servicio y correrlo automácticamente al inicio
systemctl start httpd
systemctl enable httpd
Para cambiar la ruta del servidor editar el archivo /etc/httpd/conf/httpd.conf y cambiar el /srv/http por la ruta que desees
DocumentRoot "/srv/http"
< Directory "/srv/http">
Para crear Virtual Hosts, primero se ha de descomentar en /etc/httpd/conf/httpd.conf
Include conf/extra/httpd-vhosts.conf
Luego añadir los Virtual Host que desees en /etc/httpd/conf/extra/httpd-vhosts.conf
<VirtualHost *:80> ServerName ejemplo DocumentRoot "/ruta/ejemplo" </VirtualHost>
finalmente agregar los hosts a /etc/hosts
127.0.0.1 ejemplo


PHP5

Instalacion
pacman -S php php-apache
Para activar PHP agregar la siguiente linea a /etc/httpd/conf/httpd.conf justo después de LoadModule dir_module modules/mod_dir.so
LoadModule php5_module modules/libphp5.so
Además agregar la siguiente linea a la lista de Includes
Include conf/extra/php5_module.conf
También verificar si TypesConfig conf/mime.types esta descomentado
Luego agregar la siguiente linea en /etc/httpd/conf/mime.types
application/x-httpd-php php php5
Ahora, si cambiaste el DocumentRoot diferente a /srv/http, entonces buscar el open_basedir en /etc/php/php.ini y dejarlo así:
open_basedir=/srv/http/:/home/:/tmp/:/usr/share/pear/:/path/to/documentroot
Ahora reiniciar APACHE
systemctl restart httpd

No hay comentarios:

Publicar un comentario