Difference between revisions of "Wordpress"

From ArchWiki
Jump to: navigation, search
(Install: do not use `pacman -Sy` + comply with Help:Style)
(Rewrite article)
Line 1: Line 1:
[[Category:Web Server]]
+
[[Category:File systems]]
{{Stub}}
+
{{Article summary start}}
== Install ==
+
{{Article summary text|Wordpress is an easy to setup and administer FLOSS content management system featuring a strong and vibrant community with thousands of plugins and themes.}}
 +
{{Article summary heading|Related}}
 +
{{Article summary wiki|LAMP}}
 +
{{Article summary wiki|PHP}}
 +
{{Article summary wiki|MySQL}}
 +
{{Article summary wiki|phpMyAdmin}}
 +
{{Article summary end}}
 +
 
 +
[http://wordpress.org Wordpress] is the goto Free Libre Open Source Software ([[Wikipedia:Free and open-source software|FLOSS]]) content managment system ([[Wikipedia:Content management system|CMS]]) created by [[Wikipedia:Matt Mullenweg|Matt Mullenweg]] and first released in 2003. Wordpress has a vast and vibrant community that provides tens of thousands of free plugins and themes to allow the user to easily customize the appearance and function of their Wordpress CMS. Wordpress is licensed under the GPLv2.
 +
 
 +
The biggest feature of Wordpress is its ease in configuration and administration. [http://codex.wordpress.org/Installing_WordPress Setting up a Wordpress site takes five minutes]. The Wordpress administration panel allows users to easily configure almost every aspect of their website including fetching and installing plugins and themes. Wordpress provides effortless automatic updates.
 +
 
 +
== Installation ==
  
 
[[pacman|Install]] {{pkg|wordpress}} from the [[official repositories]].
 
[[pacman|Install]] {{pkg|wordpress}} from the [[official repositories]].
 +
 +
Wordpress also requires [[PHP]] and [[MySQL]] to be installed and configured. See the [[LAMP]] wiki article for more information.
 +
 +
{{note|As of August 2012, this article does not support using Wordpress with PostrgreSQL. Wordpress was designed to be used with mysql only. It is possible to use Wordpress with other databases such as PostgreSQL, through the use of a [http://wordpress.org/extend/plugins/postgresql-for-wordpress/ plugin] and a bit of work.}}
  
 
== Configuration ==
 
== Configuration ==
  
One must have a working [https://wiki.archlinux.org/index.php/PHP PHP] installation, a MySQL server and, obviously, a web server. Reference yourself to the [https://wiki.archlinux.org/index.php/LAMP LAMP] article of this wiki.
+
The configuration method used here assumes you are using Wordpress on a local network.
 +
 
 +
=== Host Config ===
 +
 
 +
Make sure your {{ic|/etc/hosts}} file is setup correctly. This will be important when accessing your Wordpress CMS from a local network. Your {{ic|/etc/hosts}} file should look something like the following,
 +
 
 +
{{bc|#<ip-address>  <hostname.domain.org>  <hostname>
 +
127.0.0.1      lithium.kaboodle.net    localhost lithium
 +
::1            lithium.kaboodle.net    localhost lithium}}
 +
 
 +
=== Configure apache ===
 +
 
 +
You will need to create a config file for apache to find your Wordpress install. Create the file and edit it your favorite text editor:
 +
 
 +
{{hc|# /etc/httpd/conf/extra/httpd-wordpress.conf|
 +
Alias /wordpress "/usr/share/webapps/wordpress"
 +
<Directory "/usr/share/webapps/wordpress">
 +
AllowOverride All
 +
Options FollowSymlinks
 +
Order allow,deny
 +
Allow from all
 +
php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:$
 +
</Directory>}}
 +
 
 +
Change {{ic|/wordpress}} in the first line to whatever you want. For example, {{ic|/myblog}} would require that you navigate to {{ic|http://hostname/myblog}} to see your Wordpress website.
 +
 
 +
Next edit the apache config file and add the following:
 +
 
 +
{{hc|# /etc/httpd/conf/httpd.conf|
 +
...
 +
Include conf/extra/httpd-wordpress.conf
 +
...
 +
}}
 +
 
 +
Now restart apache
 +
 
 +
{{bc|# rc.d restart httpd}}
 +
 
 +
=== Configure mysql ===
 +
 
 +
Mysql can be configured using a plethora of tools, but the most common are the command line or [http://www.phpmyadmin.net/home_page/index.php phpMyAdmin].
 +
 
 +
==== Using phpMyAdmin ====
 +
 
 +
See [[phpMyAdmin]] to install and configure phpMyAdmin.
 +
 
 +
In your webbrowser, navigate to your phpMyAdmin host and perform the following
 +
steps:
 +
 
 +
# Login to phpMyAdmin.
 +
# Click "user" and then click "Add user".
 +
# Give the popup window a name and a password.
 +
# Select "Create database with same name and grant all privileges".
 +
# Click the "Add user" button to create the user.
 +
 
 +
== Wordpress Installation ==
 +
 
 +
Once you have spent a couple of hours setting up your http server, php, and mysql, it is finally time to let Wordpress have its five minutes and install itself. So let us begin.
 +
 
 +
The Wordpress installation procedure will use the URL in the address field of your web browser as the default website URL. If you have navigated to http://localhost/wordpress, your website will be accessable from your local network, but it will be broken in appearance and function.
 +
 
 +
# Navigate to {{ic|http://hostname/wordpress}}.
 +
# Click the "Create a Configuration File" button.
 +
# Click the "Let's go!" button.
 +
# Fill in you database information created in the previous section
 +
# Click "Submit".
 +
 
 +
{{note|If you installed Wordpress from the Official repository, then this setup procedure will not have the correct permissions to create the wp-config.php file used by Wordpress. You will have to do this step yourself as root using information Wordpress will provide.}}
 +
 
 +
A page will appear saying Wordpress can not write the wp-config.php file. Copy the text in the edit box and open {{ic|/usr/share/webapps/wordpress/wp-config.php}} as root in your text editor. Paste the copied text into the editor and save the file.
 +
 
 +
Finally, Click "Run the install" and Wordpress will populate the database with your information. Once complete, you will be shown "Success!" page. Click the login button to finish your installation.
 +
 
 +
Now would be a good time to access your website from all your devices to be sure your Wordpress installation is setup correctly.
 +
 
 +
== Usage ==
  
=== Apache ===
+
=== Installing a plugin ===
  
Since wordpress installs files in /usr/share/webapps/wordpress you should add a configuration file.
+
=== Installing a theme ===
  
A basic example is:
+
=== Udptaing ===
/etc/httpd/conf/extra/httpd-wordpress.conf
+
  
        Alias /wordpress "/usr/share/webapps/wordpress"
+
== Troubleshooting ==
        <Directory "/usr/share/webapps/wordpress">
+
                AllowOverride All
+
                Options FollowSymlinks
+
                Order allow,deny
+
                Allow from all
+
                php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:$
+
        </Directory>
+
  
Additional configuration may be added to the file.
+
=== Appearance is broken (no styling) ===
  
Also you must include such configuration file on /etc/httpd/conf/httpd.conf by adding the line:
+
Your Wordpress website will appear to have no styling to it when viewing it in a web browser (desktop or mobile) that does not have its hostnames mapped to ip addresses correctly.
  
      Include conf/extra/httpd-wordpress.conf
+
This occurs because you used a url with the hostname of your server, instead of an ip address, when doing the initial setup and Wordpress has used this as the default website URL.
  
Now restart apache and it should work by addressing your browser to http://localhost/wordpress
+
To fix this, you will either need to edit your /etc/hosts file or setup a proxy server. For an easy to setup proxy server, see [http://www.phpmyadmin.net/home_page/index.php polipo], or if you want something with a little more configuration, see [https://wiki.archlinux.org/index.php/Squid Squid].
  
=== Cherokee ===
+
== Tips and tricks ==
  
* Can't install plugins, themes ... (using cherokee web server)
+
== See also ==
# cd /srv/http/
+
* [[Wikipedia:WordPress|Wordpress]]
# chown -R http wordpress
+
* [[Wikipedia:Content management system|Content management system]]

Revision as of 10:35, 19 August 2012

Summary help replacing me
Wordpress is an easy to setup and administer FLOSS content management system featuring a strong and vibrant community with thousands of plugins and themes.
Related
LAMP
PHP
MySQL
phpMyAdmin

Wordpress is the goto Free Libre Open Source Software (FLOSS) content managment system (CMS) created by Matt Mullenweg and first released in 2003. Wordpress has a vast and vibrant community that provides tens of thousands of free plugins and themes to allow the user to easily customize the appearance and function of their Wordpress CMS. Wordpress is licensed under the GPLv2.

The biggest feature of Wordpress is its ease in configuration and administration. Setting up a Wordpress site takes five minutes. The Wordpress administration panel allows users to easily configure almost every aspect of their website including fetching and installing plugins and themes. Wordpress provides effortless automatic updates.

Installation

Install wordpress from the official repositories.

Wordpress also requires PHP and MySQL to be installed and configured. See the LAMP wiki article for more information.

Note: As of August 2012, this article does not support using Wordpress with PostrgreSQL. Wordpress was designed to be used with mysql only. It is possible to use Wordpress with other databases such as PostgreSQL, through the use of a plugin and a bit of work.

Configuration

The configuration method used here assumes you are using Wordpress on a local network.

Host Config

Make sure your /etc/hosts file is setup correctly. This will be important when accessing your Wordpress CMS from a local network. Your /etc/hosts file should look something like the following,

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       lithium.kaboodle.net    localhost lithium
::1             lithium.kaboodle.net    localhost lithium

Configure apache

You will need to create a config file for apache to find your Wordpress install. Create the file and edit it your favorite text editor:

# /etc/httpd/conf/extra/httpd-wordpress.conf
Alias /wordpress "/usr/share/webapps/wordpress"
<Directory "/usr/share/webapps/wordpress">
	AllowOverride All
	Options FollowSymlinks
	Order allow,deny
	Allow from all
	php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:$
</Directory>

Change /wordpress in the first line to whatever you want. For example, /myblog would require that you navigate to http://hostname/myblog to see your Wordpress website.

Next edit the apache config file and add the following:

# /etc/httpd/conf/httpd.conf
...
Include conf/extra/httpd-wordpress.conf
...

Now restart apache

# rc.d restart httpd

Configure mysql

Mysql can be configured using a plethora of tools, but the most common are the command line or phpMyAdmin.

Using phpMyAdmin

See phpMyAdmin to install and configure phpMyAdmin.

In your webbrowser, navigate to your phpMyAdmin host and perform the following steps:

  1. Login to phpMyAdmin.
  2. Click "user" and then click "Add user".
  3. Give the popup window a name and a password.
  4. Select "Create database with same name and grant all privileges".
  5. Click the "Add user" button to create the user.

Wordpress Installation

Once you have spent a couple of hours setting up your http server, php, and mysql, it is finally time to let Wordpress have its five minutes and install itself. So let us begin.

The Wordpress installation procedure will use the URL in the address field of your web browser as the default website URL. If you have navigated to http://localhost/wordpress, your website will be accessable from your local network, but it will be broken in appearance and function.

  1. Navigate to http://hostname/wordpress.
  2. Click the "Create a Configuration File" button.
  3. Click the "Let's go!" button.
  4. Fill in you database information created in the previous section
  5. Click "Submit".
Note: If you installed Wordpress from the Official repository, then this setup procedure will not have the correct permissions to create the wp-config.php file used by Wordpress. You will have to do this step yourself as root using information Wordpress will provide.

A page will appear saying Wordpress can not write the wp-config.php file. Copy the text in the edit box and open /usr/share/webapps/wordpress/wp-config.php as root in your text editor. Paste the copied text into the editor and save the file.

Finally, Click "Run the install" and Wordpress will populate the database with your information. Once complete, you will be shown "Success!" page. Click the login button to finish your installation.

Now would be a good time to access your website from all your devices to be sure your Wordpress installation is setup correctly.

Usage

Installing a plugin

Installing a theme

Udptaing

Troubleshooting

Appearance is broken (no styling)

Your Wordpress website will appear to have no styling to it when viewing it in a web browser (desktop or mobile) that does not have its hostnames mapped to ip addresses correctly.

This occurs because you used a url with the hostname of your server, instead of an ip address, when doing the initial setup and Wordpress has used this as the default website URL.

To fix this, you will either need to edit your /etc/hosts file or setup a proxy server. For an easy to setup proxy server, see polipo, or if you want something with a little more configuration, see Squid.

Tips and tricks

See also