To start Web Crossing, move to the Web Crossing binaries directory and execute webx-run with the arguments "-daemon -server":
cd /somedir/some_other_dir/mydir/webx/
./webx-run -daemon -server
To stop Web Crossing, read the webx.lock file in the Web Crossing binaries directory and kill that process ID. Do not ever use "kill -9" as that will corrupt the database. It's best to be sure Web Crossing has shut down gracefully before rebooting the server. Here's an example perl script that shuts down two Web Crossing processes:
#! /usr/bin/perl
#shutdnpf.pl
# a perl script to shut down the server gracefully, especially useful in the event of
# a power failure. Kills the main and secondary Web Crossing processes, waits for them to
# die before proceeding with shutdown.
print "Emergency shutdown in progress...\n";
print "Finding Web Crossing process ID's...\n";
if (open(PIDFILE, "/www/webx/main/webx/webx.lock")){
#get process ID
while(){
$MainPid = $_;
}
}
else{
$NoMainProcess = 1;
}
close PIDFILE;
if (open(PIDFILE, "/www/webx/secondary/webx/webx.lock")){
#get process ID
while(){
$SecondaryPid = $_;
}
}
else{
$NoIspProcess = 1;
}
close PIDFILE;
print "Sending kill command to Web Crossing processes..\n";
# kill the webx processes
if (!$NoMainProcess){
`kill $MainPid`;
}
if (!$NoSecondaryProcess){
`kill $SecondaryPid`;
}
#see if any webx process is running, loop until ps can't find it
$PsOut = `ps -aux | grep webx`;
while ($PsOut){
sleep 3;
print "Web Crossing processes still running...\n";
$PsOut = `ps -aux | grep webx`;
}
print "\nAll Web Crossing processes killed\n\n";
#endfile
The only way that we know of to start WebCrossing as a user other then root is if all ports used are above 1024. This means that you will not be able to run in Direct Web Service mode on port 80. If you are running in cgi mode with apache you should be able to start webx as any user you want.
the startup script should contain:
su user -c /path/to/start-webx
where user is the username you want webx to run under. You will also need to make sure that all the files and directories in the webx
installation are owned by the user you wish to start webx under. |