Jump to content

RefractSurvey Automated Server Setup

From Pixel Refraction Studio

If you've got a bare Debian or Ubuntu server (even a small one) and want RefractSurvey running on it with HTTPS, refractsurvey_server/prereqs.sh does the whole job for you interactively — no need to hand-install Apache, PHP, or a database first.

This is a technical, server-administration page. If you already have a server set up with PHP/MySQL and just want to drop RefractSurvey onto it, see Getting Started instead.

What it does

Run it as root (or with sudo) from the unzipped release:

sudo refractsurvey_server/prereqs.sh

It interactively walks through:

  • Installing Apache, PHP 8.1+ (with the extensions RefractSurvey needs), and Certbot
  • Choosing between a local database (the script installs and hardens MariaDB right there on the box) or a remote one (an existing MySQL/MariaDB server elsewhere — the script skips local database installation entirely and just helps confirm you can reach it)
  • Setting up a new Apache virtual host for your domain
  • Requesting a free HTTPS certificate from Let's Encrypt for that domain
  • Copying the RefractSurvey application files into place

What it deliberately doesn't do

prereqs.sh stops short of creating the RefractSurvey database itself, the database user, or loading the schema — on either a local or remote database. That part happens in-browser, through install.php's own setup wizard, once this script finishes. The script prints a summary at the end with the database host and admin credentials to feed into that wizard.

In other words: this script gets a server ready to install RefractSurvey onto; the actual install wizard (see Getting Started) is still a separate, final step.

Local vs. remote database

If you tell the script you're using a remote database (one you already run elsewhere), it won't touch MariaDB on the local box at all — it'll only help you verify connectivity. Keep in mind a remote database server needs to be configured to accept connections from this machine specifically, both in its network settings and its user grants.

See also