Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 14 of 14
  1. #1
    Member
    Join Date
    Nov 2007
    Posts
    151

    Default Running without cPGS

    I use cPGS and love it, but I was wondering if it would be possible to upload linux server files for games into .gameservers/someserver and make a cron job that would make the server run?

    If it is possible, how would I be able to put it to an IP address, would the user account need a dedicated IP bound to it?

  2. #2
    cPanel Staff
    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    1,881

    Default

    Clarify a bit exactly what you want done. You want to upload mods to existing servers, or upload servers directly without installing via cPanel, or upload unsupported servers ? Whatever, the answer is yes, I think. To make config edits like allowing an IP for a user, you'd have to edit some /var/cpanel/gameserv* files to set it up. I imagine a crafty crontab script could take info from a special text file uploaded with the server to add the user based on information inside, but it'd require some hackery to get just right I think.

  3. #3
    Member
    Join Date
    Nov 2007
    Posts
    151

    Default

    lol, sorry. To be A LOT more specific:

    I want to take a Jedi Academy or Jedi Outcase server package that I downloaded and install it on one of my accounts on my server. So say I have user "chuck" I want to install the JA or JO server in .gameservers/jk2 or .gameservers/ja. Is it possible to have the server run without using cPGS?

  4. #4
    cPanel Staff
    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    1,881

    Default

    Well sure you can upload a game server to an account and run it from the cli like you normally would without any kind of panel frontend. You would need to create some html files to have a chance at getting the start button to work, anything else would require custom programming. Jedi Academy is right at the top of my list, I'm just having a hard time finding a legit copy for PC to buy at the stores

  5. #5
    Member
    Join Date
    Nov 2007
    Posts
    151

    Default

    Well I was able to add Jedi Outcast and start the file using SSH and then play in the game. But as soon as I exit putty (my SSH program) the server stops and the process is killed. How can I keep the server running without putty open?

  6. #6
    Member wolfy's Avatar
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    45

    Default

    try adding the & charactor to the end of the command string to run the application in the background

    example:

    /folder/application.sh -params &

  7. #7
    Member
    Join Date
    Nov 2007
    Posts
    151

    Default

    So use this:?

    ./jk2ded +exec server.cfg +set net_IP x.x.x.x +set net_port 12700 &

    where x.x.x.x=my ip? That's the the command line that works but doesn't run in the background (unless the & works and it didn't when i tried )

  8. #8
    Member
    Join Date
    Nov 2007
    Posts
    151

    Default

    The & didnt' work to my needs, but I found what did "nohup"

    so I would do this line:



    nohup ./jk2ded +exec server.cfg +set net_IP x.x.x.x +set net_port 12700

  9. #9
    Member
    Join Date
    Nov 2007
    Posts
    151

    Default

    Does anyone know any commands I could use in PHP to execute the command I put above? I need to make an HTML web-based page just to allow a "start" "stop" and config file settings for Jedi Outcast.

    Is there a way to use SSH in PHP when the SSH user has a username and password?

  10. #10
    SNN
    SNN is offline
    Member
    Join Date
    Oct 2007
    Posts
    78

    Default

    Quote Originally Posted by SyntaxLAMP View Post
    Does anyone know any commands I could use in PHP to execute the command I put above? I need to make an HTML web-based page just to allow a "start" "stop" and config file settings for Jedi Outcast.

    Is there a way to use SSH in PHP when the SSH user has a username and password?
    Yes, SSH2 functions using PHP.
    http://us.php.net/ssh

    Maybe you could place the PID in a jk2.pid file using < jk2.pid
    All the best,
    Billy E.
    Massivesoft.org Developer

  11. #11
    Member
    Join Date
    Nov 2007
    Posts
    151

    Default

    Ok, thanks. You don't even have to install that just upload it apparently and change the php.ini file. Easy. Thanks. I'll test it later today.

  12. #12
    Member
    Join Date
    Nov 2007
    Posts
    151

    Default

    How does cPGS execute commands? What language does it use? PERL?

    I still am unable to login to make a script for a login to an SSH program, or just to simply run a command sequence. Does anyone know how to do this? It can be PHP, PERL, pretty much anything that can be incorporated into an HTML page.

  13. #13
    cPanel Staff
    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    1,881

    Default

    Yeh, cPGS is all perl (as is cPanel.)
    Here's a little snippet to have perl log into a remote server and run ssh commands. Note that from my workstation to the machine in the office it still took 5 seconds to run (it has to log in to the server, run the command, wait for the reply). If you want to embed it in a hi traffic website, I suggest crontabing the script to run every minute or so and have it dump the value to a file that then parsed to show the needed information.

    : time perl ssh.pl
    <pre>
    uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
    </pre>

    real 0m5.309s
    user 0m0.028s
    sys 0m0.020s

    The script is here-> http://cpgs.cpanel.net/ssh.txt , with IP and pass changed to protect the innocent. Please don't run this as it is since the IP is for a server at the NSA and they probably won't like it if you try logging in as root over and over..
    Note that there is no code for resolving dns there, so use IPs, hostnames won't work.

    Hope that helps..


    I forgot to add, you'll probably need to install the ssh modules for perl, just doing the following should work as root via the cli:

    perl -MCPAN -e 'install Net::SSH'
    perl -MCPAN -e 'install Net::SSH::Expect'
    Last edited by darren; 06-20-2008 at 11:23 AM. Reason: perl module info

  14. #14
    Member
    Join Date
    Nov 2007
    Posts
    151

    Default

    Ok, thanks a lot, exactly what I was looking for. I'll try it out in a few and let you know of the outcome.

Similar Threads & Tags
Similar threads

  1. How do i get sa-mp 0.3a for my cpgs
    By unique1801 in forum cPGS Discussions
    Replies: 1
    Last Post: 10-26-2009, 02:06 PM
  2. cPGS 0.5.3
    By darren in forum cPGS Discussions
    Replies: 13
    Last Post: 09-14-2007, 01:28 PM
  3. cPGS in X3
    By nicotine in forum cPGS Discussions
    Replies: 7
    Last Post: 08-27-2007, 09:22 AM
  4. couriertcpd is not running authdaemond is not running ?
    By Radio_Head in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-07-2005, 03:27 PM
  5. cPGS ET not running
    By made in forum cPanel Developers
    Replies: 1
    Last Post: 08-16-2005, 12:00 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube