Most of the files you need to configure are hidden. Of course, in the Terminal window you'll see them, but it might be more convenient to select and edit them using the Finder. To show all file to all access to the file in the finder you can show them by executing:
defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder
After you edited the files we strongly recommend to hide the hidden files again to prevent accidental damage or deletion. The commands
defaults write com.apple.finder AppleShowAllFiles FALSE killall Finder
return to the previous setting.
Open a terminal and type set command to show all environment variable. Please ensure that you have the JAVA_HOME variable set referring to your Java SDK installation folder. In Mac OS X 10.6 this usually is /Library/Java/Home. To set persistent environment variables in Mac OS X 10.5+ you can create the file ~/.MacOSX/environment.plist. (the ~ associates the user's folder, e.g./users/alexanderschulze/.MacOSX/environment.plist)
You'll find further support here: http://developer.apple.com/mac/library/documentation/
To easily edit the .plist files please download Apple's PListEdit Pro editor at: http://www.apple.com/downloads/macosx/development_tools/plisteditpro.html.
Since Mac OSX Mountain Lion Apple changed the way of setting environment variables. You now have to use the launchctl command. In the Terminal shell window type:
to view the current environment settings.
To set a value for an environment variable type
launchctl setenv <variable name> <variable value>
To set for instance the value for JWEBSOCKET_HOME in your development environment type
launchctl setenv JWEBSOCKET_HOME /svn/jWebSocket.dev/rte/jWebSocket-1.0/
Another call of launchctl export will show you the new environment variable.
To run the jWebSocket Server or any other Web Server or Servlet Container on Mac OSX Systems on ports 80 and/or 443 - e.g. when using the Jetty Engine - you need to run it with sudo to allow the application to access ports lower than 1024. Running a command using sudo, however, does not automatically "remember" the environment variables of the current user. You can force that by using the -E option and run the server like this from the shell window:
Example how to start the Jetty Server with embedded jWebSocket on port 80 via Maven:
cd /svn/jWebSocket/branches/jWebSocket-<version>/jWebSocketJetty sudo -E mvn jetty:run
Basiscally you can add new paths to the PATH variable in the Terminal window by typing:
export PATH=$PATH:/<additional search path>[:/<additional search path>][...]
To be sure that this command is automatically called everytime you log in you can put it into the ~/.profile file as follows:
Appending the PATH variable
This file usually is hidden. Please refer to the top of this document to learn how to show hidden files to access them in the Finder.
Updating httpd.conf in XAMPP Distribution of Apache 2.2.x under Mac OS X 10.5+
For Mac OSX the XAMPP distribution of Apache is an easy to use implementation. However, when you try to edit Apache's configuration file on a Mac you might get into access rights conflicts. You can easily fix that by temporarily updating the permissions for the httpd.conf file and - which is important - the etc folder as well.
To change the permissions for the httpd.conf to read/write change to the folder /Applications/XAMPP/xammppfiles/etc and type
sudo chmod 777 httpd.conf
If you type it the first time in the shell window, you will have to type your password.
Then go one folder level up and type
sudo chmod 777 etc
For security reasons, don't forget to set the rights back to read/only after you saved the changes. You can do that by simply using the same commands as above but 444 instead of 777.
Copyright © 2013 Innotrade GmbH. All rights reserved.