Los 8 pasos para instalar WordPress en tu propio ordenador

wordpress-phpmyadmin
Estos son los pasos que he seguido para instalar WordPress en local. Para ello necesitaremos tener un servidor, y mySQL para alojar la base de datos. Habitualmente suelo desarrollar los temas de WordPress en un servidor remoto, con la consecuente pérdida de tiempo que lleva tener que subir vía ftp o ssh los archivos para poder ver los cambios realizados. Ahora ya no necesito internet para desarrollar y probar temas. Algo básico, pero que no me había puesto a aprender hasta hoy.

Este manual ha sido realizado junto con @skotperez en Ubuntu 10.04 Lucid Lynx, aunque muchos de los pasos son igualmente válidos para Windows y Mac.

  1. Instalar apache 2 (in ubuntu, open a terminal and type “sudo apt-get install apache2”
  2. Instalar mySQL (sudo apt-get install mysql-server)
  3. Instalar phpMyAdmin (vía Ubuntu Software Center)
  4. Crear base de datos
    Hay dos caminos posibles:

    1. Desde phpMyAdmin:
      1. Puedes acceder a la base de datos vía phpMyAdmin en http://localhost/phpmyadmin
      2. Haz login con el usuario y contraseña con el que hayas configurado mySQL (en mi caso es la misma que la contraseña para mi usuario de ubuntu). En mi caso el usuario es root.
      3. Crea base de datos “Create new database“. Pon un nombre a tu base de datos. Collation y utf8 están bien como opciones por defecto
      4. Entra en la base de datos a través del menú de la izquierda y vete a la pestaña “privileges” para crear un usuario y contraseña.
    2. Desde mysql:
      1. Si el comando
        mysql no te funciona, prueba con
        mysql -h localhost -u root
      2. Una vez dentro de la consola de mysql:
        CREATE DATABASE sname_of_database;
        GRANT ALL PRIVILEGES ON name_of_database.*
        TO 'name_of_database'@'localhost'
        IDENTIFIED BY 'databasepassword';
        SHOW GRANTS FOR 'name_of_database'@'localhost';
      3. Puedes comprobar que la base de datos se ha creado con el comando:
        SHOW DATABASES;
      4. Sal de mysql con
        exit
  5. Descarga wordpress http://wordpress.org/download/ y descomprime el zip. En mi caso en la carpeta /home/numeroteca/wordpress
  6. Cambio el nombre de wp-config-sample.php por wp-config.php. Pongo los datos de la recién creada base de datos en el wp-config.php. Que quedará como:
    define('DB_NAME', 'name_of_database')
    define('DB_USER', 'name_of_database');
    define('DB_PASSWORD', 'databasepassword')
    define('DB_HOST', 'localhost');
  7. El directorio por defecto de apache es /var/www/
    Todo lo que hay en ese directorio es visible desde http://localhost. Para no tener que trasladar todos los archivos de wordpress a la carpeta /var/www/ (o a la carpeta /var/www/html) creamos una liga blanda (o enlace simbólico) desde allí:

    1. Navegamos hasta ahí /var/www/
      cd /var/www/ o cd /var/www/html
    2. Creamos liga blanda:
      ln -s /home/path/to/the_files/where/wordpress/files/are
      Por ejemplo
      ln -s /home/numeroteca/wordpress
      Probablemente tengas que usar sudo ln -s /home/numeroteca/wordpress, ya que necesitas permisos especiales para editar en ese directorio.
  8. Ahora si vas a http://localhost/wordpress podrás acceder al wordpress y realizar la instalación (si el wp-config.php está bien configurado).

Actualización 15 de marzo 2013: Si después de instalar worpdress añades carpetas al tema en que estás trabajando (me pasó añadiendo las carpetas de bootstrap a un tema), si estás no tienen los permisos necesario, el navegador no podrá leerlas. Asegúrate de darles permisos con: chmod a+rwx nombre-de-carpeta (lo vi en webtechquery.com)

Actualización 30 de marzo 2013: Esto de los permisos tiene más jugo. Para poder actualizar los plugins tienes que cambiar el propietario de los archivos de wordpress. (solución vía varios post, entre otros este).

Para saber quién es el propietario al que tienes que otorgarle los permisos, inserta  <?php echo(exec("whoami")); ?> en cualquiera de las páginas de wordpress.

Mira en el navegador a ver qué sale como resultado del echo “who I am”. En micaso es “www-data”. Por lo tanto deberás cambiar los el propietario de la carpeta donde tienes instalado el wordpess a “www-data” (change owner = chown):

sudo chown -hR www-data carpeta-donde-tienes-instalado-wordpress/*

[no lo he probado, pero probablemente no haga falta cambiar el propietario de todas carpetas de tu instalación de wordpress, sino solo unas pocas].
Esta acción cambiará el propietario detodos los archivos y carpetas, de forma que cuando vayas a editar tu tema de wordpress o el wp-config.php no te dejará salvarlo. Para eso tienes que otorgarte de nuevo la propiedad de esos archivos o carpetas utilizando el mismo método. Por ejemplo, para que el archivo wp-config.php vuelva a ser de tu propiedad (tu usuario de ubuntu, en mi caso “numeroteca”):

sudo chown -hR numeroteca wp-config.php

También puede funcionar añadir al wp-config.php la línea, como sugieren por ahí cuando no tienes acceso ftp, me funcionó en otra instalación:
define('FS_METHOD', 'direct');

How to automate Googlemaps image capture: urban development ruins in Spain

Josh Begley developed a script that outputs a list of googlemaps images given a list of locations (longitud and latitude needed). It runs in Processing and uses the Google Maps API. It was originally used to get aerial images of all the prisons in the USA. I thought it could be interesting to get googlemaps images from all the urban developments that were built and unfinished during the real estate bubble in Spain. I’ve opened a spreadsheet http://bit.ly/listapaus with a few of them to test the script.

This is a side project to the 6.000km map, a kind of wiki to collect info about urban metabolism in the era of the real estate bubble in Spain. Soon, we will have updated photos of some of these places, that we just took in Madrid with balloon mapping techniques.

Continue reading →

Repairing a kite’s stick with a fiber glass safety marker

I just left my first superminiresearch note in the Public Laboratory website.

One of the sticks from Dani’s kite was broken, so we substitute it with a fiber glass safety marker 72″, like this one, that Jeff Warren had given me.
It was easy to cut it with a saw, and to give its shape to make it fit in the kite.

 

I think it is a great way to make easy for users/supporters to provide ideas or feedback. As it is a “note” it looks easier to post something than if it were a “post”.

 

The collaboratively Rosetta Stone of Tools

Working in Basurama usually means working in different countries with different tools and waste materials. When we have to prepare those actions/workshops/installations, we have to send a list of the tools we’ll need. Even for Spanish speaking countries, names of tools could differ a lot. A trolley (or is it a dolly?) could be a carretilla if you are in Spain or a diablito if you are in Mexico.

To try to solve this problem, I’ve started a spreadsheet with photos and names of different tools and materials, that we usually use: http://bit.ly/toolstranslate
This spreadsheet could then feed other websites or be copy-pasted (and removed the columns that are not useful) to serve as a template for a tools request.

Everyone can edit it. Thanks for collaborating!

 

Comparing multiple year bar charts methods and embedding options

Here it is a comparison among different ways of making bar charts and embedding them in a wordpress blog. I’ve testing them for kulturometer.org, a project devoted to research the cultural budget that the city of Madrid is spending.
The data used: Once a year the Madrid city hall publishes a pdf with these data in a non reusable format. We’ve been extracting manually these numbers in the last 5 years and published them in a google spreadsheet (see the data set in csv format at the end of this post).

The idea of this post is to compare and review these 4 5 different methods.
Update: added gnumeric after Madeleine comment. It’s the simplest and more customizable method (though not intractive).

Google Spreadsheets

Advantages
Easy to upload data, and collaborate with others.
Easy to generate simple bar charts and embed them as images (as interactive script you may have some problems when embeding in a blog ).
No programming skills needed.

Drawbacks
Even now, that it is possible to customize a lot of the visualization, it is still not possible to change bar height (or width), for example.

Libre Office -> Inkscape

Advantages

  • No programming skills needed.
  • High customization possibilities.
  • Produces .svg code or .png images.

Drawbacks

  • Need basic inkscape knowledge.

D3

Advantages
High customization possibilities.
Produces .svg code ready for the web.
(Interactive possibilities, I haven’t explored them yet).

Drawbacks
Javascript knowledge needed.

Processing

Advantages
High design and interaction customization possibilities.
Produces .svg code ready for the web.

Drawbacks
Processing knowledge needed.
You’ll need to export it with Processing.js, that makes your visualization work using web standards and without any plug-ins.

Gnumeric

Advantages
No extra program needed.
Highly customizable: colors, ticks in axes, units, fonts.
Produces clean .svg

Drawbacks
No interactive graphic.

— Continue reading →

Three updates about PageOneX: How to Heroku, mail list and users start using

Three updates about the PageOneX: