Knowledgebase

Editing Configuration Files Safely Print

  • vpsservermanagement, errors, troubleshooting, guide, howto, solution, zillionkinghost, hosting
  • 0

Changes to configuration are how servers break.

BEFORE EDITING

Copy the file first. A dated copy alongside the original costs nothing and is your way back.

CHOOSING AN EDITOR

nano is simple and adequate. Controls are shown at the bottom of the screen. vim is powerful and has a steep learning curve. If you do not already know it, use nano.

AFTER EDITING

Test the configuration before restarting. Apache, Nginx and most services offer a syntax check command. Run it.

A syntax error in a web server configuration means the service will not start, and your site stays down until you fix it.

THEN RELOAD

Reload rather than restart where possible.

THE HABIT THAT SAVES YOU

Edit, test, reload, verify the site works. Every time. Skipping the test is how a one-character typo takes a site offline for an hour.

KEEP A RECORD

Note what you changed and why, somewhere other than the server. Six months later you will not remember why a setting is unusual.

VERSION CONTROL

For anything complex, keeping configuration in a repository is worth the setup.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot