WordPress on Ubuntu 16.04 With Caddy

Sep 26, 2017

WordPressis a famous content management system based on PHP and MySQL, distributed under the terms of the GNU GPLv2 (or later). In most cases it is installed by using Apache or NGINX as web servers, ili, as we explained inOvo uputstvo za, it can run on an isolated environment like Docker containers.

Alongside these choices, there is a new web server which is rapidly gaining popularity:Caddy.

Caddy(or Caddy web server), is an open source, HTTP/2 web server which enables HTTPS by default, without requiring external configuration. Caddy also has a strong integration withLet’s Encrypt.

This tutorial explains how to install and configure WordPress on top of your Caddy web server, installed followingour guide.

Install PHP

As we said in the introduction, WordPress requires a web server, MySQL and PHP. pre svega, install PHP and the extensions required by WordPress, by executing the following command:

Once that step is complete you can access theMariaDBdatabase with your password:

$ mysql -u root -p

Create New Database and User

Start the MariaDB shell:

$ mysql -u root -p

Use the MariaDB prompt to create a new database for WordPress. U ovom predavanju, we use wordpressdb as the database name, and wordpressusr as the username for the WP installation. So our code looks like this:

Napomena: [email protected]is the email address that will be used for Let’s Encrypt certificate request.

Restart Caddy:

# systemctl restart caddy

As a last step, with a web browser, go to your website. This will start the WordPress GUI installation wizard which will finish the installation process and give you access to the WordPress dashboard.

Zaključak

At the end of the previous steps, a new WordPress instance will run on top of this new, tiny and powerful web server. Caddy will require certificates from Let’s Encrypt and enable automatically HTTPS connections, without any other manual configuration.