Webadmin and php

BombBomb Australia Join Date: 2003-02-20 Member: 13766Members, Constellation, Reinforced - Shadow
Hey anyone know how to get php support for the web admin client? Trying to do some enhancements (db integration etc) and it no worky.
Best guess is the server web admin has no php support which is a major bummer.

Any work arounds out there? Sorry I can't find any threads on this subject and I'm not that familiar with how an NS2 server passes the info to the web client.
There's a lack of doco information on how this all hangs together (or at least that I can find).

P.S hope this is actually a limitation and I'm not just missing something.

Comments

  • BombBomb Australia Join Date: 2003-02-20 Member: 13766Members, Constellation, Reinforced - Shadow
    *Edit confirmed no php support*

    Ran the webadmin though Apache and php scripts are executed. Still leaves the problem though as I can't run two web servers on the same port.

  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    You'll probably want to talk to devicenull, as he put in most of the work for the webadmin afaik.

    As for the webadmin ports, the current workaround is to use the -webport launch parameter to have the additional webadmins run on different ports if they are using the same IP (e.g. Server 1 webadmin = port 80, Server 2 webadmin = port 81, etc).
  • BombBomb Australia Join Date: 2003-02-20 Member: 13766Members, Constellation, Reinforced - Shadow
    Thanks for the info Scardy, I have already tried but the problem is server.exe kicks off it's own webserver with no php support. I want to run the webadmin interface through Apache where I do have php running, that or have php supported in the standard webserver if possible.

    I can host the webadmin interface though Apache just fine, and php works. The problem is server.exe has to start it's own webserver or the web interface wont connect to the game server. Therefore using a webserver other then then dev's in built one wont work as you cant host two webservers on the same port. At least that is the assumptions I've come to given what I've tried out today.

    Thanks for pointing in the right direction though, I'll message devicenull and see if he's not too busy to give this a once over.

    Cheers.








  • ConfusedConfused Wait. What? Join Date: 2003-01-28 Member: 12904Members, Constellation, NS2 Playtester, Squad Five Blue, Subnautica Playtester
    I'm pretty sure that you aren't gonna get php working through the in game webserver.

    Even if you could, You probably wouldn't want to since a web request is still a blocking operation. That means no ticks in game until the request finishes. I know that the fix for that is on max's to do list but i don't know when the server will become threaded separately.


    If you want to run a php script, your best option is to do a REST JSONP service on apache. Then integrate the two on the front end in javascript. It keeps your server tick rate up and lets you run php in webadmin.
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    The server runs a very limited web server. This is intentional. Any processing the internal server has the potential to cause lag in game. There's no way to run any sort of code on the web server (well, you can add lua but it's not really a fully featured web server)

    Easiest solution is to just proxy all the requests to the game server via your web server. This is pretty simple do to with most web servers, or it's a couple lines of PHP.
  • BombBomb Australia Join Date: 2003-02-20 Member: 13766Members, Constellation, Reinforced - Shadow
    Thanks for the responses guys, you guys have filled in some of the knowledge gaps I have of how this all hangs together. I'll investigate a a different approach based off the recommendations in this thread.
Sign In or Register to comment.