Monday, June 13, 2011

How to Install Wordpress 3

Prerequisites:
-Apache
-MySQL

1) Proceed to Create your MySQL Database
sudo mysql -uroot -p
>create database wordpress;
>quit
2) Create you Wordpress Virtualhost
sudo pico /etc/hosts
Insert:
127.0.0.1   wordpress

sudo pico /path/to/apache2/conf/extra/httpd-vhosts.conf
Insert:

<virtualhost *:80>
   DocumentRoot "/path/to/wordpress"
   ServerName wordpress
   <directory path="" to="" wordpress="">
     Allow from all
   </directory>
</virtualhost>   


To activate this newly created Virtualhost you need to Restart Apache
3) Download Wordpress, Unzip it
cd /path/to
wget http://wordpress.org/latest.zip
sudo unzip wordpress*zip
4) Give it the Right Permissions
To set permissions for Directories:
sudo find /path/to/wordpress -type d | xargs chmod 755
To set permissions for Files:
sudo find /path/to/wordpress -type f -exec chmod 744 {} \;
5) Generate yours API Keys
Open a Browser's Window and type in the Address:
http://api.wordpress.org/secret-key/1.1/
Copy all the Output Given in the Window.
6) Create and Edit your Configuration script
cd wordpress
sudo mv wp-config-sample.php wp-config.php
Next you need to Edit wp-config.php
Select the lines containing:
define('AUTH_KEY',        'Abracadabra1');
define('SECURE_AUTH_KEY', 'Abracadabra2');
define('LOGGED_IN_KEY',   'Abracadabra3');
define('NONCE_KEY',       'Abracadabra4');

Paste in the API's Keys of Step 5);

Next you Need to Substitute the Right Values for:
define('DB_NAME', 'yourDBName');
define('DB_USER', 'yourDBUser');
define('DB_PASSWORD', 'yourDBPass');
define('DB_HOST', 'yourHostName');


Save.

7) Start Wordpress Installation
Open a Browser's Window and type in the Address:
http://wordpress


Good Luck!

How to set permissions in Wordpress

To set permissions for Directories:
sudo find /path/to/wordpress -type d | xargs chmod 755
To set permissions for Files:
sudo find /path/to/wordpress -type f -exec chmod 744 {} \;

Tuesday, June 7, 2011

How to Reset Wordpress URL

If you have changed you URL and you can't access any more your site:

1) Edit wp-login.php
Just after the line "require( dirname(__FILE__) . '/wp-load.php' );"
Insert:
//FIXME: do comment/remove these hack lines. (once the database is updated)
  update_option('siteurl', 'YourFirstURL' );
  update_option('home', 'YourFirstURL' );
  

2) Edit index.php to Default

Now you can open on a Browser your First Wordpress URL.

After you need to Remove the lines inserted in wp-login.php

Got it from here:Codex