个人工具

“UbuntuHelp:WordPress”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{From|https://help.ubuntu.com/community/WordPress}} {{Languages|php5}} [http://www.wordpress.org Wordpress] is a popular web publishing software, most commonly used for weblogs (also kn...)
 
 
(未显示2个用户的14个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/WordPress}}
 
{{From|https://help.ubuntu.com/community/WordPress}}
{{Languages|php5}}
+
{{Languages|UbuntuHelp:WordPress}}
 
+
 
+
 
[http://www.wordpress.org Wordpress] is a popular web publishing software, most commonly used for weblogs (also known as "blogs").   
 
[http://www.wordpress.org 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).
 
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 [http://www.turnkeylinux.org/wordpress TurnKey WordPress Appliance] based on Ubuntu LTS.
 
=== LAMP Installation ===
 
=== LAMP Installation ===
 
 
Wordpress runs on the LAMP (Linux, Apache, MySQL, PHP) stack of applications.
 
Wordpress runs on the LAMP (Linux, Apache, MySQL, PHP) stack of applications.
 
+
First you need to install and configure LAMP. See the [[UbuntuHelp:ApacheMySQLPHP|ApacheMySQLPHP]] page.
First you need to install and configure LAMP. See the [[UbuntuHelp:ApacheMySQLPHP]] page.
+
 
+
 
=== Enable the Universe repository ===
 
=== Enable the Universe repository ===
 
 
* [[UbuntuHelp:Repositories/CommandLine| I am using Ubuntu server (command line)]]
 
* [[UbuntuHelp:Repositories/CommandLine| I am using Ubuntu server (command line)]]
 
* [[UbuntuHelp:AddingRepositoriesHowto| I am using a desktop]]
 
* [[UbuntuHelp:AddingRepositoriesHowto| I am using a desktop]]
 
 
=== Install Wordpress ===
 
=== Install Wordpress ===
Use [[UbuntuHelp:InstallingSoftware| any method]] to install
+
Use [[UbuntuHelp:InstallingSoftware| any method]] to install.
 
+
 
<pre><nowiki>
 
<pre><nowiki>
 
wordpress php5-gd  
 
wordpress php5-gd  
</nowiki></code>
+
</nowiki></pre>
 
+
An example is using the command line terminal with apt-get install:
The following will install Wordpress in the /wordpress directory of your default web site.  To put it somewhere else, alter these commands to suit.
+
<pre><nowiki>
 
+
sudo apt-get install wordpress php5-gd
 +
</nowiki></pre>
 +
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:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo ln -s /usr/share/wordpress /var/www/wordpress  
 
sudo ln -s /usr/share/wordpress /var/www/wordpress  
 
+
</nowiki></pre>
sudo sh /usr/share/doc/wordpress/examples/setup-mysql -n (your mysql user) localhost
+
Then install WordPress using the supplied script
 
+
<pre><nowiki>
 +
sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost
 +
</nowiki></pre>
 +
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
 +
<pre><nowiki>
 +
sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress wordpress.mydomain.org
 +
</nowiki></pre>
 +
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:
 +
<pre><nowiki>
 
sudo /etc/init.d/apache2 restart
 
sudo /etc/init.d/apache2 restart
</nowiki></code>
+
</nowiki></pre>
 
+
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.
Now, browse to "http://localhost/wordpress" in your browser and click on the "install.php" link.
+
https://help.ubuntu.com/community/WordPress?action=AttachFile&do=get&target=wordpress1.jpg
attachment:wordpress1.jpg
+
https://help.ubuntu.com/community/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:
attachment:wordpress2.jpg
+
<pre><nowiki>
 
+
chown -R www-data /usr/share/wordpress
The configuration changes the password of the MySQL user you use. You need to create a different MySQL user if you want to set up other web applications.
+
</nowiki></pre>
 
+
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.
 
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''
 
For example, if my dns was ''hello.homelinux.net''
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo ln -s /etc/wordpress/config-localhost.php /etc/wordpress/config-hello.homelinux.net.php
 
sudo ln -s /etc/wordpress/config-localhost.php /etc/wordpress/config-hello.homelinux.net.php
</nowiki></code>
+
</nowiki></pre>
attachment:wordpress3.jpg
+
https://help.ubuntu.com/community/WordPress?action=AttachFile&do=get&target=wordpress3.jpg
 
Change the URLs to:
 
Change the URLs to:
attachment:wordpress4.jpg
+
https://help.ubuntu.com/community/WordPress?action=AttachFile&do=get&target=wordpress4.jpg
 
+
 
=== Troubleshooting ===
 
=== Troubleshooting ===
 
 
==== Error when running setup-mysql ====
 
==== Error when running setup-mysql ====
 
While installing wordpress you may encounter the following error.
 
While installing wordpress you may encounter the following error.
第59行: 第59行:
 
$ sudo sh /usr/share/doc/wordpress/examples/setup-mysql -n (your mysql user) localhost
 
$ 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
 
/usr/share/doc/wordpress/examples/setup-mysql: 38: Syntax error: Bad substitution
</nowiki></code>
+
</nowiki></pre>
 
+
This issue seems to be Edgy related.  I did not encounter the error using Dapper.  Here is a [http://www.mail-archive.com/[email protected]/msg199581.html link] to the bug reported on the Debian mailing list.
This issue seems to be Edgy related.  I did not encounter the error using Dapper.  Here is a [http://www.mail-archive.com/[email protected]/msg199581.html 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:
 
+
<pre><nowiki>
 +
/usr/share/doc/wordpress/examples/setup-mysql: 37: Syntax error: Bad substitution
 +
</nowiki></pre>
 
To correct this, you first need to remove any configuration that may have already been created:
 
To correct this, you first need to remove any configuration that may have already been created:
 
<pre><nowiki>
 
<pre><nowiki>
 
rm /etc/wordpress/config-localhost.php
 
rm /etc/wordpress/config-localhost.php
</nowiki></code>
+
</nowiki></pre>
 
+
 
Then run the same command but using ''bash'' instead of ''sh'':
 
Then run the same command but using ''bash'' instead of ''sh'':
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n (your mysql user) localhost
 
sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n (your mysql user) localhost
</nowiki></code>
+
</nowiki></pre>
 +
=== External Links ===
 +
The following are unverified suggestions made by users.
 +
==== Curly Braces ====
 +
Curly Braces is an weekly blog on technology. This article : [http://zfranciscus.wordpress.com/2009/10/22/installing-wordpress-in-ubuntu/  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
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

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