Webrick Configuration

Hi

I am using webrick server for my application in ~/sample. For every boot of computer, i need to start the webrick server in ~/sample. Kindly anyone help me to start up the webrick server at the initial boot of computer with specified port as automated startup.

If you're on a *nix platform, look at the startup scripts in /etc/init.d or equivalent and make one for webrick. Recent Macs use `launchd` with files named *.plist and again you can find plenty of examples to use as a basis for your own script.

If you're on Windows, I have no idea :slight_smile:

Hi Hassan I am using linux only. I tried to create script on /etc/init.d. But, it doesnt start the webrick server within my project data @ ~/sample. If u know the script for initiating webrick from the /etc/init.d to my project data @ ~/sample during starting of OS kindly help me.

I don't use webrick, but init scripts are pretty trivial. Post what you tried and explain how it failed.

Hi hassan,

Your suggestion is valuable. I tried as you told…

This script is working if i initiate as “/etc/init.d/webrick”. But, it doesnt start with system boot. (I provided 777 permission too…), I dont know this will be permission issue for execution or some other issue.

Hi hassan,

Your suggestion is valuable. I tried as you told...

<script>

#!/bin/bash cd ~/sample rails server &

</script>

This script is working if i initiate as "/etc/init.d/webrick". But, it doesnt start with system boot. (I provided 777 permission too...), I dont know this will be permission issue for execution or some other issue.

You need to place a symbolic link in the directory of your current runlevel. It's something like /etc/rcX.d/. You get your current runlevel by executing `runlevel`. On Debian based system it's supposed to be 2. So you have to place the link in /etc/rc2.d.

HTH

Cheers,

Jan

Dear Jan,

I created symbolic link of /etc/init.d/webrick to /etc/rc2.d/webrick. Still, its same problem. The server is not starting at system boot up.

I feel that webrick start during system boot and stoped immediately without keep on running. Any way to keep on running webrick in linux?

Dear All,

I included the /etc/init.d/webrick to System->Preferences->Startup Applications->Add “/etc/init.d/webrick”. Now its started and keep on running in my Linux. Thanks lot everyone for giving your suggestions. If you have any comment over this answer kindly post.

Note that this (I believe) will start it when you login, not when you boot. That may be ok for you of course, but is not actually what you asked for.

Colin

Dear Collin,

You are exactly correct, I accept. Up to my requirement, startup is enough to initiate webrick. Ofcourse, It needs to be do so, for boot time initiation.