Purpose
This document will serve as a series of alternate instructions for those that which to use Apache 2 rather than NGinx as their web server.
But why?
My server hosts other software, and already had Apache2 installed. Why not publish my notes?
Requirements/Assumptions
- Comfortable enough to run the commands found here: DigitalOcean Self-Install - AresMUSH
- Apache2 installed on your server.
- mod_rewrite installed (
a2enmod rewrite
) - mod_proxy installed (
a2enmod proxy
) - mod_proxy_http installed (
a2enmod proxy_http
)
- mod_rewrite installed (
- Apache2 is already hosting another site (while this isn’t strictly necessary, some of the steps in this document will be overkill – that said, it will all still work)
Instructions
How to use these instructions
These instructions will interrupt the instructions found in DigitalOcean Self-Install - AresMUSH with additional steps (usually by editing the files found there, and adding additional steps). The document will call out which steps in the Tutorial it will interrupt, and which steps to take.
- Set Up the Server
- Step 2
- After
chmod +x setup_server
:- In
setup_server
:- Disable nginx install by commenting out the following lines:
apt-get install -y nginx
- In
- After
- Step 2
- Install the Game
- Step 2
- After
chmod +x install
:- In
install
:- Disable the symbolic link to the web install by commenting the following lines:
cd /var/www/html/ ln -s "${HOME_DIR}/aresmush/game" game
- Disable the web configuration by commenting the following lines:
cp "${HOME_DIR}/aresmush/install/nginx.default" /etc/nginx/sites-available/default sudo service nginx restart
- Disable the
startares
command by commenting the following line:bin/startares
- Disable the symbolic link to the web install by commenting the following lines:
- In
- After
./install
:- Choose and create your web deployment directory (we will choose
/var/www/myaresmush.com
for this document.) - Within your web deployment directory, create a symbolic link to the game directory
cd /var/www/myaresmush.com ln -s /home/ares/aresmush/game game
- In
ares-webportal/bin/deploy
- Change
/var/www/html
on the last line to the web deployment directory.
- Change
- Update your apache site conf
-
Ubuntu 22.04 users will edit
/etc/apache2/sites-available/000-default.conf
. Consult your distro/Apache install for specifics -
Add a Virtual Host entry with the following values (this assumes a hostname of
myaresmush.com
, a web deploy directory of/var/www/myaresmush.com
, and default ports):<VirtualHost *:80> DocumentRoot "/var/www/myaresmush.com" ServerName myaresmush.com ProxyPreserveHost On ProxyPass "/websocket" "https://127.0.0.1:4203" ProxyPassReverse "/websocket" "https://127.0.0.1:4203" ProxyPass "/api" "https://127.0.0.1:4202" ProxyPassReverse "/api" "https://127.0.0.1:4202" ErrorLog ${APACHE_LOG_DIR}/myaresmush.com/error.log CustomLog ${APACHE_LOG_DIR}/myaresmush.com/access.loc combined <Directory /game/> RewriteEngine on RewriteRule "(config|help|logs|text)" - [R=404] </Directory> </VirtualHost>
-
Create the logs directory specified in the previous step (
${APACHE_LOG_DIR}/myaresmush.com
) -
Restart apache (
sudo systemctl restart apache2
) -
Run startares (
./bin/startares
)
-
- Choose and create your web deployment directory (we will choose
- After
- Step 2
TL;DR
Setup to an alternate web server like Apache2 requires three main changes: your Apache conf, the deploy script so that it deploys the files to the correct directory, and to the install scripts so that they don’t clobber any existing files.