Code source for the TEDxINSA website. The website uses the Wordpress PHP framework with a theme based off twg/TEDxTheme. It follows modern Wordpress practices by using Bedrock and [Composer].
This section describes how to install the website locally.
References
The production server runs Debian 9, but you should be able to install the website on any system as long as you have the following requirements installed:
- nginx (optional)
- php-fpm 7
- MariaDB
- composer
mysqlextension for PHP: For Debian, install thephp-mysqlpackage.
We first need to create a MariaDB database. For the local installation, we'll create just one.
Note: The production server uses two databases: one for beta.tedxinsa.com and one for tedxinsa.com.
We will use the following values for the parameters:
- MariaDB user:
tedxinsa - MariaDB password:
password01CHANGE THE PASSWORD!!! - MariaDB database:
tedxinsadb - MariaDB port:
3306(this is the default port) - MariaDB host:
localhost(requires the DB and PHP engine to be one the same machine)
Follow the general MariaDB configuration (enable full Unicode support).
Open a command line session with the MariaDB root user (this not the Linux root user).
mysql --user=root -p
The execute the following commands. Adapt the values as needed.
CREATE USER 'tedxinsa'@'localhost' IDENTIFIED BY 'password01';
CREATE DATABASE IF NOT EXISTS tedxinsadb;
GRANT ALL PRIVILEGES ON tedxinsadb.* TO 'tedxinsa'@'localhost';
FLUSH PRIVILEGES;Example:
MariaDB [(none)]> CREATE USER 'tedxinsa'@'localhost' IDENTIFIED BY 'password01';
Query OK, 0 rows affected (0.10 sec)
MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS tedxinsadb;
Query OK, 1 row affected (0.04 sec)
MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS tedxinsadb;
Query OK, 1 row affected (0.04 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON tedxinsadb.* TO 'tedxinsa'@'localhost';
Query OK, 0 rows affected (0.04 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.04 sec)
Check that the following line is enabled in /etc/php/php.ini:
extension=mysqli.so
Copy the template .env.example to .env and then edit these values:
# Possible values: development production
WP_ENV=development
# Set the external URI of the root of the website (make sure to add an entry in your `/etc/hosts` file)
WP_HOME=https://tedxinsa.localhost
Install the dependencies by running the following command in the project directory.
# Run as a normal user
composer installYou can optionally configure nginx to handle SSL, caching, virtual hosts, etc. You don't need it for development, but it may help you to reproduce a production environment. See DEPLOYMENT. Use a self-signed certificate.
Simply make sure that nginx, php-fpm and mariadb are running, and visit the localhost domain for
the project.
# Run as root
systemctl start nginx
systemctl start php-fpm
systemctl start mariadbDuring the first connection, you will have to configure Wordpress. This section describes the configuration used by the production website. Alternatively, use a restore a backup. See below.
- Select a default language
- Choose
Français
- Choose
- Titre du site
TEDxINSA: Check the capitalization
- Identifiant
admintedxinsa: DO NOT USE YOUR PERSONAL ACCOUNT!
- Mot de passe
- Generate and store it with Keeweb to the association's passwords file
- Adresse de messagerie:
- Visibilité pour les moteurs de recherche
- Keep the default (unchecked)
- In the administration panel, choose the TEDx theme.
You can create a backup of the database and files by running tools/backup.sh from the
project root. It will create an archive in the backups directory.
To restore the backup, run tools/restore.sh path/to/backup.tgz (example:
tools/restore.sh 2017-11-06.AZsdgU6t5Cnwr5L5z4dfoarHZ4VpwU5y.tgz).
You should only modify the content of the config and web directories.
You should be mainly interested in the content of the web/app/themes/tedx-insa directory where the
them is defined. It extends the twg/TEDxTheme theme, so any missing file
fallbacks to their theme.
See DEPLOYMENT for the production configuration and deployment.