[Repost] Installing WordPress On CentOs 5

Posted on


WordPress is basically a blog. It allows the owner of the blog to blog about themselves and anything else that comes to their mind. It also has some interesting features; such has Plugins, Themes which allows the owner to transform WordPress in to something that best suits them and their personality. There are all sorts of Plugins that allow you to transform WordPress such as Gallery plugins, Google Maps plugs that do lots of different things and much more!
WordPress is not only free, but is also Open Source. It uses PHP and MYSQL so the possibilities are endless.
In order to setup WordPress, you will require the following to be installed and setup.
Apache and PHP
We are also going to be editing files within WordPress so if your new to this you may also want to read aboutText Editors


Navigate to the folder where Apache looks for the website files, if you have no virtual hosts configured then it will be /var/www/html.
If you have configured virtual hosts, then the folder will be based on your virtual host configuration.
The installation, we first need to get the WordPress files and uncompress them.

[user@vps public_html]# wget http://wordpress.org/latest.tar.gz
[user@vps public_html]# tar -xzvf latest.tar.gz

The compressed file will be unpacked to wordpress/. If you want WordPress in your main folder to show up with people visit your site, then do the following.
Note the path /home/user/public_html should be substituted with the path you are using.

[user@vps public_html]# mv /home/user/public_html/wordpress/* /home/user/public_html/

All the files from wordpress/ will be moved in to your website root directory.
Now we just need to delete the wordpress directory.

[user@vps public_html]# rm -rf /home/user/public_html/wordpress/

You maybe thinking about deleting the WordPress compressed file latest.tar.gz, i would recommend that you didn’t. If you delete something or need to reinstall the same version for what ever reason, that file is what you need and its best to leave it where it is just encase you need it.

Basic Configuration

Now that we have the files on the server and where we want them. We now need to set up a database and username for the WordPress.
There are a few ways to do this, either Command Line as I’m going to show you or with myphpadmin, to learn how to create a new user and database with myphpadmin click here.
So lets create the username and database with mysql command line.
First we need to log on to mysql as root.

[root@vps ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 9 to server version: 4.1.22

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.


Once we’re logged in, we need to create the database, the name can be what you want it in to be and in this case I’m calling it wordpress. CREATE DATABASE has to be in capitals and don’t for get the semi-colon at the end of the line.

mysql> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.00 sec)

Now that we have our database, we need a username and password to login to mysql and they need to have permissions on our new database. Again this is case sensitive.

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO "username"@"localhost" IDENTIFIED BY "mypassword";
Query OK, 0 rows affected (0.00 sec)

Now some tiding up, before we exit from mysql.

Query OK, 0 rows affected (0.00 sec)
mysql> exit

Now we need to configure the config file for WordPress, this can be one of two ways, firstly by putting your website address in your browser and following the on screen instructions or by using a text editor and putting the details directly in to the config file.
Before we start with the browser guide we need to allow files to be written to our web directory.

[user@vps public_html]# chmod a+rwx /home/user/public_html

Through the browser. Click Create a Configuration File

Click Let’s Go!

Put in the database name, username and password you set up in mysql and click Submit.

if everything goes okay

Now that we are finished sorting the config file out, we need to change the permissions back on your folder

[user@vps public_html]# chmod go-w /home/user/public_html

if you were unable to change the permissions of your folder and / or get this screen telling you to copy and paste the following in to a file

This is what we do. Click in the big text box and press CTRL+A and then CTRL+C this will select all the text and copy it to your clipboard.
now in the SSH window, type the following (remember to change the path to where your install is)

[user@vps public_html]# vi /home/user/public_html/wp-config.php

Now all you have to do in your text editor is click your right mouse button and what you copied in to your clipboard will appear in your text editor. save it and run install.
Now if you want to do the config file at command line this what you do.
This will copy the sample config file and rename it the config file.

[user@vps public_html]# cp wp-config-sample.php wp-config.php

now we need to edit the file

[user@vps public_html]# vi wp-config.php

find the following

 define('DB_NAME', 'putyourdbnamehere');  /** MySQL database username */ define('DB_USER', 'usernamehere');  /** MySQL database password */ define('DB_PASSWORD', 'yourpasswordhere');  /** MySQL hostname */ define('DB_HOST', 'localhost'); 

and put in the information we set up in mysql

define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'user');

/** MySQL database password */
define('DB_PASSWORD', 'mypassword');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Then find these

define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');

Replace the above with the randomly generated keys find at https://api.wordpress.org/secret-key/1.1/
Now save the file and go to your website in your browser to finish off the install.
Put in a blog title and your email address.

Write down the username and password.


WordPress install is complete!

Go to your site

Sumber: Dari Sini

Leave a Reply

Your email address will not be published. Required fields are marked *