Apache HTTP server
  • 06 Sep 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Apache HTTP server

  • Dark
    Light
  • PDF

The Apache HTTP web server, also known as Apache server, is a free, open-source web server. Apache is highly flexible and customizable; functionalities can be easily turned on and off.


Example premise

Important: Replace the example domain with your document360 provided domain/custom domain.

  • Example domain represented using example.document360.io and the subfolder/subdirectory path (/v1) as example.document360.io/v1
    subfolder/subdirectory home page path (/help) as example.document360.io/help

To set up a sub folder path

  1. Ensure the following Apache server modules are enabled. These modules are part of the Apache server installation.
    • proxy
    • proxy_http
    • headers
    • substitute
    • proxy_html
    Run the following bash command to enable the modules:
    sudo a2enmod proxy proxy_http headers substitute proxy_html

Home page

  1. Configure the following Virtual Host configuration location blocks

For example
Location Block - Proxy all requests where the path starts from "/help"
This block will proxy requests for the home page

<Location /help>
   ProxyPreserveHost On
   RequestHeader set Host example.document360.io
   RequestHeader set requested-by proxy
   RequestHeader unset Accept-Encoding
   ProxyPass https://example.document360.io/v1
   ProxyPassReverse https://example.document360.io/v1



   AddOutputFilterByType SUBSTITUTE text/html
   substitute 's|href="/docs|href="/help|ni'
   substitute 's|href="/v1/docs|href="/help|ni'
   substitute 's|href="https://helloworld.document360.io/docs|href="https://docs.example.com/help|ni'
</Location>


Article/Category pages

  1. Configure the following Virtual Host configuration location blocks

For example
Location Block - Proxy all requests where path starts from "/help/"
This block will proxy requests for all the article/category pages

<Location /help/>
   ProxyPreserveHost On
   RequestHeader set Host example.document360.io
   RequestHeader set requested-by proxy
   ProxyPass https://example.document360.io/docs/
   ProxyPassReverse https://example.document360.io/docs/



   AddOutputFilterByType SUBSTITUTE text/html
   substitute 's|href="/docs|href="/help|ni'
   substitute 's|href="/v1/docs|href="/help|ni'
   substitute 's|href="https://example.document360.io/docs|href="https://docs.example.com/help|ni'
</Location>

  1. Restart the Apache server

For example, If you are using Nginx on Linux, then use the command
$ sudo systemctl restart nginx



Sitemap generation

Example premise

Important: Replace the example domain with your document360 provided domain/custom domain.


  • Example domain represented using example.document360.io

  • The sitemap prefix remains the same except for the language code (en, fr, de, etc.) example.document360.io/sitemap.xml.en
<Location /sitemap.xml.en>
    RequestHeader set Host example.document360.io
    RequestHeader set requested-by proxy
    ProxyPass https://example.document360.io/sitemap.xml.en
    ProxyPassReverse https://example.document360.io/sitemap.xml.en
</Location>


What happens next?

Once you have successfully configured the web server, your knowledge base site is live on your custom subfolder/subdirectory.

However, the existing URL for your project will serve the requests.

For example, example.document360.io and example.com/docs (if /docs is your folder path) will point to the knowledge base site.

This will cause duplicate content in Search engines (Google, Bing, etc.). For this, you will need to enable a URL redirect.

To enable the redirect from example.document360.io to example.com/docs, please contact us at support@document360.com.


Was this article helpful?