Mac OS X Server: How to Locate and Edit Configuration Files
There are several methods for editing configuration files. Using TextEdit is the simplest method for most users.
Products Affected
Mac OS X Server 10.3
Many services in Mac OS X Server use text-based "configuration" files to store information about how services are provided. Sometimes you may need to edit one of these files using a text editor. Many text editors can do this job, but the TextEdit application included with Mac OS X is a simple one to use.
Before editing a configuration file, you may need to stop the service that the file regulates. If you are not sure, it is a good idea to stop the service in question. Additionally, you may need to quit applications that are used to administer the service, such as Server Settings or Server Admin. After saving changes to the configuration file, restart the service in question.
Follow these steps to edit a configuration file with TextEdit:
Locating configuration files
Most configuration files are stored in folders that are not normally visible in the Finder. You can use the Go to Folder command from the Go menu to reveal an invisible folder. For the example file "hostconfig", you could type "/etc/" in the "Go to" field. Alternatively, you could open the file directly in TextEdit by typing "/etc/hostconfig" in the "Go to" field of the Open dialog, as in Step 7 above.
For information on how to read or write a pathname, see technical document 106419: "Mac OS: About Folders, Directories, and Pathnames"
If you know the name of a file but not where it is located, you can use Sherlock to determine the pathname.
Determining pathname with Sherlock
To find an invisible item in Sherlock, you must use the custom search.
Now follow these steps:
Before editing a configuration file, you may need to stop the service that the file regulates. If you are not sure, it is a good idea to stop the service in question. Additionally, you may need to quit applications that are used to administer the service, such as Server Settings or Server Admin. After saving changes to the configuration file, restart the service in question.
Follow these steps to edit a configuration file with TextEdit:
- 1. Log in to the server as root. For more information on root login, see technical document 106290: "Mac OS X: About the root User and How to Enable It"
2. Open the TextEdit application.
3. Choose Preferences from the TextEdit application menu.
4. Click the Plain Text radio button for New Document Format.
5. Under Saving, click the checkbox to deselect "Append '.txt' extension to plain text files."
6. Be sure that the checkbox for "Wrap to page" is deselected (Figure 1).

Figure 1 Correct TextEdit Preferences for configuration file editing
7. Choose Open from the File menu.
Note: If you do not know the pathname of the file, see "Locating configuration files" section below.
8. Type the pathname of the file you want to open in the "Go to" field, then click Open.
Important: Before you make any changes to the file, remember that improperly editing certain configuration files may prevent your computer from starting up as expected. You may wish to save a copy of the original file now by choosing Save As from the File menu and changing the file name that appears in the "Save as" field. If, for example, you had just opened a file named "hostconfig," you could type "hostconfig.original," then click Save. You would then close the open file and repeat Steps 7 and 8 to reopen the targeted file, which would be "hostconfig" in the example.
9. Make desired changes to the file.
10. Choose Save from the File menu when you are done.
Locating configuration files
Most configuration files are stored in folders that are not normally visible in the Finder. You can use the Go to Folder command from the Go menu to reveal an invisible folder. For the example file "hostconfig", you could type "/etc/" in the "Go to" field. Alternatively, you could open the file directly in TextEdit by typing "/etc/hostconfig" in the "Go to" field of the Open dialog, as in Step 7 above.
For information on how to read or write a pathname, see technical document 106419: "Mac OS: About Folders, Directories, and Pathnames"
If you know the name of a file but not where it is located, you can use Sherlock to determine the pathname.
Determining pathname with Sherlock
To find an invisible item in Sherlock, you must use the custom search.
- 1. Open Sherlock.
2. Click the hard disk icon to search your hard disk.
3. Click the radio button for Custom.
4. Choose Edit from the Custom pop-up menu.
5. Click the Advanced Options disclosure triangle.
6. In the bottom right corner, click to select the checkbox next to the pop-up menu that says either "invisible" or "visible."
7. Be sure the pop-up menu is set to "invisible."
8. Click OK.
9. Type the name of the configuration file in the search field, then click the magnifying glass icon.
10. In the Name column of the Sherlock results field, select the file. If more than one file has the same name, be certain that you have selected the correct file before proceeding.
11. Look in the lower pane of the Sherlock window (Figure 2). This pane reveals the path in which the file is located.

Figure 2 Sherlock revealing the file /etc/hostconfig
Now follow these steps:
- 1. Click the Finder icon in the Dock.
2. Choose Go to Folder from the Go menu.
3. Type the pathname for the enclosing folder.
4. Click Go.
Rate this article: