Pages

Jun 15, 2011

Install the Wordpress on Fedora 15

In my previous post, I have setup the web server with the LAMP: http://rookiepeng.blogspot.com/2011/06/how-to-setup-web-server-on-fedora-15.html

We can run the wordpress on the server. The wordpress can be downloaded from http://wordpress.org/.

Before installing the wordpress, we need some configurations on MySQL. I use phpmyadmin to configure MySQL.
$ su
# yum install phpMyAdmin
The directory of the phpmyadmin is /usr/share/phpMyAdmin, while the apache directory is /var/www/html, so we need make a symbolic link:
$ su
# ln -s /usr/share/phpMyAdmin /var/www/html
Visit http://127.0.0.1/phpMyAdmin/ with you browser, login with root. Find "Privileges->Add a new user". Choose a name and a password for your wordpress database. The host is "localhost" and pay attention to selecting "Create database with same name and grant all privileges".

Extract the wordpress and copy all the files in wordpress directory to /var/www/html. Visit http//:127.0.0.1 and you can see a wordpress installing page.

Click "Create a Configuration File".

Then "Let's go!".

Type your database name and password, the host is "localhost'. Then click "Submit".

Do as the tips, copy the text into gedit and save as "wp-config.php". Copy "wp-config.php" to "/var/www/html" and click "Run the install". After a while, there will come out a welcome page:

Type your site name, administrator name, password, etc. Then congratulations! The wordpress has been installed successfully.

You can visit http://127.0.0.1 now. It will show you the default home page.

It seems everything is done, but there still are some problems. Firstly, you can't see the pictures when you visit the site from another machine. Then, you can't upload pictures when you post articles. You need do as follows:

Log in you wordpress with administrator account and go to "Settings->General". Find "WordPress address" and "Site address". Change them to your URL or IP. Then you can see pictures when visit from another machine.

When you upload a picture, it will popup an error says: "Unable to create directory /var/www/html/wp-content/uploads/2011/06. Is its parent directory writable by the server?"

Run follow commands:
$ su
# cd /var/www/html/wp-content
# mkdir uploads
# chmod -R 777 uploads
That means creating a uploads directory and making it writable to everybody. You also need to allow httpd to have write access on the uploads directory in selinux. So run:
$ su
# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/wp-content/uploads'
# restorecon -v '/var/www/html/wp-content/uploads'
After all, your wordpress can work successfully. 

1 comment:

video lover said...

Thanks a lot for sharing. I'll probably do this, WP rocks. :)

Hot guys | Fit Studs with best bodies.

Post a Comment