itsbmw
April 8th, 2008, 08:54 PM
ok so i am running a game server for a friend. it uses java and i made a simple control panel with HTML.
here is the page source :
<html><head><title>Dylan's Control Panel
</title></head><body>
<h1>RuneScape Server on haze-linux</h1>
<FORM METHOD="LINK" ACTION="compile.php">
<INPUT TYPE="submit" VALUE="Compile">
</form>
<br>
<FORM METHOD="LINK" ACTION="run.php">
<INPUT TYPE="submit" VALUE="Run">
</form>
<br>
<FORM METHOD="LINK" ACTION="stop.php">
<INPUT TYPE="submit" VALUE="Stop">
</form>
</body></html>
my compile.php :
<?php
shell_exec('/home/haze/rs/compile.sh > dev/null/ 2>&1');
?>
Start and stop.php look the same but with run.sh and stop.sh.
my run.sh:
#!/bin/sh
cd /home/haze/rs/
java server
my stop.sh
#!/bin/sh
cd /home/haze/rs/
kill $(pgrep java)
killall -v java
pkill java
kill `ps -ef | grep java | grep -v grep | awk '{print $2}'`
my compile.sh :
#!/bin/sh
cd /home/haze/rs/
javac *java
When i hit the buttons on the control panel they load the php page up no errors. But nothing happens on the server. I have tested the compile/stop/run scripts from terminal and they work perfect.
My question is what do i do to call these files? Any help is appreciated. I am not a PHP wiz but it is a very helpful language.
EDIT: Should i maybe make these files CGI and put them in my webs cg-bin directory?
here is the page source :
<html><head><title>Dylan's Control Panel
</title></head><body>
<h1>RuneScape Server on haze-linux</h1>
<FORM METHOD="LINK" ACTION="compile.php">
<INPUT TYPE="submit" VALUE="Compile">
</form>
<br>
<FORM METHOD="LINK" ACTION="run.php">
<INPUT TYPE="submit" VALUE="Run">
</form>
<br>
<FORM METHOD="LINK" ACTION="stop.php">
<INPUT TYPE="submit" VALUE="Stop">
</form>
</body></html>
my compile.php :
<?php
shell_exec('/home/haze/rs/compile.sh > dev/null/ 2>&1');
?>
Start and stop.php look the same but with run.sh and stop.sh.
my run.sh:
#!/bin/sh
cd /home/haze/rs/
java server
my stop.sh
#!/bin/sh
cd /home/haze/rs/
kill $(pgrep java)
killall -v java
pkill java
kill `ps -ef | grep java | grep -v grep | awk '{print $2}'`
my compile.sh :
#!/bin/sh
cd /home/haze/rs/
javac *java
When i hit the buttons on the control panel they load the php page up no errors. But nothing happens on the server. I have tested the compile/stop/run scripts from terminal and they work perfect.
My question is what do i do to call these files? Any help is appreciated. I am not a PHP wiz but it is a very helpful language.
EDIT: Should i maybe make these files CGI and put them in my webs cg-bin directory?