Friday, 21 March 2008

How to Install Wordpress and learn to stop Worrying and Love the Blog


There are two ways to setup a blog. The first is the easiest and involves registering with an on-line blogging service such as Blogger, selecting a template, configuring your account then off you go. The second route is to install a blogging application on a server, configure it, customise it then your up and running. The first method is the quickest and can have you blogging within minutes. The second is a tad more time consuming but gives you far greater flexibility in terms of what you can do.

Wordpress
Having already setup 4 blogs using the first method, I thought it was high time I got down to some real hardcore blogging and setup my own hosted blog. After a few nights of on-line research and numerous coffees, I concluded that probably the best tool for the job was Wordpress. This uses a MySQL database to hold your blogs content then a combination of PHP, XHTML and CSS style sheets to present it.

Hosting

First off you need to have a place for Wordplace to hang its hat. The server that it's hosted on needs to have MySQL and PHP installed on it. The Wordpress site lists a number of recommended Hosts. Again after more surf and coffee sessions I plumped for AN Hosting as my host of choice. A good price, well recommended and bags of features, AN were the host with the most. I also toyed with installing a WAMP server and trying things out locally, but that's a different story. AN also offer automatic Wordpress installation, but for the sake of this post I'll describe how to install it old school.

Installation
Creating the Wordpress Database
Through your hosts control panel create a new database to hold your Wordpress tables. Give it a suitable name such as wordpress or an unsuitable one such as ziggy. Add any users to this database who you want to give access to (e.g. yourself, yourwife, the cat...).

Download Wordpress
First off, download a zip file of the latest stable Wordpress release from the Wordpress website to your PC. Then un-zip it to a suitable place.

Create the wp-config.php file

If you look in the wordpress folder you will find a file called
wp-config-sample.php. Save this as
wp-config.php then edit it using a text editor such as notepad or the developers PFE.

Find the line that says define('DB_NAME', 'wordpress') and replace wordpress with the name of the MySQL database you created earlier. On the next two lines enter the name of a user who you gave admin rights to your database and their password.

e.g.

define('DB_USER', 'dbrock'); // Your MySQL username define('DB_PASSWORD', 'hawkwind'); // ...and password

On the line that says: -

define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

I also had to replace local host with
remotemysqlhost, as instructed on the AN hosting control panel. I guess I must be the 1%.

One neat trick you can do is to have several blogs setup in the same database, if you want to do this drop down to the line that says:-

$table_prefix = 'wp_'; // Only numbers, letters, and underscores please! this is the prefix that will be given to the name of each wordpress table that is created. For more than one table use different prefixes. For example you could change it to: -


$table_prefix = 'wp_mh_'; // Only numbers, letters, and underscores please!

for your Motorhead blog.

Copy Wordpress Files to Your Server

Now you've created a configuration file, it's time to copy your files up to the server. To do this use an FTP application such as FileZilla or CuteFTP. I personally use WS-FTP, which isn't free but is reliable.

Use your FTP software to copy the extracted Worpress directory to a directory under the directory that holds your web documents. I set one up in this called \blogs\ into which I'll copy any future wordpress directories.
Run install.php

Through a web browser, such as firefox, run the worpress install.php file. To do this enter the URL of your websites root directory followed by the path to this file, which is found in the wp-admin folder.

e.g.

http://www.kungfool.co.uk/blogs/wordpress/wp-admin/install.php You should now be prompted for the name of your blog, which you can always change later, and your e-mail address. Enter both and click on the Install Wordpress link.

In the blink of an eye you'll get the message: -

WordPress has been installed. Were you expecting more steps? Sorry to disappoint.

And given a user ID and password to administer your blog with. Make a note of them for future reference and hit Log In baby.

Congratulations, you've installed Wordpress, woo hoo, go away and have a nice cup of tea and a biscuit to celebrate why don't you.

To view your fledgling blog enter your root URL followed by the wordpress directory: -

e.g.
http://www.kungfool.co.uk/blogs/wordpress
To bring up the admin login page run the following script from your browser: -
http://www.kungfool.com/blogs/wordpress/wp-login.php

substituting your root web URL and Wordpress directory as appropriate.


By the way you can visit the blog I created in this exercise at

http://www.seishan.com/blogs/test25/

I'll be building on it over the next couple of weeks, so expect it to morph as time goes by.

By the way, the 25 in test25 has nothing to do with Hawkwind's - 25 Years On, I'm just checking out Release Candidate 1 of Wordpress 2.5. Wordpress 2.5 isn't on general release yet, but hey I thought I'd give it a whirl.

Enjoy.

Monday, 14 January 2008

Wednesday, 21 November 2007

Analyze This

In the good old days you analyzed a table using a statement along the lines of: -

ANALYZE TABLE tablename COMPUTE STATISTICS;

With the advent of Oracle 8i the DBMS_STATS utility was introduced to gather object statistics. This is Oracles preffered method of gathering the information.

Using it the equivalent of the above analyze statement would be: -

EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>'SYSADM',TABNAME=>'tablename',CASCADE=>TRUE);

This should be executed after the table you need to analyze has been populated.

To cut back on the time it takes to execute, you can limit the number of rows it uses in its stats gathering by adding estimate_percent => nn (where nn is a number between 1 and 100) this will only use the given percentage of the total rows in the table when performing its anaysis.

e.g.

EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>'SYSADM',TABNAME=>'tablename',CASCADE=>TRUE, estimate_percent => 20);

Will only use 20% of the tables rows. The higher the percentage, the better the analysis, but the longer it will take. When used Oracle randomly selects the rows it uses from the table to make them more representative.

N.B. This statement doesn't work from Oracle Developer (I've not tried it from Toad). As such execute it from SQL Plus instead.

Monday, 19 November 2007

Listing a tables Indexes

select index_name
from dba_indexes
where table_name=<table_name>

Wednesday, 14 November 2007

Useful SQL Plus Settings

On occaisions when you're working at an Oracle site with no access to sensible SQL development tools, such as Toad or Oracle Developer (available as a free download from the Oracle website, but no good if you can't download or install it), you are forced to use that most heinous of applications SQL Plus. To make life a bit more palatable, try using the following settings to brighten up its drab and dreary demeanor.

/* SQL Plus parameters required for each session */

select name from sys.v_$database;
alter session set current_schema=SYSADM;
set timing on;
set sqlprompt dbasename> ;
set linesize 150;
set null empty;
set pagesize 500;
set pause on;
set space 1;
set time on;
set trim on;
set wrap off;
set sqlnumber on;
set describe line on;

Enjoy !!!!

Tuesday, 25 September 2007

Specifying the report directory in PeopleSoft

To change the directory that Process Monitor tries to open report output in PeopleSoft (logs, trace files etc.) navigate to the Report Node definition page: -

Home > PeopleTools > Process Scheduler > Report Nodes

From here you can specify the URL, URI Port and URI Resource used to open report output in PeopleSoft.

Friday, 21 September 2007

Changing the PS, Application Server Process Scheduler Password

With a vanilla PeopleSoft installation, one of the first things you should do is change the password for the adminstrator account PS from the default. This post details what you need to do to accomplish this and offers a number of hints and tips along the way.

Backup First

Before making these changes in production I would advise taking a full backup of the system first. And making sure that the backup was successful.

Chosing a new PS Password

As this account gives you carte blanche access to the PeopleSoft system, care should be taken when changing it to ensure that the password chosen is as strong as possible. The new password should: -



  • Use a minimum of 7 characters and a maximum of 8 characters in length.

  • Use only mixed case alpha and numeric characters.

  • Avoid common names, words, and anything obvious, such as your Operator ID. It should also be significantly different from your most recent passwords.


For further suggestions regarding password selection please refer to my previous article The Art of Creating a Password.



Changing the Password

  • To change the password you need to: -

  • Change the PS Password through the web;

  • Change the Application Server password using PSADMIN;

  • Change the Process Scheduler Passwor using PSADMIN.


Changing the PS Password



Log in to PeopleSoft through the web.

Navigate to: -

Home > PeopleTools > Security > User Profiles > User Profiles

And change the password for PS.



Note that in some installations a seperate PSAPPS user account is used by the Application Server and Process Scheduler. To detemine if this is so, have a look at their configuration files psappsrv.cfg and psprcs.cfg respectively. These will contain the ID and password used to connect to PeopleSoft. If PSAPPS is used then you should change it in the same manner as you changed PS.

Change the Application Server Password

There are two ways you can change the App Server password. You could directly edit the configuration file, named above, or use PSADMIN. As direct editing can cause problems if you encrypt it, I would reccoment you use PSADMIN.

Configure the Application Server

First select Application Server from the main menu to got to the Application Server Administration menu.

Then select Administer a domain and pick the domain you want to change.

Now select configure this domain and answer 'y' when it says that 'this option will shutdown the domain do you want to continue' and 'y' when it asks if you want to change any config values.

The first thing it will ask is if you want to change any startup values, answer 'y' to this.

Continue to press enter untill you get to UserPswd then enter you new PS or PSAPPS password as apropriate.

When it asks if you want to encrypt this password answer 'y'. This will mask it in the config file and make it less easy to hack.

Then keep hitting return to take the default values until configuration is complete.

Restart the Application Server

To restart the saerver with the new password, go to the Domain Administration menu and select 'Boot this domain'.

Change the Process Scheduler Password

Configure the Process Scheduler

First select Process Scheduler from the main menu to got to the Process Scheduler Administration menu.

Select 'Configure a Process Scheduler' and choose the database you want to change from the list displayed.

When told 'This option will shutdown the process scheduler. Do you want to continue' answer 'y'.

As with the Application server the Startup section will appear early on. When asked, enter 'y' when asked 'Do you want to change any values'.

When UserPswd appears enter 'y' to change it and enter the new PS or PSAPPS password.

Again I would advise you to encrypt this password, so enter 'y' when asked.

Keep hitting return to take the default values until configuration is complete.

Restart the Process Scheduler

Got to the Process Scheduler Administration screen and select 'Start a Process Scheduler Server'.

Select the apropriate database from the list displayed.