|
Localhost con Slackware 12.0
Publicado el: 04-25-2008 @ 11:02 am
Como siempre hago, cuando encuentro dificlutades en alguna cosa hago un mini HOWTO para compartir experiencias con otros usuarios. Mi ultimo reto era hacer funcionar un localhost. En este caso uso: - Slacware 12.0
- Apache
- MySQL
- PHP
- phpMyAdmin
Slackware ya lleva Apache MySQL y PHP instalados, por lo tanto no tendremos muchas dificultades. Lo primero que haremos si no lo hicimos en el momento de la instalación es dar permisos de ejecución a los scripts de arranque de Apache y de MySQL. # chmod 755 /etc/rc.d/rc.httpd # chmod 755 /etc/rc.d/rc.mysqld
Aquí un pequeño tutorial sobre los permisos Con esto hemos hecho que se ejecuten Apache y MySQL cada vez que iniciamos el sistema. Vamos a probarlo. Reiniciamos el sistema, abrimos un navegador ( Konqueror, Firefox, SeaMonkey, Opera...) y escribimos en la barra de direcciones localhost. Tendría que salir una pagina como esta:  Si funciona seguimos, si no funciona repasa los pasos anteriores. Ahora si guardamos un archivo PHP en /var/www/htdocs y lo intentamos ver con el navegador, veremos el codigo fuente del PHP, no su contenido. Vamos a arreglarlo. Con el editor de textos que más nos guste, abrimos el archivo /etc/httpd/mod_php.conf Y lo dejamos igual que el que os copio aquí: # # mod_php - PHP Hypertext Preprocessor module #
# Load the PHP module: LoadModule php5_module lib/httpd/modules/libphp5.so
# Tell Apache to feed all *.php files through PHP. If you'd like to # parse PHP embedded in files with different extensions, comment out # this line and see the example below. AddType application/x-httpd-php .php
# Tell Apache to feed all *.php, *.html, and *.htm files through # the PHP module. Add or subtract extensions here as desired. Please # note that running pages through PHP for no reason can be both slow # and insecure, so be sure to know what you're doing. It's a convenient # shortcut, but probably isn't suitible for high-traffic sites if you # write any of your pages in straight HTML. AddType application/x-httpd-php .php .html .htm
# This will display PHP files in colored syntax form. Use with caution. AddType application/x-httpd-php-source .phps Lo que he marcado en negrita es lo que hay que cambiar, vereis que seguramente tiene un # delante y tendremos que quitarselo. Una vez hecho esto, reiniciamos el sistema y provamos otra vez de abrir un PHP en el navegador. ¡¡Funciona eh!! Bien ahora si quieres hacer cosas con phpNuke o con phpBB o alguna herramienta de este tipo, te pedirá que crees una Base de Datos. Para esto lo más simple es instalar phpMyAdmin.
Ultima actualización el 04-25-2008 @ 11:09 am
|