How to Set Custom Server Signature Header With OpenLiteSpeed Web Server

Go to your OpenLiteSpeed Web Server‘s WebAdmin Console and log in.

a) Disabling Default Server Signature

Navigate to Server Configuration > General Settings and then click on its related Edit icon. Set the Server Signature option to Hide Full Header from its dropdown selection list. Then click on Save icon.

b) Setting Custom Header

Custom headers can only be set for context levels.
Now, navigate to Virtual Hosts and then click on View icon related to your desired virtual host. Create a context for the virtual host by navigating to Context > Context List and then clicking on Add icon. Then, under New Context, set Type option to Static from its dropdown selection list and then click on Next icon. After that, under Static Context Definition, you need to configure the following options:

  • We are about to set the custom header for Document Root ($DOC_ROOT) and that’s why we have to set URI option to /.
  • And Accessible option must be set to Yes. (Otherwise, Error 403 will be experienced throughout the Document Root.)
  • In Header Operations field, put your lovely custom server signature header.
    Server: "TeleChirkut"
    Finally, click on Save icon.

c) Restarting

Changes will take effect after you give the OpenLiteSpeed Web Server a graceful restart. (Graceful restart ensures zero downtime.)

  • In case of its WebAdmin Console: Just click on Graceful Restart icon and then proceed to Yes.
  • In case of systemd: sudo systemctl restart openlitespeed.service or sudo systemctl restart lsws.service

Documentations

Abdullah As-Sadeed

Abdullah As-Sadeed