Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Tomcat on OS X Server 10.6.6 under the normal Web component that comes with the OS. This has worked fine so far, but I need to add some entries to the $PATH environment variable for programs that I want access to from the web server (more specifically, I'm running Hudson under Tomcat which needs access to build tools that I have installed).

Tomcat and the Web component seems to run under the user _appserver which has a different $PATH than the administrator account.

What's the proper way to add a global entry to the $PATH in OS X Server for the Web component? Preferable it should be done only once so that both the _appserver and Administrator user can access the same $PATH.

EDIT: Adding the path to /etc/paths or /etc/paths.d/somefile didn't work. Tomcat and Hudson does still not see those directories.

share|improve this question

You can set global paths in MacOS X by adding a file to /etc/paths.d with the path you wish to add.

This change will affect all the users on your system, so it covers exactly what you're looking for.

share|improve this answer
I added a simple project in Hudson to see which paths it had. It only showed the path /usr/bin:/bin:/usr/sbin:/sbin even though there are many more added in /etc/paths.d for example. They show up for normal users but not Hudson. – Adam Lindberg Feb 9 '11 at 8:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.