'Start web server at boot' script

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
Kark1

'Start web server at boot' script

#1 Post by Kark1 »

I don't know if it is the correct procedure, but it works.

Put this script wherever you want. Klick on it to start httpd.

If you want the server to start when X starts, put the script in /bin
and add the line

startweb

to /root/.xinitrc

Kark

Kark

The script

#2 Post by Kark »

oh, and the script. save it and change permission to executable.:

#!/bin/sh

cd /root/ghttpd/
./httpd

menno

ghttpd

#3 Post by menno »

It would be adviseble to check or the server is running . From other people on this forum there was a note that it didn't .

When you run a script this should be in cgi-bin . But if the script call's a other one your directory is not cgi-bin but one level lower . A other fact is that you cann't have a directory under cgi-bin with scripts . They wouldn't work .

This is why the database.cgi not works , change the call quisp ... to quisp/quisp .. wil do the trick . After executing database.cgi the directory has become .../ghttpd and not .../ghttpd/cgi-bin as you exspected .

There has been reported a leak in ghttpd , has puppy a corrected version ?
Greatings Menno

Guest

#4 Post by Guest »

Ok

this is just a script to start the httpd, it is not a script to be run BY the server upon request.

It is is simply there for lazy people, who doesn't want to start a terminal window, go to the right directory and type in the command to start the server.

However: I found that starting it at the same time as x, as it would try to start the server everytime I start x, so I put it in the local startup-script

I also put the "startweb" in /usr/sbin instead of /bin

I am completely blank when it comes to the placement of such scripts, but now it works the way I want it. The web server starts when I start my machine.

User avatar
alienjeff
Posts: 2265
Joined: Sat 08 Jul 2006, 20:19
Location: Winsted, CT - USA

server automatic start script

#5 Post by alienjeff »

Guest wrote: "It is is simply there for lazy people, who doesn't want to start a terminal window, go to the right directory and type in the..."

Not necessarily so. Some of us run webservers full time, yet without the benefit of UPS systems. Should the power go out and come back on while we're away, it's nice to have the server restart without operator intervention. :wink:

Whether we're lazy or not is another matter. :roll:
Last edited by alienjeff on Tue 25 Jul 2006, 14:56, edited 1 time in total.

Trobin
Posts: 968
Joined: Fri 19 Aug 2005, 03:16
Location: BC Canada

Re: Start web server script

#6 Post by Trobin »

Kark wrote:I don't know if it is the correct procedure, but it works.

Put this script wherever you want. Klick on it to start httpd.

If you want the server to start when X starts, put the script in /bin
and add the line

startweb

to /root/.xinitrc

Kark
??? Put what script where?
[url]http://speakpup.blogspot.com[/url]

Post Reply