I mentioned in an earlier post on Jaxer that I wasn't going to go over the setup because Jaxer is included in Aptana Studio.  That was a bit short-sighted of me. Unsurprisingly (to myself), I decided I wanted to be able to play with Jaxer in a way that wouldn't work with the built-in Studio version.

Jaxer Server Setup and Basic Configuration:
Setting up Jaxer server on your local machine is pretty easy. To start, download your desired flavor of the Apache + Jaxer server from Aptana (Windows, Mac OS X, and Linux installations available).

On a Mac, the install couldn't have been easier: double-click the DMG file that you downloaded from the site above and drag the Aptana_Jaxer folder to your Applications folder. 

For Windows, it's equally easy. You start by expanding the downloaded zip file from the link above. Then, just move it where you want on your system (or, unzip it directly to the desired location). Linux has some more detailed instructions, which can be found in the Setup section in the online guide (link below).

Launch Jaxer
Once you've downloaded the Apache/Jaxer server, you need to launch it. On a Mac or Windows PC, open the Jaxer installation folder for your platform (i.e., /Applications/Aptana_Jaxer). On a Mac, double-click the application file for Jaxer Launcher. On Windows, double-click the StartServers.bat file.

By default, the Apache + Jaxer server listens on port 8081. So, head to http://localhost:8081/aptana/ to ensure that your server is installed and running.

One nice thing for those of us already running an instance (or more) of Apache. You can safely run Apache + Jaxer alongside other Apache instances (assuming no others are listening on 8081).

It's Okay but Not Quite:
I tend to err on the side of over-organization. I try to keep all my websites in central locations on my computer. I keep all my web applications (including RIAs) in a single root folder (/Users/myusername/Sites) and, by default, the Apache + Jaxer places your web root folder within the install folder (Mac = /Applications/Aptana_Jaxer/public/). 

With some minor edits to the Apache configuration files, you can relocate this home directory anywhere you want on your computer. I decided to create a Jaxer web root as a sibling to my standard web root (/Users/myusername/JaxerSites).

Configuration File Edits:
To switch the web root directory, open the following files in your text editor of choice (save yourself a world of headaches and use an application that can/will edit plain text files):
JAXER_INSTALL_DIR/Apache22/conf/httpd.conf
JAXER_INSTALL_DIR/Apache22/conf/extras/httpd-vhosts.conf
JAXER_INSTALL_DIR/jaxer/confs/jaxer-mac-httpd.conf (same file exists for win and linux...with those characters in place of the mac in my file)

In httpd.conf, find the following line of text:
DocumentRoot "/Applications/Aptana_Jaxer/public"

Change the text inside the quotes to the full file path to the desired web root

Also in httpd.conf, find the following line of text:

</div>

As with the note above, change the text inside the quotes to the full file path of the desired web root. Be aware that some servers ('nix ones to be sure) are case-sensitive. Be consistent with your typing and naming!

In jaxer-mac-httd.conf, find the following line of text (there are two spots where this one needs to be changed!):
</div>

Change it to match the new web root directory.

Finally, locate this line of text in the jaxer-mac-httpd.conf file:
Alias /aptana /Applications/Aptana_Jaxer/jaxer/aptana

Change it to read /aptana /PATH TO YOUR NEW SITE ROOT

One more task, copy or move the "aptana" folder (in JAXER_INSTALL_DIR/public/apatana) to the new web root. This way, you can use the Aptana sample applications and server diagnostics without issue.

That's it for switching your web root (changing five lines in two files ain't too bad!). Restart your Apache + Jaxer server and you're ready to server files from the new location.

Online Docs:
</div>

Comments