Switch from Apache to Nginx
NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:
$ test ! -f "installdir/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."
The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.
If you want to switch the Web server, follow these steps depending on your installation type:
Approach A: Bitnami installations using system packages
Stop Apache and disable the Apache service:
$ sudo installdir/ctlscript.sh stop apache $ sudo mv /etc/monit/conf.d/apache.conf /etc/monit/conf.d/apache.conf.disabled
Enable the NGINX service:
$ sudo mv /etc/monit/conf.d/nginx.conf.disabled /etc/monit/conf.d/nginx.conf
Reload Gonit configuration:
$ sudo gonit reload
Approach B: Self-contained Bitnami installations
Stop and disable the Apache service:
$ sudo installdir/ctlscript.sh stop apache $ mv installdir/apache2/scripts/ctl.sh installdir/apache2/scripts/ctl.sh.disabled
Enable and start NGINX:
$ mv installdir/nginx/scripts/ctl.sh.disabled installdir/nginx/scripts/ctl.sh $ installdir/ctlscript.sh start nginx
For native installers, enable and start PHP-FPM:
$ mv installdir/php/scripts/ctl.sh.disabled installdir/php/scripts/ctl.sh $ installdir/ctlscript.sh start php-fpm