WordPress: Difference between revisions

From Alpine Linux
(Category:SQL)
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Set up WordPress on Alpine Linux ==
[http://wordpress.org/ WordPress] is web software you can use to create a beautiful website or blog. For Wordpress a bunch of [http://wordpress.org/extend/plugins/ plugins] are available.
 
WordPress is web software you can use to create a beautiful website or blog.  
 
This document will be a quick c/p guide to setup WordPress on Alpine linux. What we will setup is the following:
 
* Lighttpd with PHP
* MySql
* WordPress


== Install lighttpd, PHP, and MySql ==
== Install lighttpd, PHP, and MySql ==
Line 13: Line 5:


Install extra packages:
Install extra packages:
{{Cmd|apk add php-mysql mysql mysql-client}}
{{Cmd|apk add wget php5-mysql mysql mysql-client php5-zlib}}
 
Restart Lighttpd:
{{Cmd|/etc/init.d/lighttpd restart}}


== Installing and configuring  WordPress ==
== Installing and configuring  WordPress ==


'''Install WordPress'''
Create a directory named {{Path|webapps}}


Make webapps folder
{{Cmd|mkdir -p /usr/share/webapps/}}


{{Cmd|mkdir /usr/share/webapps/ -p}}
Download the latest Wordpress source files
 
Download  


{{Cmd|cd /usr/share/webapps/
{{Cmd|cd /usr/share/webapps/
wget http://wordpress.org/latest.tar.gz}}
wget http://wordpress.org/latest.tar.gz}}


Unpack  
Unpack the archive and delete it afterwards


{{Cmd|tar -xzvf latest.tar.gz
{{Cmd|tar -xzvf latest.tar.gz
rm latest.tar.gz}}
rm latest.tar.gz}}


Change Folder Persmissions
Change the folder persmissions


{{Cmd|chown -R lighttpd /usr/share/webapps/wordpress}}
{{Cmd|chown -R lighttpd /usr/share/webapps/}}


Make symlinks to WordPress
Create a symlink to the {{Path|wordpress}} folder


{{Cmd|ln -s /usr/share/webapps/wordpress/ /var/www/localhost/htdocs/wordpress}}
{{Cmd|ln -s /usr/share/webapps/wordpress/ /var/www/localhost/htdocs/wordpress}}
Line 44: Line 37:


{{Cmd|<nowiki>/usr/bin/mysql_install_db --user=mysql
{{Cmd|<nowiki>/usr/bin/mysql_install_db --user=mysql
/etc/init.d/mysql start && rc-update add mysql default
/etc/init.d/mariadb start && rc-update add mariadb default
/usr/bin/mysqladmin -u root password 'password'</nowiki>}}
/usr/bin/mysqladmin -u root password 'password'</nowiki>}}


'''Create the WordPress database'''
==Create the WordPress database==


{{Cmd|mysql -u root -p}}
{{Cmd|mysql -u root -p}}
Line 58: Line 51:
== Config your WordPress ==
== Config your WordPress ==


Browse
Browse to
 
http://WEBSERVER_IP_ADDRESS/wordpress/
http://WEBSERVER_IP_ADDRESS/WordPress/


* Click on: "Create a Configuration File"
* Click on: "Create a Configuration File"
Line 73: Line 65:
After you've done that, click "Run the install."
After you've done that, click "Run the install."


* Enter Information needed
* Enter Information as needed


:* Site Title
:* Site Title

Revision as of 10:12, 9 October 2017

WordPress is web software you can use to create a beautiful website or blog. For Wordpress a bunch of plugins are available.

Install lighttpd, PHP, and MySql

Basic Installation

For installing the additional packages first activate community packages and update the package index

Install the required packages:

# apk add lighttpd php82 fcgi php82-cgi

Configure Lighttpd

Edit lighttpd.conf (/etc/lighttpd/lighttpd.conf) and uncomment the line:

Contents of /etc/lighttpd/lighttpd.conf

... include "mod_fastcgi.conf" ...

Edit mod_fastcgi.conf (/etc/lighttpd/mod_fastcgi.conf), find and change /usr/bin/php-cgi to /usr/bin/php-cgi82.

Contents of /etc/lighttpd/mod_fastcgi.conf

... "bin-path" => "/usr/bin/php-cgi82" # php-cgi ...

Start lighttpd service and add it to default runlevel

# rc-service lighttpd start # rc-update add lighttpd default

Install extra packages:

apk add wget php5-mysql mysql mysql-client php5-zlib

Restart Lighttpd:

/etc/init.d/lighttpd restart

Installing and configuring WordPress

Create a directory named webapps

mkdir -p /usr/share/webapps/

Download the latest Wordpress source files

cd /usr/share/webapps/ wget http://wordpress.org/latest.tar.gz

Unpack the archive and delete it afterwards

tar -xzvf latest.tar.gz rm latest.tar.gz

Change the folder persmissions

chown -R lighttpd /usr/share/webapps/

Create a symlink to the wordpress folder

ln -s /usr/share/webapps/wordpress/ /var/www/localhost/htdocs/wordpress

Config and start MySql

/usr/bin/mysql_install_db --user=mysql /etc/init.d/mariadb start && rc-update add mariadb default /usr/bin/mysqladmin -u root password 'password'

Create the WordPress database

mysql -u root -p

CREATE DATABASE wordpress; GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'wordpress password'; FLUSH PRIVILEGES; EXIT

Config your WordPress

Browse to http://WEBSERVER_IP_ADDRESS/wordpress/

  • Click on: "Create a Configuration File"
  • Click on: "Let’s go!"
  • Database Name: wordpress
  • User Name: wordpress
  • Password: <wordpress password>
  • Database Host: localhost
  • Table Prefix: wp_

You may need create the wp-config.php manually, so modify define the 'DB_NAME', DB_USER and DB_PASSWORD, then copy and paste the text into it. After you've done that, click "Run the install."

  • Enter Information as needed
  • Site Title
  • Username
  • Password, twice
  • Your E-mail

After you've done that, click "Install WordPress"

You have WordPress working, to access go to http://WEBSERVER_IP_ADDRESS/wordpress and enjoy!