[INACTIVE][ADMN/WEB] BukkitHTTPD 0.0.4 - now with more themable signatures [1000]

Discussion in 'Inactive/Unsupported Plugins' started by codename_B, May 13, 2011.

  1. Offline

    codename_B

    BukkitHTTPD 0.0.4
    For simple HTML based sites, on the same ip as your server. With stats. And signatures.

    [​IMG]
    Now with automatic banner creation! This is an actual banner from my actual server!



    History:
    • So for quite a while now, I've been annoyed at the lack of a "default html" page in bukkit - I want something that I can just set my DNS to and not have to install NGINX or apache, I just want to install my minecraft server and let it run. Well this is just that! No extra programs to install, no extra config files to edit. Just place your html in the right place and it does the rest. Now you can finally have a landing page on the same ip as your server, run by your server! Example: my server
    Usage:
    • Download BukkitHTTP.jar and install in /plugins
    • Run the server once, then stop it.
    • Change the default index.html in /plugins/BukkitHTTPD/index.html to whatever you wish your small html based site to be.
    • Start the server again, once it's started navigate to localhost:8107 (or whatever port you have configured) on the machine the server is hosted on. This should display your index.html
    • There is several configurable options which you must add to server.properties.
    Code:
    http-daemon-port: 8107
    server-name=Localhost Test Server
    server-dns=localhost
    text-color=000000
    • If you want your server to listen on port 80 (ie the standard web port you will need to set it to something like this)
    Code:
    http-daemon-port: 80
    server-name=MyAwesomeMinecraftServer
    server-dns=my.ip.com
    text-color=FFFFFF
    Screenshot:
    [​IMG]


    Current Themes:
    • These are all the themes that I have created/have been created for you by players.
    [​IMG]
    Simple dirt theme. Just replace BukkitHTTPD.jpg with this.
    [​IMG]
    Simple sand theme. Just replace BukkitHTTPD.jpg with this.
    [​IMG]
    Elegance theme by @eastonch with no branding. Just replace BukkitHTTPD.jpg with this.
    [​IMG]
    Simple minecraft theme. Just replace BukkitHTTPD.jpg with this.
    [​IMG]
    Flow theme. Just replace BukkitHTTPD.jpg with this.

    Download:
    • Version 0.0.4 zip bundled with player stats and signature generator Megaupload Mirror
    • Version 0.0.4 zip bundled with player stats and signature generator Main Mirror
    Source
    Thanks:
    • Thanks to spacemaniac and pluckerpluck on #bukkitdev for their help with debugging the exception code.
    • Thanks to the original authors of NanoHTTPD, from which this plugin is based.
    A bit more about:
    • The default port number had to be above 1024 incase users were not running bukkit as root on their system, similar to my hosting setup. If you get a socket error of some kind after trying a port below 1024, this is probably because you're not running as root on a *nix system - windows users should be fine. In which case, you should just direct your users to :8107, talk to your host about running as root, or get a minecraft server from someone who offers extensive NAT configuration such as PigSaddleHost ie. my server listens and serves on port :8107, but you all connect to it on port :80 in your browsers. Fantastic! You can also do this yourself with iptables.
    • I'm also working on modding a version of MCStats to work plug and play with this - providing you with player stats on your webhost!
    • There is now a signature generator bundled with BukkitHTTPD! You can mod this with any image you like, just swap out BukkitHTTPD.jpg for any image of the same dimensions, it will work right away. This will be at yourip/image.png
    • If you have any questions about the stats plugin please ask on their thread. I have bundled a modified version of it with this plugin for ease of use, it will work straight out the box.
    NanoHTTPD License:

    Copyright © 2001,2005-2011 Jarno Elonen <[email protected]> and Copyright © 2010 Konstantinos Togias <[email protected]>
    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
    Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    Changelog:
    • 14/05/2011 - v0.0.1: wrote source code and released plugin on bukkit.org after extensive testing and going live with it on my server.
    • 15/05/2011 - v0.0.2: changed default html page and bundled a stats plugin.
    • 25/05/2011 - v0.0.3: bundled themable banner creation.
    • 25/05/2011 - v0.0.4: added configurable color for the text. Changed output to .png
     
    Blechbuexse, JWhy, dark1256 and 3 others like this.
  2. Offline

    benning2009

    can you add a extra config.txt file???
     
  3. Offline

    benning2009

    can you ad something that i can change the 404 error like a extra file (404.html)????
     
  4. Offline

    V10lator

    @codename_B: for the 404 thing: I'm actually writing a plugin which has it's own webserver based on NanoHTTPD, too. It still has a function for custom 403/404 error messages (even if the path/filename is hardcoded right now) but if you like I could let you look at it... :)

    //EDIT: But... please don't laugh if you see it... especially when you see the very, very, very early V10parser part... xD
     
  5. Offline

    Sp0ng3b0b

    For PHP, try to write an extra application ex. phpinterpreter.exe -codetoexecute.php -get vars -post vars to interpret php on the fly in your plugin and print the output to the client.

    OR even better use the normal php cli and provide a main script that you try to split the post and get vars and make a run script like this: $_POST = <include java code for fetching vars> then include("file to execute.php");

    Good luck ;D
     
  6. Offline

    V10lator

    PHP? Such a heavy dependencie for a plugin? Nah...
     
  7. Offline

    Sp0ng3b0b

    Why heavy dependency. Nearly every unix system has php. For windows its not a problem too :) Just sayin ^^
     
  8. Offline

    V10lator

    Well, around 75% of the people who install bukkit have it as game server (so no way to get PHP), ubuntu (so to stupid to get...) or windows (so they try to install XAMPP and wonder why the plugin can't find it...) ... So a small, lightweight parser, which only does what's needed (and is connected to the bukkit API...) would be better... ;)
     
  9. Offline

    Sp0ng3b0b

    Maybe someone with good c++ knowledge could write a small on the fly parser.

    Woot i have an idea :) I could make one maybe. There is a PHP to exe compiler called Bamcompile. Maybe i can make it callable ex. php.exe -getvars -postvars -path_script_toexecute -outputfilepath.
    Would be windows only but possible :)
     
  10. Offline

    Iso

    I can't see any of those banner-templates :(
     
  11. Offline

    Lathanael

    Me neither.
     
  12. Offline

    dralletje

    is it possible to do something like a redirect of every incoming request?
    that if I go to the.IP.of.my.server I get the page at LOLOLOL.LOL without changing of the urL?
    so ther redirect is on the server and not on the client?
    and if I go to the.Ip.of.My.server/lolbol I get the page at LOLOLOL.LOL/lolbol?
     
  13. Offline

    Iso

    There is a way:
    you have to open notepad or notepad++, then paste this code:
    HTML:
    <html>
    <head>
    <meta http-equiv="refresh" content="0; URL=http://LOLOLOL.LOL/">
    </head>
    <body>
    You will be redirected to LOLOLOL.LOL
    </body>
    </html>
    save it as index.html
    and put it in your BukkitHTTPD folder
     
  14. Offline

    V10lator

    @Iso: Fail:
    @dralletje: This isn't possible server-side. But you can use an iframe to hide the URL change.

    //EDIT: Or do you mean you want to redirect from another server to a BukkitHTTPD page? This would highly depend on the setup of the other server, if you would use apache + php and your hoster give you the rights to open streams you could do so and send the output to the client, for example. Similar things are possible in other server setups. ;)
     
  15. Offline

    Iso

    Why Fail? It's a simple redirec to a site.

    I made a code for ONLY redirecting - nothing else.
    But if you want to make it like lol.lol/lol it wont work.

    No fails.
     
  16. Offline

    dralletje

    no I mean like in apache define a redirect in the httacces file.
    then it looks like you are on trol.lol but you are redirected server side to lol.trol.
    But i'll use a iframe for now :)
     
  17. Offline

    V10lator

    Just wanted to inform you guys that @codename_B: hasn't the time to support this anymore. But don't cry, there are new versions with many changes, read more. :)
     
  18. Offline

    thunderbird321

    This seems like a very useful plugin, but I somewhat new to bukkit so could someone explain to me in terms a noob would understand, exactly what this plugin does.
     
  19. Offline

    V10lator

    @thunderbird321: It is a http server (like apache) as a bukkit plugin. That means you can host a website with it. See the bukkitDev page for more information.
     
  20. Offline

    jkiejr

    dont know if this topic post or what ever is still active but how do i get rid of this plugin everytime i delete the bukkithttpd folder from my plugin folder it reappears
     
  21. Offline

    V10lator

    @jkiejr: it will recreate the default files, so delete the plugin itself or replace the default files (with empty dummies)...
     
  22. Offline

    Daniel Akkanen

    Hey nice plugin but my webpage (based on php) can't be read by the plugin. and I'm using linux so activate php for the plugin won't work bacuse it want a exe file. and when I don't activate php i get a HUGE amount of errors and the page reloads 10 times a sec. so please can you add suport for linux php
     
  23. Offline

    V10lator

    I'm using linux for myself and I developed the PHP part... >.>
    The only reason I wrote ".exe" at the end was cause I thought windows users will complain... But look at the file seperators: It's unix style... What I try to say: The command "/httpd php /usr/bin/php" should work just fine... ;)
    Just make sure you use the CLI version of PHP, not the apache/CGI one...
     
  24. Offline

    Daniel Akkanen

    Okey thanks for the help but I'm no't that high tech on linux so do you know where I can get php CLI?

    Edit:
    Never mind i found it. but I get this error when php is activated: FORBIDDEN: Reading file failed.
     
  25. Offline

    dans

    Great idea and also implimentation! Love being able to host a site along with the server, saves having to setup a subdomain to point to a website to display my server's help and info. Thanks a million!
     
  26. Offline

    V10lator

    Is the user which minecraft is running at allowed to read the file (try: chmod 777 yourfile.php) ?

    //EDIT: Also: Is this user allowed to execute the php binary?
     
  27. Offline

    Daniel Akkanen

    Yes the user are allowed to read/edit/delete the files. But how do i know of the user are allowed to execute the php binary?
     
  28. Offline

    V10lator

    Switch to the user and execute it? ;)
     
  29. Offline

    Daniel Akkanen

    Archive: /usr/bin/php/php.exe
    [/usr/bin/php/php.exe]
    End-of-central-directory signature not found. Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive. In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
    note: /usr/bin/php/php.exe may be a plain executable, not an archive
    zipinfo: cannot find zipfile directory in one of /usr/bin/php/php.exe or
    /usr/bin/php/php.exe.zip, and cannot find /usr/bin/php/php.exe.ZIP, period.
    When it try to run php.exe
     
  30. Offline

    V10lator

    1. exe = Windows binary = wrong
    2. zip? You should try to execute it, not to unzip it :confused:
     
  31. Offline

    Daniel Akkanen

    Okey i don't realy know, I just installed php5-cli in synaptic. I'm no't very good at linux.
    And it won't start when i try to open it with wine.
     

Share This Page