Agregar sitio en mi LAMP local de desarrollo

sudo su

cd /etc/apache2/sites-available/

cp default domain.lh

vi domain.lh
ServerAdmin noreply@domain.lh
ServerName domain.lh
ServerAlias www.domain.lh
DocumentRoot /srv/www/domain.lh/httpdocs/
ErrorLog /srv/www/domain.lh/logs/error.log
CustomLog /srv/www/domain.lh/logs/access.log combined
sudo a2ensite domain.lh

vi /etc/hosts
127.0.1.1 domain.lh
127.0.1.1 www.domain.lh
cd /srv/www;
mkdir domain.lh;
cd domain.lh;
mkdir httpdocs logs;
chown -R aptana:aptana httpdocs

/etc/init.d/apache2 reload
/etc/init.d/apache2 restart
mysql -h localhost -u root -p
CREATE DATABASE {DATABASE_NAME};

GRANT ALL PRIVILEGES ON {DATABASE_NAME}.* TO '{USER}'@'{HOST}' IDENTIFIED BY '{PASSWORD}';

FLUSH PRIVILEGES;

mysql -u {USER} -p {DATABASE_NAME} < backup.sql

Para algunas instalaciones de WordPress

mysql -u {USER} -p {DATABASE_NAME}

USE {DATABASE_NAME};

“Vanilla Installation” desde cero

wget http://wordpress.org/latest.tar.gz

tar -xvzpf latest.tar.gz --strip-components=1

De desarrollo a producción

UPDATE mch_options SET option_value = replace(option_value, 'http://www.domain.com', 'http://www.domain.lh') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE mch_posts SET guid = replace(guid, 'http://www.domain.com','http://www.domain.lh');

UPDATE mch_posts SET post_content = replace(post_content, 'http://www.domain.com', 'http://www.domain.lh');

UPDATE mch_users SET user_url = replace(user_url, 'http://www.domain.com', 'http://www.domain.lh');