Apache 101: 0-WordPress in 15 minutes

Apache gets an undeserved bad rep from outdated guides—learn to set it up right. …

Hellfire missiles not included.

Enlarge / Hellfire missiles not included.

reader comments

95 with 52 posters participating, including story author

Recently, we took a look at the Caddy Web server. Today, we’re going to back things up a little bit and look at the A from the classic LAMP stack: the Apache Web server.

Apache has a bad reputation for being old, crusty, and low-performance—but this idea mostly stems from the persistence of ancient guides that still show users how to set it up in extremely antiquated ways. In this guide, we’re going to set up an Ubuntu 20.04 droplet at Digital Ocean with an Apache Web server set up properly and capable of handling serious levels of traffic.

Installation

After spinning up a new $5/mo VM (Digital Ocean calls them “droplets”), the first thing we’ll do is what anyone should do with any brand-new Linux server. We check for and then install upgrades, and—since one of them was a new Linux kernel version—reboot the server.

root@apache:~# apt update
root@apache:~# apt dist-upgrade
root@apache:~# shutdown -r now

With that bit of minor housekeeping out of the way, it’s time to install Apache itself and the PHP language that most Web applications require.

root@apache:~# apt install apache2 php-fpm

Friends don’t let friends use mod_php inappropriately

I want to make incredibly clear what we have not installed—we did not, and will not, install the mod_php Apache module.

root@apache:~# apt policy libapache2-mod-php
libapache2-mod-php:
Installed: (none)
Candidate: 2:7.4+75
Version table:
2:7.4+75 500
500 http://mirrors.digitalocean.com/ubuntu focal/main amd64 Packages

The mod_php module was, once upon a time, the favored way to integrate PHP support into your Web server. It, by and large, replaced the older CGI (Common Gateway Interface)

Continue reading – Article source

Similar Posts: