Configuring the WebServer - HL Vanilla Community
<main> <article class="userContent"> <div class="embedExternal embedImage display-large float-none"> <div class="embedExternal-content"> <a class="embedImage-link" href="https://us.v-cdn.net/6030677/uploads/UZODYMECYFQI/microsoftteams-image-288-29.png" rel="nofollow noreferrer noopener ugc" target="_blank"> <img class="embedImage-img" src="https://us.v-cdn.net/6030677/uploads/UZODYMECYFQI/microsoftteams-image-288-29.png" alt="MicrosoftTeams-image (8).png" height="108" width="1356" loading="lazy" data-display-size="large" data-float="none"></img></a> </div> </div> <p>Vanilla Forums Cloud runs on nginx. This is the only officially supported and maintained configuration.</p><p>Vanilla does provide a configuration for Apache, but it is not in active use by Vanilla Cloud. Other web-servers such as IIS are capable of running Vanilla, but will need to be configured properly. Vanilla does not maintain a configuration for other webservers.</p><p>See the dedicated sections for more information about Apache and nginx. We also recommend this excellent <a href="https://www.howtoforge.com/how-to-install-vanilla-forum-on-centos-7/#step-install-nginx-and-configure-nginx-for-matomo" rel="nofollow noreferrer ugc">third-party guide to setting up Vanilla on CentOS</a>.</p><h2 data-id="advanced-handling-of-headers">Advanced Handling of Headers</h2><p>To utilize advanced handling of request and networking headers, it is recommended you make the necessary modifications in a <code class="code codeInline" spellcheck="false" tabindex="0">bootstrap.before.php</code> file. You may need to create this file in your config folder, if it does not already exist. The contents of this file are executed at the very beginning of Vanilla’s bootstrapping process.</p><p>If, for example, you wanted to use the <code class="code codeInline" spellcheck="false" tabindex="0">Host</code> header from an incoming request to set the host Vanilla sees, you would add the following into <code class="code codeInline" spellcheck="false" tabindex="0">bootstrap.before.php</code>:</p><pre class="code codeBlock" spellcheck="false" tabindex="0"> if (isset($_SERVER['HTTP_HOST'])) { $_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST']; } </pre><p>This will overwrite the host set by the server with the value of the <code class="code codeInline" spellcheck="false" tabindex="0">Host</code> header. It is crucial to verify the validity of any such data. <strong>If you cannot verify the hosts provided in these headers, do not attempt to use them.</strong></p><h2 data-id="caching">Caching</h2><h3 data-id="opcache">OPcache</h3><p>OPcache replaced APC as the preferred opcode caching solution for PHP as of 5.5. Vanilla is compatible with OPcache and no additional configuration is necessary beyond simply enabling it.</p><h3 data-id="memcached">Memcached</h3><p>Vanilla has support for both Memcache and Memcached, but we strongly recommend Memcached if you have an option. It does require additional configuration beyond installing and enabling it in PHP.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">$Configuration['Cache']['Enabled'] = true; $Configuration['Cache']['Method'] = 'memcached'; $Configuration['memcached']['Store'] = 'localhost'; </pre><p>You can also specify a port for memcached. Store, e.g.: <code class="code codeInline" spellcheck="false" tabindex="0">localhost:11211</code>.</p><p>Lastly, you can optionally set Memcached options directly in your Vanilla config. Here are some example settings you may wish to use. Note that these require Memcached to be enabled on your server or else adding these to your config will cause errors.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">$Configuration['Cache.Memcached.Option.'.Memcached::OPT_COMPRESSION] = true; $Configuration['Cache.Memcached.Option.'.Memcached::OPT_DISTRIBUTION] = Memcached::DISTRIBUTION_CONSISTENT; $Configuration['Cache.Memcached.Option.'.Memcached::OPT_LIBKETAMA_COMPATIBLE] = true; $Configuration['Cache.Memcached.Option.'.Memcached::OPT_NO_BLOCK] = true; $Configuration['Cache.Memcached.Option.'.Memcached::OPT_TCP_NODELAY] = true; $Configuration['Cache.Memcached.Option.'.Memcached::OPT_CONNECT_TIMEOUT] = 1000; $Configuration['Cache.Memcached.Option.'.Memcached::OPT_SERVER_FAILURE_LIMIT] = 2; </pre><p><br></p> </article> </main>