Convert Microsoft to LINUX: Wordpress


If you want to install a content manage system that everybody can add to try Wordpress. It is built into most distributions. To get it you also have to have php5, mysql (client and Server), httpd/Apache2 installed. Here is how to do it using Ubuntu. Type as root in a terminal window:
apt-get install apache2 php5 mysql-client mysql-server php-mysql
Restart Apache2 to be safe with the command:
/etc/init.d/apache2 reload
Fetch the tarred file by going here Note, your version may be newer, at the time of this writing 2.92 was the most recent version.
At the terminal prompt type:
tar -zxvpf wordpress-2.9.2.tar.gz
After untaring using the above command, this will create a new directory wordpress Now, type:
mv wordpress /var/www/
to move all the wordpress files to the web directory above. Note, you may have to create the wordpress directory underneath the /var/www/ directory. You should now see a directory:
/var/www/wordpress
Copy the default config file to wp-config.php with the commands:
cp wp-config-sample.php wp-config.php You are now ready to create the database that Wordpress will use. Go to the terminal window and type:
mysql -u root -p
You will now be at a mysql> prompt.
mysql> DROP DATABASE test; [removes the test database]
mysql> DELETE FROM mysql.user WHERE user = ''; [Removes anonymous access]
mysql> FLUSH PRIVILEGES;
Create a database and database user for your data. You will use this database and user name in your database connection string. The GRANT statement actually creates a new MySQL user account.
mysql> CREATE DATABASE wordpress_mysql;
mysql> GRANT ALL PRIVILEGES ON wordpress_mysql.* TO 'wpadmin'@'localhost' IDENTIFIED BY 'thepassword';
Now leave mysql by typing exit; Edit the file wp-config.php changing the appropriate database name, username and password.

You are now ready to run the install, type:
http://localhost/wordpress in your web browser. There should be a button now in your browser that says install. Be sure to either stick with the autogenerated password or use a strong password of your own. After the Wordpress install make sure this file's permission is set back to read only, i.e.:
chmod 444 /var/www/wordpress/wp-config.php
You can then login as the Wordpress Administrator (admin is default name) and configure the rest of the website.

Note, some hosting services like to really tie your hands so you may not be able to do what you could on a normal UNIX/Linux or Microsoft IIS Servers. This often happens with the one click method. For example, they will only let you install their approved themes. To install a theme go to:
http://localhost/wordpress/wp-admin/theme-install.php
You can also get to it, by logging in as admin and clikcing on the appearance section selecting themes If you select a theme, i.e. dovetail it wants to write files under the directory:
/var/www/wordpress/wp-content
It will automatically create the wp-content directory for you. If you get an error that says after attempting install "can not find content directory wp-content", this means you are tied. Consult your webhosting support or you can install everything on your localhost machine and then ftp up the entire directory. You have to know exactly where to put it on your hosting service. Typically the directory /var/www will be mappled to public_html and under this directory would come the wordpress directory with all of it's stuff.

You will eventually want to configure the cron job to delete your log files as they will grow big very fast with Wordpress. For more details please see here . To get started, go to here.

Troubleshooting and Permalink Problems

When you move websites or change a domain things may not be working any more. The wordpress settings file may be in the wrong location and you find all your URL's no longer work. You can fix this quickly by going to the functions.php in your appropriate theme. Note there are a lot of functions.php there so make sure you edit the right one for your theme.

Sometimes you might mess up the general settings and not be able to login to fix the website. Here is a way out of this dilemna
Enjoy!