WordPress: Difference between revisions

From Alpine Linux
(Created page with '== Set up WordPress on Alpine Linux == 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 * M...')
 
(replace /etc/init.d with rc-service)
 
(28 intermediate revisions by 12 users not shown)
Line 1: Line 1:
== Set up WordPress on Alpine Linux ==
[https://wordpress.org/ WordPress] is web software you can use to create a beautiful website or blog. For Wordpress a bunch of [https://wordpress.org/extend/plugins/ plugins] are available.


This document will be a quick c/p guide to setup WordPress on Alpine linux. What we will setup is the following:
== Install lighttpd, PHP, and MySql ==
{{:Setting Up Lighttpd With FastCGI}}


* Lighttpd with PHP
Install extra packages:
* MySql
{{Cmd|apk add wget mysql mysql-client php82-mysqli}}
* WordPress


== Install lighttpd, PHP, and MySql ==
Restart Lighttpd:
{{Cmd|rc-service lighttpd restart}}


  apk add nano php php-mysql mysql mysql-client lighttpd
== Installing and configuring WordPress ==


== Configuring Lighttpd==
Create a directory named {{Path|webapps}}


'''Edit lighttpd.conf'''
{{Cmd|mkdir -p /usr/share/webapps/}}


nano +46 /etc/lighttpd/lighttpd.conf
Download the latest Wordpress source files


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


uncoment    include "mod_fastcgi.conf", save and exit
Unpack the archive and delete it afterwards


== Installing and configuring  WordPress ==
{{Cmd|tar -xzvf latest.tar.gz
rm latest.tar.gz}}


'''Install WordPress'''
Change the folder persmissions


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


  cd /var/www/localhost/htdocs/
Create a symlink to the {{Path|wordpress}} folder
  wget http://wordpress.org/latest.tar.gz


Unpack
{{Cmd|ln -s /usr/share/webapps/wordpress/ /var/www/localhost/htdocs/wordpress}}


  tar -xzvf latest.tar.gz
== Config and start MySql ==
 
== Starting ==
'''Starting http and sql server and adding to boot'''


/etc/init.d/lighttpd start && rc-update add lighttpd default
{{Cmd|<nowiki>/usr/bin/mysql_install_db --user=mysql
rc-service mariadb start && rc-update add mariadb default
/usr/bin/mysqladmin -u root password 'password'</nowiki>}}
== Config MySql ==
(Change the 'password' to a strong password)


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


'''Create the WordPress database'''
{{Cmd|mysql -u root -p}}


mysql -u root -p 'password'
{{Cmd|CREATE DATABASE wordpress;
 
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'wordpress password';
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO "root";
FLUSH PRIVILEGES;
FLUSH PRIVILEGES;
EXIT
EXIT}}
(Change the 'wordpress password' to a strong password)


== Config your WordPress ==
== Config your WordPress ==


Browse
Browse to
<nowiki>http://WEBSERVER_IP_ADDRESS/wordpress/</nowiki>


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_


  click on: "Create a Configuration File"
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.
  click on: "Let’s go!"
After you've done that, click "Run the install."


* Enter Information as needed


  Database Name: wordpress
:* Site Title
  User Name: root
:* Username
  Password: the MySQL password
:* Password, twice
  Database Host: localhost
:* Your E-mail
  Table Prefix: wp_


  You may need create the wp-config.php manually then copy and paste the following text into it.
After you've done that, click "Install WordPress"  
  After you've done that, click "Run the install."
 
  Enter Information 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 <nowiki>http://WEBSERVER_IP_ADDRESS/wordpress</nowiki> and enjoy!


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

Latest revision as of 09:47, 17 November 2023

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 mysql mysql-client php82-mysqli

Restart Lighttpd:

rc-service 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 https://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 rc-service mariadb start && rc-update add mariadb default /usr/bin/mysqladmin -u root password 'password'

(Change the 'password' to a strong 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

(Change the 'wordpress password' to a strong password)

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!