Postado Maio 6, 2015 10 anos Bom galera venho trazer um tutorial de como ligar e desligar o servidor pelo site (Imagina que sonho... seu servidor trava... você está na escola por exemplo... e consegue ativá-lo pelo site, somente com o apertar de um botão.) Bom vamos lá ESTE TUTORIAL SERVE SOMENTE PARA QUEM UTILIZA O SISTEMA OPERACIONAL LINUX (WINDOWS/OS NÂO FUNCIONA) Crie o Arquivo adminserver.php na pasta central do Znote Adicione Dentro <?php require_once 'engine/init.php'; include 'layout/overall/header.php'; protect_page(); admin_only($user_data); // start if(isset($_POST['test'])) { if (check_if_process_is_running("theforgottenserver")) { echo "<h2><b><font color='green'>Server is already running</font></b></h2>"; } else { shell_exec('cd /home/server1/ && ./theforgottenserver > my.log 2>&1 &'); //Serverpath } } if(isset($_POST['kill'])) { shell_exec('killall -9 theforgottenserver'); } if(isset($_POST['safe'])) { shell_exec('killall -QUIT theforgottenserver'); } function check_if_process_is_running($process) { exec("/bin/pidof $process",$response); if ($response) { return true; } else { return false; } } if (check_if_process_is_running("theforgottenserver")) { echo "<h2><b><font color='green'>Server is running</font></b></h2>"; } else { echo "<h3><b><font color='red'>Server is NOT running</font></b></h3>"; } ?> <div id="text"> This is the beta version of JoccEs Admin panel to start/stop tibia servers<br> <b>Functions:</b><br> <b>Start:</b> Starts the server using ./theforgottenserver (no Autorestarter) Now with logging enabled.<br> <b>Save and Quit:</b> Saves the server the stops it.<br> <b>Kill Server:</b> Instantly Stops the server using "killall -9 theforgottenserver"<br> <b>Logs:</b> Shows the startup output after you have shut down server (a bit buggy server need to be offline to read it) <br> <br> </div> <script type="text/javascript"> function newPopup(url) { popupWindow = window.open( url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes') } </script> <!-- Buttons --> <div id="buttons>"> <form action="<?=$_SERVER['PHP_SELF'];?>" method="post"> <input type="submit" name="test" value="Start Server"> </form> <form action="<?=$_SERVER['PHP_SELF'];?>" method="post"> <input type="submit" name="safe" value="Save and Quit"> </form> <form action="<?=$_SERVER['PHP_SELF'];?>" method="post"> <input type="submit" name="kill" value="Kill Server"> </form> <!--<form action="<?=$_SERVER['PHP_SELF'];?>" method="post"> <input type="submit" name="test" value="Test Button do not use"> </form> --> <button onclick="newPopup('my.log')">Startup Logs</button> </div> <div id="info"> <br> <b>Current Bugs:</b><br> --NONE<br> <br> <b>Future Features:</b><br> --Be able to start server with auto restarter.<br> --More functions: Examples: Clean map and Save Server. (done just not added)<br> </div> <?php // end include 'layout/overall/footer.php'; ?> Configure o Caminho para seu servidor na linha 7 Em seguida vá em /layout/widget/loggedin.php e após <li> <a href='admin.php'>Admin Page</a> </li> Adicione <li> <a href='adminserver.php'>Admin Startup</a> </li> Pronto feito Isso o sistema já está implantado... (TESTADO EM UBUNTU 10.41) Creditos: JoccE Eu por traduzir e trazer ao TK! Antes que venha nego "Latir" ela sabe sobre este post! Eu no TK!. Tutoriais : Ativar Report (Znote) (NEW) Shop Gesior [TFS 1.x] Crafting System Ligar/Desligar Servidor Pelo Site (ZnoteACC) Layouts : Dwarf (ZNOTE) Dars (Gesior) Amiroslo bootstrap (Znote) Dark-Tibia (Znote) Vestia (Gesior) DarkSandOTS Layout FODACE se é pouca coisa u.u
Postado Maio 6, 2015 10 anos Tópico aprovado, irá ajudar muita gente. Este tópico foi movido: Para: "OTServ → WebSites → Tutoriais de Websites" STYLLER OT 2022
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.