META

Install your own webserver

Windows, with XAMPP

Install XAMPP

XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be easy to install and to use.

If you see this warning, don’t choose to install XAMPP in C:\Program Files in the next steps!

Configure XAMPP

To start using your brand new server, you can just click on the Start button for Apache and MySQL in the XAMPP control panel.

Note

If there aren’t many users going to use Ramses at the same time, you don’t need the MySQL part of the server, you can just ignore it. You’ll just have to set Ramses to use SQLite when installing it later.

The Admin button next to MySQL will send you directly to http://localhost/phpmyadmin where you can manage your MySQL database. Don’t worry, what you’ll need to do with that when installing the Ramses Server is explained in the Ramses Server installation guide.

You may like your Apache and MySQL servers to start automatically with windows when using Ramses, let’s do that! Just click on Config.

Now check the Autostart of modules boxes for Apache and MySQL, and Save.

If you have an alert saying Cannot create file "". Forbidden acess, close the XAMPP control panel, and restart it as administrator (right-click the start menu entry and select “run as administrator”).

Now the server will start automatically with XAMPP. Let’s just make XAMPP start with windows.

Then, right click inside this folder and select Paste a shortcut, and voilà!

Now you can safely install the Ramses Server. You will have to install it in the htdocs subfolder of the installation folder of XAMPP (C:\xampp\htdocs in our example).

Warning

XAMPP is not meant to serve your data to the internet! You can safely use it to test and use Ramses locally, but if you want to give it access to the internet, you’ll have to secure it first (set a password for the root user of MySQL and phpMyAdmin, and secure the FTP and other servers if you’ve installed them). Read the FAQ of XAMPP to learn more (this link is available only if your Apache server is running).

Debian, Ubuntu and other debian-based Linux

This step by step procedure should work on any Linux distribution provided with aptitude like Ubuntu and Debian to install packages. Note that installing a standard web server on Linux is not difficult and there are a lot of resources about it online.

Hint

If you have enough trust in us, you can just copy the bash script we provide at the end of the procedure and run that.

Before installing any new software on your system, it’s a good idea to update already installed packages:

sudo apt update
sudo apt upgrade

Install Apache, the web server

sudo apt install apache2

Test Apache by going to http://localhost or http://127.0.0.1

Server files are located in /var/www/ and configurations files are in /etc/apache2/ (he main file is apache2.conf)

It suppresses some warning info to add a server name in the configuration file. Edit /etc/apache2/sites-available/000-default.conf as root) to uncomment/add the line ServerName localhost.

Starting and stopping Apache (it automatically starts during system boot by default)

# stop
sudo apachectl stop
# start
sudo apachectl start

Install PHP

Install PHP with a few additional components needed by Ramses and your new Apache web server.

sudo apt install php php-mysql libapache2-mod-php php-dev php-sqlite3

Check if PHP is working

php -version

You may need to enable the Apache php module

sudo a2dismod mpm_event && sudo a2enmod mpm_prefork && sudo a2enmod php7.4
# change the php version if not 7.4

Test PHP by creating a /var/www/html/phptest.php file containing <?php phpinfo(); ?>, and navigate to http://localhost/phptest.php.

You can create this file quickly with the command line too:

echo "<?php phpinfo() ?>" | sudo tee -a /var/www/html/phptest.php > /dev/null

Install MySQL

Note

If there aren’t many users going to use Ramses at the same time, you don’t need MySQL, you can just ignore this part. You’ll just have to set Ramses to use SQLite when installing it later.

sudo apt install mysql-server

You will need to set the root password; first, connect to MySQL:

sudo mysql -u root -p
# blank password

Set password:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'P@ssw0rd';

Keep this password somewhere, it’s the one you will need to manage the database.

Exit MySQL with exit.

Install phpMyAdmin

phpMyAdmin is a nice tool to manage your MySQL databases that will help you prepare the Ramses Server.

sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl

You have a few options to choose when prompted by the installer.

Warning

Warning: When the prompt appears, “apache2” is highlighted, but not selected. If you do not hit SPACE to select Apache, the installer will not move the necessary files during installation. Hit SPACE, TAB, and then ENTER to select Apache.

If you missed this step, the easiest way to fix it is just to purge the installation of phpMyAdmin before starting it again:

bash sudo apt purge phpmyadmin sudo apt install phpmyadmin

Enable the needed PHP extension:

sudo phpenmod mbstring

Restart Apache:

sudo systemctl restart apache2

phpMyAdmin is available at http://localhost/phpmyadmin

Installation script

Here is a bash script to automate all of these. Copy it into a text file with the .sh extension, make it executable then run it from a terminal with ./theScipt.sh.

Be careful as the included installation of phpMyAdmin will prompt a few questions, read just above to be sure what you need to answer.

#!/bin/bash

sudo apt update
sudo apt upgrade

# Apache
sudo apt install apache2
# PHP
sudo apt install php php-mysql -libapache2-mod-php php-dev
# NOTE: you may need to change the version of PHP here:
sudo a2dismod mpm_event && sudo a2enmod mpm_prefork && sudo a2enmod php7.4

echo "<?php phpinfo() ?>" | sudo tee -a /var/www/html/phptest.php > /dev/null

# MySQL
sudo apt install mysql-server
# The the password to the root user to be 'admin'
sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'admin';"
# Add a non-root user
sudo mysql -u root -padmin -e "CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin';"
sudo mysql -u root -padmin -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;"

# phpMyAdmin
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
sudo phpenmod mbstring

# Restart apache
sudo systemctl restart apache2

echo " === FINISHED ! === "
echo "Test Apache at http://localhost"
echo "Test php at http://localhost/phptest.php"
echo "MySQL installed. User 'root' has password 'admin'."
echo "Sometimes you need a non-root user. Created MySQL user 'admin' with password 'admin'"
echo "You may change these passwords and manage the MySQL databases with phpMyAdmin: http://localhost/phpmyadmin

MySQL: Preparing the database

If you need to use MySQL (for better performance with many users), here’s a simple guide to configure your first database.

Whether you’ve installed your own web server (maybe by following our procedure in order to test the Beta Version of Ramses without using an online server) or you’ve order a shared or private hosting, you will need to create a database to be used by Ramses on the MySQL server.

Most of the time, you can do this with phpMyAdmin, although the procedure can be different depending on your web hosting provider, some of them having their own interface to create and configure new databases. Here are some explanations about how to do that with phpMyAdmin.