WordPress
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
For installing the additional packages first activate community packages:
vi /etc/apk/repositories
Uncomment the following:
http://pkg.example.com/alpine/v3.11/community
Update the packagelist:
apk update
Install the additional packages:
apk add lighttpd php7-common php7-session php7-iconv php7-json php7-gd php7-curl php7-xml php7-mysqli php7-imap php7-cgi fcgi php7-pdo php7-pdo_mysql php7-soap php7-xmlrpc php7-posix php7-mcrypt php7-gettext php7-ldap php7-ctype php7-dom php7-simplexml
Configure Lighttpd
Edit lighttpd.conf
vi /etc/lighttpd/lighttpd.conf
Uncomment line:
include "mod_fastcgi.conf"
Start lighttpd service and add to needed 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!