Use Wordpress to quickly build websites

Source: Internet
Author: User
Tags php and mysql bbpress wordpress logo fully qualified domain name

Author: vamei Source: http://www.cnblogs.com/vamei welcome reprint, please also keep this statement. Thank you!

 

This articleArticleThis section describes how to use Wordpress to create a blog, website, and Forum. I recently wanted to build a website, but my front-end knowledge is really poor, so I wanted to use WordPress. WordPress is a PHP-based blog development tool. It provides a set of open-source PHPCodeThis allows you to quickly create a blog on a host that supports PHP. Matt mullenweg, the author of WordPress, As an avid blogger, deeply felt the shortcomings of his blog products and eventually led to WordPress development. WordPress has a good graphical page management, so you don't need to understand HTML, CSS, or JavaScript to create a mature blog.

 

Matt mullenweg

 

 

The blog built with WordPress is concise and beautiful, and the whole website creation process becomes very simple, so WordPress is popular immediately. Later, other developers and enthusiasts added various theme and plug-ins for WordPress, so that WordPress can be used for the creation of web sites, forums, social networks, etc. Due to the ease of use of WorPress, more than 15% of the current web pages are based on WordPress.

 

Cool shell: A blog created using WordPress

 

 

WordPress is open-source and users can read and modify its code at will. Therefore, WordPress is also a good learning tool.

WordPress logo

 

Self-built test environment: Lamp

Traditionally, the lamp package is Linux + Apache + MySQL + PHP. Linux is the operating system, Apache is the server, MySQL is the database, PHP is the interface between the server and the database (and CGI ). Although these four are relatively independent, they can work perfectly together to form an efficient Web server. I installed lamp on my computer to test WordPress. If the test succeeds, you can rent a host that supports PHP and MySQL and run the WordPress website on it.

In the test environment, you can accessHttp: // localhost, OrHttp: // 127.0.0.1, OrLocal IP AddressTo access the website.

(Oec2003 provides the Wamp solution, that is, Windows + Apache + MySQL + PHP. You can use the appservnetwork software for one-time installation. The appservnetwork URL is http://www.appservnetwork.com/Thanks oec2003)

(Mamp can be used in Mac OS X. This software provides Mac + Apache + MySQL + PHP. You can go to http://www.mamp.infoA free version is available)

Install the lamp package in Ubuntu
 
$SudoApt-GetInstallTasksel $SudoTaskselInstallLamp-Server

(* Amp set can be installed for different Linux versions, Mac and windows. You can search for the corresponding method by Google)

Lamp Configuration

We create our own mysite configuration based on the Default Configuration:

 
$Sudo CP/Etc/apache2/sites-available/default/etc/apache2/sites-available/mysite

Modify/etc/apache2/sites-available/mysite/Var/WWWChange/Home/vamei/mysiteThat is, the starting directory of our site.

Load mysite Configuration

Now, we need to use mysite Configuration:

 
$SudoA2dissite default &&SudoA2ensite mysite $SudoService apache2 reload
Restart apache2:
 
$Sudo/Etc/init. d/apache2 restart
Test

Create/home/vamei/mysite/index.html and write

 
<P>HTML test success!</P>

Then openHttp: // localhost. If the following figure is displayed, the Apache installation is successful:

Further test PHP. Create/home/vamei/mysite/test. php and add a line to it:

<? PHPPhpinfo();?>

Use a browser to access http: // localhost/test. php. If a page with the following banners appears, PHP installation is successful:

After the test is successful, delete index.html and test. php, and clear the browser cache.

  ** The following is a warning during installation:

Apache2: cocould not reliably determine the server's fully qualified domain name, using 127.0.0.1 for servername
... Waiting apache2: cocould not reliably determine the server's fully qualified domain name, using 127.0.0.1 for servername

I don't quite understand what the problem is, but I found a solution. Is to modify/Etc/apache2/httpd. confFile, add a line to the file:

Servername localhost

After saving and exiting, restart Apache:

 
$Sudo/Etc/init. d/apache2 restart
  Create a database for WordPress Run the following command on the terminal to start MySQL
 
$ Mysql-u root-P
Go to MySQL, create a database named WordPress, and create the user vamei
MySQL>   Create   Database  WordPress; MySQL  >   Grant   Select , Insert , Update , Delete , Create , Drop , Index , Alter , Create  Temporary Tables, lock tables On WordPress. *   To   '  Vamei  ' @ '  Localhost  ' Identified By   '  Vameiisgood  ' ;

The vamei password is vameiisgood.

 

Download WordPress Download link   I downloaded the .tar.gz version and used$ Tar-xzvf wordpress-3.4.2.tar.gzDecompress. You can also download the. Zip version.$ Unzip filenameDecompress. Put the decompressed file into/home/vamei/mysite (index. php should exist under this directory ). Then modify the File Permission:
 
$Sudo Chmod-R777/Home/vamei/mysite
(Apache does not have mysite files. Therefore, you need permissions to read, modify, and execute them. You can set a User Group to use the 775 permission instead of the 777 permission to improve security. You may need to further modify the upper-level directory permissions) Use a browser to access http: // localhost. You can see the following:

Click the button as instructed until the following page is displayed. Enter MySQL database information on this page, which must be consistent with "create database for WordPress.

Then, set the administrator user.

Log on to the console as an administrator ). In this control panel, you can further set pages, theme, menu, and plug-in. You can also add blog posts on this page.

Control Panel

Visit http: // localhost to see the blog we created.

Blog

Now, you can follow the steps above to create your own blog in the rented host or cloud space.

Theme)

One of the major advantages of WordPress is its rich themes and plug-ins. By changing the theme, you can change the overall appearance of the website without affecting the content. On the theme page of wordpress.org, there are many theme options. I will take the responsive topic as an example to illustrate the change of the topic. This topic applies to websites.

Download subject: http://wordpress.org/extend/themes/responsive

Decompress the downloaded package and put the entire folder into/home/vamei/mysite/WP-content/themes. Note that Apache requires the permission to read these files. Go to the control panel of the website. Under appearance-> themes, you can see the new responsive topic and choose change.

Go back to the site localhost and check that the website has a new "shape ".

 

. Responsive topic

 

Activate plug-in)

The plug-in is used to add website functions. You can activate multiple plug-ins on a website. For example, we want to activate the bbpress plug-in to support forum functions. In the same step, find the plug-in wordpress.org, download and decompress it.

Download link: http://wordpress.org/extend/plugins/bbpress/

Add the plug-in/Home/vamei/mysite/WP-content/plugins folder, and modify the permissions as appropriate.

Return to the control panel and select plugins-> installed plugins. We can see the corresponding row of bbpress. Select activate)

A new option is displayed on the main menu of the control panel.

Create forums (such as tech) and topics (such as WordPress ). When creating WordPress, you can choose to include it in the tech forum. Then, use widgets or menu to display the Forum Page.

WordPress-based forum

You also need to select anyone can register in setting-> General to allow multi-user mode.

(This part only shows how to add and use the plug-in. More settings are required if you want to create a forum)

 

Summary

WordPress is a good "dumb camera ". It treats many interfaces very beautifully. You can use it to quickly build a website. As a matter of fact, I have seen some site construction outsourcing companies make minor changes based on WordPress. When a friend asks you to build a website, at least you don't have to say, "Sorry, I wrote a compiler and didn't know how to create a website ". But what's better is that we can go deep into the WordPress APIs and even the source code, learn from them, create our own themes and plug-ins, and even add them to WordPress development.Community. Cool, right?

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.