Archive for the ‘installing’ Category

I recently acquired a Mac and wanted to try out developing a pet project of mine on my new machinery. It’s a WebSharper project(*). This post however is not about WebSharper but about installing xsp

xsp is a lightweight web server, that can be used to server ASP.NET web sites. Installing xsp is a little more work than just fetching a package. You will need to clone it from github

git clone https://github.com/mono/xsp.git

and then change to the directory of xsp and run the below command

./autogen.sh

If you get this error

aclocal is not installed, and is required to configure

It’s because you don’t have the required tools installed. If you didn’t get that error, then you can probably skip all the way to configuring xsp.

Installing the required tools

It’s pretty straight forward to install the required tools. You will simply have to run a series of commands. One for each tool being installed. (These are tools often used for building open source projects, that used to be installed together with Xcode, but are no longer part of that installation.)
After trying to install the tools manually where I kept getting missing dependencies errors I went the homebrew way. If you haven’t already installed homebrew don’t fret. Installing homebrew is a one command exercise:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After installing homebrew we can get to installing the required tools

brew install autoconf
brew link --overwrite autoconf

If the link command fails with an error stating that a given path is not writable, then do as follows, before repeating the linking

chown -R yourusername unwritableDirectoryPath
chmod -R u+w /usr/local

When you have successfully linked autoconf, then proceed with the installation of the required tools/libraries

brew install automake
brew install pkg-config
brew install mono

That should have installed the prerequisite, and you should now be able to follow the installation instructions on the xsp homepage. Start by running

./autogen.sh

again. This time there should be no errors.

To complete the installation, run the below commands

./Configure --prefix=/usr
make 
make install

And with all that under our belt, you should now be able to navigate to the root of your website and execute the command

xsp4 --port=####

This will start a webserver listening on the specified port (if you just want the default port 8080 you can omit the –port option)
*) WebSharper itself is an awesome tool for building web sites. The only real problem I’ve had is the fact that it’s not as widely used as other tools and therefore lacks on the documentation/sample code side. However, it does reduce the amount of work I’ve had to do to accomplish my work regardless of the lack of stackoverflow Q&As.

Advertisement

Working on a project we’re trying out rest.li and we’re using windows as our OS that makes the installation a little more cumbersome and I’d like to be able to redo the installation at a future point so in any case I needed to document the process and hi, why not do that so some one else than me could benefit from it. I’ll also install HTTPie since testing the generated services is a lot easier with that tool.

So let’s get rolling

The first subtask will be to install HTTPie and this post from Scott Hanselman help me but things seems to have changed slightly since then, so I’ll include a revised version

Firstly you’ll need to download Python I chose the 64-bit MSI installer when it’s installed then add the installation directory to your path. To do so follow this process

  1. Right click “Computer” in file explorer
  2. Choose “properties”
  3. Choose “Advance system settings”
  4. Press the “Environment variables” button

Depending on whether you installed for all users or just you you should then change the corresponding path variable (either you or system) and add the installation directory and “installation directory\Scripts” to the path

The former makes python available on the command prompt and the latter makes pip (a package management tool we’ll be using later) available.

To test that you’ve succeeded open a command prompt (windows-r and type cmd) first type python and hit enter there should be no error telling you that python is an unknown command, then repeat with pip

Next step is to install curl make sure that the executable is in a directory that’s also in your path variable and test in the same manner as with python and pip.

Next step is to execute distribute_setup.py you can do this using curl that you just installed

curl http://python-distribute.org/distribute_setup.py | python
  • or if you have issues connecting using curl then download the file from the link above and simply double click it

Last step in installing HTTPie is to use pip

pip install -U https://github.com/jkbr/httpie/tarball/master

That will down load HTTPie and install it on your machine. Pip will place the httpie script in your python script folder so the tool is ready to be used from the command promt when it’s down downloading and you can test this by typing

http

at the command prompt and then hit enter.

We are going to need to install

  • A JDK (1.6+ as of this writing)
  • Gradle
  • Conscript
  • Giter8
  • rest.li

First make sure that you have the JDK installed. You can find the installer on Oracles site. Gradle on the other hand can be found at the Gradle download page. With both the JDK and Gradle installed we’ll install Conscript which you can find on the github page. It’s a jar file and it should be sufficient to download and double click it
once you have conscript installed you should add that to your path as well and test it by executing the command

cs

on the command line. With conscript installed it’s time to install giter8 to do so execute the following command

cs n8han/giter8

If you get an error saying jansi or some other lib could not be found. You might be blocked in a proxy due to the fact that your traffic can’t be inspected since sbt-launch will use a repository url starting with https. It might just work for you if you change it to http. You can do this (and will need to do it both for cs and g8) in the launchconfig file that can be found under your conscript installation folder in .conscript\n8han\conscript\cs for conscript and .conscript\n8han\giter8\g8 for giter8. If that does not work then you can try a slightly more complicated version which you can read about here

When g8 is installed and everything is working as it should. You can create your first project by simply executing

g8 linkedin/rest.li-skeleton in your command shell

.

We haven’t used gradle yet but you will have to when you wish to compile your rest.li project. The skeleton created in the previous step includes three gradle build files that will handle the code generation tasks for you. For how to actually work with rest.li and gradle see the rest.li site