个人工具

UbuntuHelp:WordPress

来自Ubuntu中文

Wikibot讨论 | 贡献2010年5月20日 (四) 01:02的版本

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索


Wordpress is a popular web publishing software, most commonly used for weblogs (also known as "blogs"). Follow these instructions to install Wordpress on Ubuntu 6.06 (Dapper Drake).

Alternative to manual installation

Some users may prefer to skip manual installation by using the unofficial pre-integrated TurnKey WordPress Appliance based on Ubuntu LTS.

LAMP Installation

Wordpress runs on the LAMP (Linux, Apache, MySQL, PHP) stack of applications. First you need to install and configure LAMP. See the ApacheMySQLPHP page.

Enable the Universe repository

Install Wordpress

Use any method to install.

wordpress php5-gd 

An example is using the command line terminal with apt-get install:

 sudo apt-get install wordpress php5-gd

The installation places the files in the /usr/share/wordpress folder, generally. So that Apache2 knows where to find the installation folder, make a symbolic link to the Apache2 www folder:

sudo ln -s /usr/share/wordpress /var/www/wordpress 

Then install WordPress using the supplied script

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost

Note: (Use sh instead of bash for Feisty or earlier.) This script creates the MySQL database user wordpress for the new MySQL database named localhost (that will be used for WordPress). If you will be hosting a virtual host and/or already know your URL, it is best to name your database the same as your URL. For example, if your URL is wordpress.mydomain.org, then the command would be

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress wordpress.mydomain.org

If you will be using a virtual host, create your apache2 virtual host file in the /etc/apache2/sites-available folder. When you are finished, enable it by making a symbolic link from that virtual host file to the sites-enabled folder. However, this can be dangerous until you have secured your WordPress installation against malicious anonymous users on the Internet, so should only be done after the initial installation is complete and anonymous user creation is turned off. Whenever you change your virtual hosts, you must restart Apache2:

sudo /etc/init.d/apache2 restart

Now, browse to "http://localhost/wordpress" in your browser to install it (or http://wordpress.mydomain.org/wordpress if you are using a virtual host). You will be given an initial user named admin and a random password. Write it down. Then login as the admin user and change the password. WordPress?action=AttachFile&do=get&target=wordpress1.jpg WordPress?action=AttachFile&do=get&target=wordpress2.jpg For automatic updates to occur, the folder and all its files and subfolders must be owned by www-data:

 chown -R www-data /usr/share/wordpress

While logged in to WordPress, do an automatic upgrade from the Tools -> Upgrade option. Once installed, to change the url of your site, link the file /etc/wordpress/config-localhost.php to /etc/wordpress/config-my.url.com.php as well as changing the url in the wordpress configuration Options menu. For example, if my dns was hello.homelinux.net

sudo ln -s /etc/wordpress/config-localhost.php /etc/wordpress/config-hello.homelinux.net.php

WordPress?action=AttachFile&do=get&target=wordpress3.jpg Change the URLs to: WordPress?action=AttachFile&do=get&target=wordpress4.jpg

Troubleshooting

Error when running setup-mysql

While installing wordpress you may encounter the following error.

$ sudo sh /usr/share/doc/wordpress/examples/setup-mysql -n (your mysql user) localhost
/usr/share/doc/wordpress/examples/setup-mysql: 38: Syntax error: Bad substitution

This issue seems to be Edgy related. I did not encounter the error using Dapper. Here is a link to the bug reported on the Debian mailing list. Note: the issue seems to appear on Gutsy as well, only that the error code is slightly different:

/usr/share/doc/wordpress/examples/setup-mysql: 37: Syntax error: Bad substitution

To correct this, you first need to remove any configuration that may have already been created:

rm /etc/wordpress/config-localhost.php

Then run the same command but using bash instead of sh:

sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n (your mysql user) localhost

External Links

The following are unverified suggestions made by users.

Curly Braces

Curly Braces is an weekly blog on technology. This article : Installing WordPress in Ubuntu | target=_blank provides a step by step guide on how to install the latest version of WordPress ini Ubuntu Jaunty Jackalope