• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

Apache for Newbie: Set up server-side includes (SSI)

December 17, 2023

Apache for Newbie: Set up server-side includes (SSI)

Setting up a server can be a daunting task for beginners, especially when it comes to configuring server-side includes (SSI). However, with the right guidance and tools, it can be a straightforward process. In this article, we will walk you through the steps to set up SSI on your Hong Kong VPS Hosting server.

What is Server-Side Includes (SSI)?

SSI is a server-side scripting language that allows you to include the content of one file into another file on the server. This is useful for including common elements such as headers, footers, or navigation menus across multiple pages on your website. SSI is supported by most web servers, including Apache, which is one of the most popular web servers used in VPS hosting.

Enabling SSI on Apache

To enable SSI on Apache, you need to make sure that the mod_include module is loaded. You can do this by editing the Apache configuration file, which is usually located at /etc/httpd/conf/httpd.conf or /etc/apache2/apache2.conf, depending on your hosting provider.


# LoadModule include_module modules/mod_include.so

Uncomment the above line by removing the # sign at the beginning of the line. This will load the mod_include module when Apache starts.

Configuring SSI

Once the mod_include module is loaded, you need to configure Apache to process SSI. You can do this by adding the following lines to your Apache configuration file:


AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

This tells Apache to treat files with the .shtml extension as HTML files and to process SSI directives in those files.

Using SSI

To use SSI, you need to create an HTML file with the .shtml extension and include the SSI directives in the file. For example, to include a header file called header.html, you would use the following SSI directive:


<!--#include file="header.html" -->

This will include the content of the header.html file at the location of the SSI directive in the .shtml file.

Testing SSI

Once you have set up SSI and created your .shtml file, you need to test it to make sure it is working correctly. You can do this by uploading the .shtml file to your Hong Kong VPS Hosting server and accessing it through your web browser. If the SSI directives are processed correctly, you should see the included content in the .shtml file.

Conclusion

Setting up server-side includes (SSI) on Apache can be a simple process with the right guidance. By following the steps outlined in this article, you can easily configure SSI on your Hong Kong VPS Hosting server and start including common elements across multiple pages on your website. With SSI, you can save time and effort by managing your website’s content more efficiently.

Recent Posts

  • How to Migrate from CentOS 8 to AlmaLinux or Rocky Linux Safely
  • CentOS Server Performance Tuning: Optimization Techniques for 2026
  • How to Configure SELinux in CentOS Without Breaking Your System (CentOS Stream 9/10 – 2026)
  • Managing Users and Permissions in CentOS Stream: Best Practices (CentOS Stream 9/10 – 2026)
  • How to Set Up Nginx on CentOS Stream for High-Performance Web Hosting

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot