Tag Archives: webdriver

Installing Selenium server 2 as a service on Ubuntu

This post follows on from the earlier how to install selenium as a service on mac os x , with details of how to install the same standalone server on the Ubuntu server.  In this case, it was 8.04, but it should work in later versions too.

First, browse to http://code.google.com/p/selenium/downloads/list click on selenium-server-standlone-2.*.jar link, and then copy the url of the selenium-server-standlone-2.*.jar file.

Next, open up a terminal window and type:

sudo su
mkdir /usr/lib/selenium/
cd /usr/lib/selenium/
wget url-you-copied-above
mkdir -p /var/log/selenium/
chmod a+w /var/log/selenium/

Next, take this attachment, and save it as /etc/init.d/selenium

Now edit the file, and change the filename of the standalone server file (currently selenium-server-standalone-2.0a5.jar) to the name of the server file you downloaded above.

Finally, make the script executable:

chmod 755 /etc/init.d/selenium

To test:

/etc/init.d/selenium start

Finally, add the script so that it starts automatically when the server does:

update-rc.d selenium defaults

Installing Selenium 2 as a service on Mac OS X

This post covers how to install selenium standalone as a service on Mac OS X.  Version 10.6 in this case, but should work on 10.x

First, browse to http://code.google.com/p/selenium/downloads/list and copy the url of the selenium-server-standlone-2.*.jar file.

Next, open Terminal.app and type the following:

sudo mkdir /usr/lib/selenium/
sudo wget url-you-copied-above /usr/lib/selenium/
sudo mkdir -p /var/log/selenium/
sudo chmod a+w /var/log/selenium/

Next, save this file as ~/Library/LaunchAgents/org.nhabit.Selenium.plist.  Edit the file in your favourite editor, and change the filename on line 13 (currently selenium-server-standalone-2.0a5.jar) to that of the server file you downloaded above.

Now go back to Terminal and type:

launchctl load ~/Library/LaunchAgents/org.nhabit.Selenium.plist
launchctl start org.nhabit.Selenium

The Selenium server should now be started and running on port 4443.  You can check everything’s fine by typing:

ps auxwww | grep selenium

It logs to /var/log/selenium/.  You can check the error log here:

tail /var/log/selenium/selenium-error.log
Selenium server is being run as a daemon via launchd, which is controlled by launchctl.  The config file above was set up using this GUI:  http://sourceforge.net/projects/lingon/files/
Next: Installing Selenium server as a service on Ubtuntu