Friday, April 27, 2007

Wordpress 2.1 in Windows based Web Server

nstall a Wordpress 2.1 in Windows Based WEB Server

Requirements

* Apache 2.0, 2.2
* PHP 4.4, 5.1
* MySQL 4.0, 4.1, 5.0

In my case I'm using Apache2triad installed in e:\apache2triad\

Download

Package(latest version) : http://wordpress.org/latest.zip

Our Configuration

* Apache's path : e:\apache2triad\bin
* MySQL's path : e:\apache2triad\mysql
* Webroot : e:\apache2triad\htdocs\
* Install to : e:\apache2triad\htdocs\wordpress
[note that WordPress will be placed outside of Apache's webroot for
security reasons]
* DIR to URL Alias : 'e:\apache2triad\htdocs\wordpress\' > '\blog\'
* URL access to WordPress : http://localhost/blog/

* WordPress MySQL info...
o database name : wordpress
o database's username : wpuser
o database's username password : dbpassword
[note to substitute each occurrence of this password under this
Guide, for your own alternative]

Notes

WordPress uses PHP functions defined under extension 'php_mysql'
[mysql_connect()], vs. the newer PHP v5 extension 'php_mysqli'
[mysqli_connect()], to connect to MySQL -- make sure that under php.ini, PHP
extension 'php_mysql.dll' is present and uncommented (under PHP
v4, 'php_mysql.dll' support is built in).

MySQL 4.1/5.0 in combination with PHP's extension 'php_mysql.dll' [the only
PHP MySQL extension WordPress supports] can only use the older MySQL v4.0
hashing method for password authentication and will require the use of
MySQL's 'old_password()' function to set the password for the user of the
WordPress database.
Basic Setup
Place Files

Unpack directory 'wordpress' from file 'latest.zip', move under directory 'e:
\apache2triad\htdocs'.
Configure 'wp-config.php'

Edit file 'e:\apache2triad\htdocs\wordpress\wp-config.php', update the
following fields...

* define('DB_NAME', 'wordpress');
* define('DB_USER', 'wpuser');
* define('DB_PASSWORD', 'dbpassword');
[note password 'dbpassword' -- substitute in selected alternative]
* define('DB_HOST', 'localhost');

Configure PHP

Note that php extension 'php_mysql' is built in by default under PHP v4; no
need to uncomment or insert anything.

Edit PHP's configuration file 'php.ini', which is usually located under the
system's 'C:\Winnt' [Windows 2000] or C:\Windows [Windows XP] directory...

Uncomment line...
extension=php_mysql.dll

Create WordPress MySQL Database and User

Access the MySQL shell...
e:\apache2triad\mysql\bin> mysql -u <user> -p<password>
[note that there is no space between '-p' and 'password', and that
characters '<' and '>' are not typed]
[note that if password for MySQL user 'root' has not been set; leave
out '-p<password>']

Create database 'wordpress' (main database which will hold all tables)...
mysql> CREATE DATABASE wordpress;

Create secured account with user 'wpuser' and password 'dbpassword' (secured
account -- only accessible from 'localhost', access permitted only to
database 'wordpress', only needed privileges granted)...

If using MySQL v4.1 or v5.0

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost' IDENTIFIED
BY 'dbpassword';
mysql> SET PASSWORD FOR 'wpuser'@'localhost' = OLD_PASSWORD('dbpassword');
[note password 'dbpassword' -- substitute in selected alternative]

If using MySQL v4.0

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost' IDENTIFIED
BY 'dbpassword'; [note password 'dbpassword' -- substitute in selected
alternative]

Flush privileges and exit...

* mysql> FLUSH PRIVILEGES;
* mysql> quit;

Configuration for Apache2 httpd.conf

Edit file 'e:apache2triad\conf\httpd.conf', insert line...

Alias /blog/ "e:\apache2triad\htdocs\wordpress/"
<Directory "e:/apache2triad/htdocs/wordpress">
order allow,deny
allow from all
Options FollowSymLinks
AllowOverride FileInfo

AddType text/html .php
AddHandler application/x-httpd-php .php
</Directory>


Restart Apache

* ...> net stop apache2
* ...> net start apache2

Setup

Open your browser and access url http://localhost/blog/wp-admin/install.php

At this point you should see the installation screen, then a form that asks
for the title of your blog and your e-mail address, and finally a screen that
displays a generated password for WP user 'admin'...
Testing

Access URL http://localhost/blog/ to view blog.

Access URL http://localhost/blog/wp-admin/ to administer blog.

No comments:

Post a Comment