WordPress is one of the top most used CMS systems in the world. Its successful adoption has been made possible by its open source nature. WordPress is licensed under GPLv2 and has plenty of themes and plugins thus making it simple to customize. In this tutorial i’ll show show full steps on how to setup wordpress on Arch and configuring php and mysql database. WordPress is easy to customize and administer yet very powerful content management system.
Install wordpress on Arch Linux with this straightforward process which can be done by issuing few commands on the terminal. So let’s get started.

Setup wordpress and configure

  1. Install Apache Web server

# pacman -Sy apache

Start Apache

# systemctl start httpd

Enable apache to start at boot

# systemctl start httpd
  1. Install Php

# pacman -Sy php php-{cgi,gd,pgsql}

Sample output:

root@darkpy:pts/5-> /root (0)
> sudo pacman -Sy php php-{cgi,gd,pgsql}
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
archlinuxfr is up to date
archlinuxcn is up to date
warning: php-7.0.7-1 is up to date -- reinstalling
warning: php-gd-7.0.7-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Packages (4) php-7.0.7-1 php-cgi-7.0.7-1 php-gd-7.0.7-1 php-pgsql-7.0.7-1
Total Download Size: 2.06 MiB
Total Installed Size: 24.44 MiB
Net Upgrade Size: 9.18 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages...
php-cgi-7.0.7-1-x86_64 2.0 MiB 490K/s 00:04 [######################] 100%
php-pgsql-7.0.7-1-x... 52.6 KiB 202K/s 00:00 [######################] 100%
(4/4) checking keys in keyring [######################] 100%
(4/4) checking package integrity [######################] 100%
(4/4) loading package files [######################] 100%
(4/4) checking for file conflicts [######################] 100%
(4/4) checking available disk space [######################] 100%
:: Processing package changes...
(1/4) reinstalling php [######################] 100%
(2/4) installing php-cgi [######################] 100%
(3/4) reinstalling php-gd [######################] 100%
(4/4) upgrading php-pgsql [######################] 100%
:: Running post-transaction hooks...
(1/1) Updating manpage index...
  1. Install MariaDB database service

# pacman -S libmariadbclient mariadb mariadb-clients

Set base configurations

# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Start and enable MariaDB

# systemctl enable mysqld.service
# systemctl start mysqld.service

Setup Root password for MariaDB

# mysql_secure_installation

See picture below for details:
If you did upgrade, just type:

# mysql_upgrade -u root -p
  1. Confirm to make sure you’ve correct /etc/hosts file configured. This is crucial if you’re accessing WordPress site on LAN with domain.
# cat /etc/hosts

My output is as shown below

#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
  1. Configure PHP

# vim /etc/httpd/conf/httpd.conf

Comment the line below:

#LoadModule mpm_event_module modules/mod_mpm_event.so

Uncomment below line:

LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

Place below line in the LoadModule list just after LoadModule dir_module modules/mod_dir.so:

LoadModule php7_module modules/libphp7.so
install wordpress
At the end of include list, add:
Include conf/extra/php7_module.conf

install wordpress
Enable mysqli and gd modules:

# vim /etc/php/php.ini

Make sure below lines are uncommented

extension=mysqli.so
extension=gd.so

install wordpress

Restart Apache:

# systemctl restart httpd

Then:

# mysql -u root -p$password

You’ll drop on Mysql cli terminal:

# mysql -u root -p$password
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 4
Server version: 10.1.14-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MariaDB [(none)]>

Create Database and database user and Grant privileges:

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

Remember to change WordPress user and database name accordingly.

  1. Install wordpress

# cd /srv/http/
# wget https://wordpress.org/latest.tar.gz# tar xvzf latest.tar.gz
# cd wordpress

 

Modify group ownership of wordpress to http

# chown -R root:http /srv/http/wordpress

Create and modify configuration file

# cd /srv/http/wordpress
# cp wp-config-sample.php wp-config.php

Edit wp-config.php to configure Database user, database name, and database password:

# vim wp-config.php

Modify to look like below

/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');
/** MySQL database username */
define('DB_USER', 'wordpressuser');
/** MySQL database password */
define('DB_PASSWORD', 'password');

See below screenshot.

install wordpress

  1. Open wordpress on browser

You’re done with installation of wordpress, to access it just type below url on our favorite browser

http://localhost/wordpress

You’ll see window like one shown below

install wordpress

Set:

  • Blog Title
  • Password
  • user to login

Then Login

  1. Installing WordPress Template

Download Best WordPress templates from http://themeforest.net/?ref=josemutai
Download theme you like then go to:
Dashboard > Appearance > Themes > Add New > Add Themes > Upload Theme > Browse > Choose File, then locate .zip theme file and upload it.

Conclusion

We’ve covered how to setup wordpress and configured everything on Arch Linux needed for wordpress to run and host site. You can now customize wordpress and add any plugin you want but be careful on the number of plugins you enable since they can drastically impact negatively on your site.

SHARE
Previous articleBackbox Linux 4.6 Released Download
Next articleTop best KDE Plasma themes and icons
I'm a fan of Linux and open source enthusiast with bachelor's degree in Electrical and Communications Engineering.The Swiss Army Knife syndrome makes me an expert in the fields of Virtualization, Cloud Computing,VoIP,Linux Containers and Server Hardening. Currently i have the following certifications: 1. LPI 2. SUSE Certified Linux Administrator ( CLA) 3. SUSE Certified Linux Professional ( CLP) 4. CCNA And working on RHCSA, RHCE, RHCVA, and Openstack Cloud Certification. I have a strong desire to learn, develop, and share knowledge with others.
  • My brother recommended I would possibly like this web site.

    He was once totally right. This put up truly made my day. You cann’t believe simply how much time I had spent for this
    info! Thank you!

  • Hey! Do you use Twitter? I’d like to follow you if
    that would be ok. I’m definitely enjoying your blog and look forward
    to new posts.

  • Heya just wanted to give you a quick heads up and let
    you know a few of the pictures aren’t loading correctly. I’m not sure why but I think its a linking issue.
    I’ve tried it in two different web browsers and both show the same
    results.