Line 284: |
Line 284: |
| | | |
| mkdir /home/off/logs | | mkdir /home/off/logs |
| + | |
| + | |
| + | ===== Running a 2nd Apache instance for OBF ===== |
| + | |
| + | OFF and OBF share the same code (except some configuration in the Config.pm and SiteLang.pm modules), but the code is not made to run two separate servers. |
| + | So we need two run two separate instances of Apache, one for OFF and one for OBF. This also allows to restart one but not the other, to run different versions of the code etc. |
| + | |
| + | There is some support to run multiple Apache instances. Documentation is in /usr/share/doc/apache2/README.multiple-instances |
| + | |
| + | <pre> |
| + | sh /usr/share/doc/apache2/examples/setup-instance obf |
| + | Setting up /etc/apache2-obf ... |
| + | Setting up /etc/init.d/apache2-obf ... |
| + | Setting up symlinks: a2enmod-obf a2dismod-obf a2ensite-obf a2dissite-obf a2enconf-obf a2disconf-obf apache2ctl-obf |
| + | Setting up /etc/logrotate.d/apache2-obf and /var/log/apache2-obf ... |
| + | |
| + | </pre> |
| + | |
| + | Configuration files for the new instance are in /etc/apache2-obf : |
| + | |
| + | * Copy and edit obf.conf: |
| + | ** /etc/apache2-obf/sites-available# cp off.conf obf.conf |
| + | ** vi obf.conf |
| + | *** :%s/off/obf/g |
| + | *** ServerName openbeautyfacts.org |
| + | * /etc/apache2-obf/sites-enabled# ls -lrt off.conf |
| + | * lrwxrwxrwx 1 root root 27 Jun 17 14:45 off.conf -> ../sites-available/off.conf |
| + | * /etc/apache2-obf/sites-enabled# rm off.conf |
| + | * /etc/apache2-obf/sites-enabled# ln -s ../sites-available/obf.conf obf.conf |
| + | |
| + | vi /etc/apache2-obf/envvars |
| + | |
| + | <pre> |
| + | #export APACHE_RUN_USER=www-data |
| + | export APACHE_RUN_USER=off |
| + | #export APACHE_RUN_GROUP=www-data |
| + | export APACHE_RUN_GROUP=off |
| + | </pre> |
| + | |
| + | |
| + | Port 8002 |
| + | |
| + | <pre> |
| + | |
| + | /etc/apache2-obf# vi ports.conf |
| + | |
| + | #Listen 80 |
| + | Listen 8002 |
| + | |
| + | </pre> |
| + | |
| + | service apache2-obf restart |
| + | |
| + | To check for errors: |
| + | |
| + | systemctl -l status apache2-obf.service |
| + | |
| + | mkdir /home/obf/logs |
| | | |
| ==== Product Opener ==== | | ==== Product Opener ==== |