BukkitHTTPD
BukkitHTTPD
Faster then ever!
Overview
This is a continuation of BukkitHTTPD from codename_B.
Installation
- Put the BukkitHTTPD.jar in Bukkits plugins folder.
- Start up the server.
- Change the index.html.page
- Have a look at the <yourServerIP>:8107/test.v10 page and it's sources to see how to use the server-side scripting language.
- Change the test.v10 page.
- Add as many other pages as you want.
Configuration
The configuration can be found in the file plugins/BukkitHTTPD.yml.
After the first server startup you can configure it in-game (see Commands) or edit the file and reload it (see Commands/Reload).
You can also change the banner background by editing the BukkitHTTPD.jpg file in the web folder.
Commands
Use the following commands to configure the httpd server on the fly:
Port
"/httpd port" to view the server port or
"/httpd port newPort" to set the server port to "newPort" or (this is for the banner)
"/httpd port hide" to toggle the server port hide feature.
Banner
"/httpd banner" to toggle the banner switch.
This switch decides if the banner will be created or not.
Color
This is for the banners text color: "/httpd color" to view the color or
"/httpd color newColor" to change the color to "newColor".
Refresh
"/httpd refresh 60 to set the banner refresh time to 60 seconds (1 minute).
Plugins
"/httpd plugins to toggle the plugins switch.
This switch decides if plugins are shown on the banner.
Directory
"/httpd dir" to view the www folder or
"/httpd dir new/folder/" to change it to "new/folder/".
PHP
"/httpd php" to toogle PHP support.
"/httpd php /path/to/php.exe" path to the php(-cli) executable.
Bans
"/httpd bans" to toogle the minecraft ban feature.
This feature uses minecraft bans for the http access, too.
Admin
"/httpd admin playerName"
This toogles playerNames web admin state, used to administrate the minecraft server through the web browser. See V10 scripting language for more details.
Error
"/httpd error 404" to show the current 404 error page.
"/httpd error 403" to show the current 403 error page.
"/httpd error number file" to set the number error page to file.
v10, php and vhp files supported!
Reload
"/httpd reload" to reload the configuration from disk.
Password
"/httpd password pwd" to set your httpd password to "pwd".
"/httpd rmpwd user" to delete the password of user "user".
Update
"/update BukkitHTTPD" to update this plugin. Have a look here for more information.
Permissions
All httpd commands are secured with this superPerms node:
bukkithttpd.admin: description: Administrate BukkitHTTPD. default: op
except the /httpd password command, which is secured with this one instead:
bukkithttpd.user: description: Be able to change your BukkitHTTPD password. default: true
autoupdate.announce: description: Users with this node will be notified about new updates. default: op
autoupdate.update.bukkithttpd: description: Users with this node will be able to use /update this plugin. default: op
for more information about the autoupdate nodes have a look here.
V10 scripting language
Have a look at this page.
PHP
BukkitHTTPD uses the cli version of php (not tested with the cgi version), keep that in mind (different configs, ...)!
You can have a custom php.ini for BukkitHTTPD, simply save it into your bukkits folder (not the plugins folder!). But a few config values are hardcoded.
There's a new file extension, too: vhp. vhp files will get parsed for the V10scripting language and PHP (in that order).
The global php variables are slightly different. There's no $_POST or $_GET, it's all in $argv (and $_SERVER['argv']). Also the $_FILE array has changed. there's only $_FILE['*']['name'] and $_FILE['*']['tmp_name']. This is no longer the case since v0.2 That's the bad news, now the good: There's a new array: $_MINECRAFT ! :)
Please note that you should use .v10 files instead of .php or .vhp whenever you can, simply to reduce the math done on the server.
Integrated chat
To use the integrated chat simply access your BukkitHTTPD url and attach /chat to it. Example:
myBukkitServer:8107/chat
don't forget to set a httpd password first! :)
Since 0.1.5 web admins can reload and shutdown the server from the chat interface, too.
Banner
BukkitHTTPD will create a nice-looking banner for you. Example: You'll find it as banner.png in your www folder. To change the background simply change the BukkitHTTPD.jpg file in the same directory.
Custom error pages
BukkitHTTPD supports custom pages for the 403 and 404 HTTP errors.
See Configuration for more information.
Thanks
- To codename_B for his awesome work.
To the original authors of NanoHTTPD, which is the base of this plugin.This is no longer the case since v0.2- To Luficer for updating the html/v10 files of the integrated chat.
License
This plugin is licensed under the GPLv3 and has it's sources included in the jar. With one exception: The files "NanoHTTPD.java" and "NanoHTTPD.class" which aren't present anymore since v0.2 are licensed under the NanoHTTPD License, which you can read here:
Copyright (C) 2001,2005-2011 by Jarno Elonen <[email protected]>
and Copyright (C) 2010 by 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.
14:26:40 [INFO] Dannne11 [/192.168.1.43:54831] logged in with entity id 318 at ([world] 74.875, 93.0, -202.96875) 14:26:46 [VARNING] Task of 'BukkitHTTPD' generated an exception java.lang.NullPointerException at com.boxxians.DrAgonmoray.BoxxWorldMap.BWMFunction.onBukkitExecute(BWMFunction.java:27) at de.V10lator.BukkitHTTPD.RAMFiller.run(RAMFiller.java:139) at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:137) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:493) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425) at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
Is it possible to make it port 80, because every time I do so I get the following error message on the next server restart (and it doesn't bind to port 80 immediately when i type /httpd port 80):
12:02:52 [INFO] [BukkitHTTPD] error!
12:02:52 [SEVERE] java.net.BindException: Permission denied
12:02:52 [SEVERE] at java.net.PlainSocketImpl.socketBind(Native Method)
12:02:52 [SEVERE] at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:353)
12:02:52 [SEVERE] at java.net.ServerSocket.bind(ServerSocket.java:336)
12:02:52 [SEVERE] at java.net.ServerSocket.<init>(ServerSocket.java:202)
12:02:52 [SEVERE] at java.net.ServerSocket.<init>(ServerSocket.java:114)
12:02:52 [SEVERE] at de.V10lator.BukkitHTTPD.NanoHTTPD.<init>(NanoHTTPD.java:172)
12:02:52 [SEVERE] at de.V10lator.BukkitHTTPD.BukkitHTTPD.onEnable(BukkitHTTPD.java:119)
12:02:52 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
12:02:52 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:968)
12:02:52 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
12:02:52 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
12:02:52 [SEVERE] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
12:02:52 [SEVERE] at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:348)
12:02:52 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:335)
12:02:52 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
12:02:52 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399)
12:02:52 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
12:02:52 [INFO] [BukkitHTTPD] disabled!
@dralletje You should be able to add functions like <?v10 banPlayer<playerName> ?>
EDIT: Also you should be able to read out post/get variables to make it more dynamic. ;)
@DarkMinecrafter
white in minecraft is &f nad in html it is #ffffff
what color code had white? and how can i disable the plugin listing.
Is it possible using the api to add a new v10 command? cuze I can now only add variables and commands are very cool :)
(like banning somebody from a web console :D)
@THDigi Simpy replace the files with empty dummies? :) For the banner I'll add an option in the next release.
@xclucky This shouldn't be and has nothing todo with JavaScript (JS is client side so the server doesn't even know it's there). BukkitHTTPD simply checks if the file is there and if not it creates it.
Please recheck if you are in the right folder by renaming your file to "test.html" and try to access that from your browser.
Why does it continue to show this page:
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
when my index.html in plugins/BukkitHTTPD is:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>World of Clucky - Home</title>
<script type="text/javascript" ></script>
<script type="text/javascript" language="javascript" ></script>
<script type="text/javascript" language="javascript">
var linkname;
var str;
var pagex;
</script>
<style type="text/css">
{margin-left:10px; margin-right: 10px; height:200px; margin-top:10px; background-color:white; background-image:url('graphic/headerbackground.png'); background-repeat:no-repeat; border:2px solid black; position:relative;}
{}
/*<!
#title, #tagline, #logo>*/{border:2px solid black;}
</style>
</head>
<body style="background-color:#696969; background-image:url('graphic/stonebrick.png'); background-repeat:repeat; margin:0px;">
<!
<Login>><!
<div id="testarea" style="position: fixed; bottom:0px; height:50px; width:500px;; background-color:white; z-index:2; margin-bottom:5px; border:2px solid black; margin-left:-250px; left:50%;"><input type="text" id="username" value="username" /><input type="text" id="password" value="password" /><input type="button" onclick="login()" value="submit" />></div>
<!
<HEADER>><div id="header">
<div id="title" style="position:relative; top:50px; left:175px; width:325px; background-color:none; height:auto;">
<center>
<a href="http://www.worldofclucky.webs.com" style="text-decoration:none; color:black;">
<span style="text-align:center; font-size:2.5em; text-shadow:2px 2px 2px #FFFFFF;">World of Clucky
</span>
</a>
</center>
</div>
<div id="tagline" style="position:relative; top:60px; left:175px; width:325px; background-color:none; height:auto;">
<center>
<span style="text-align:center; font-size:1.25em; text-shadow:1px 1px 1px #FFFFFF;">
<i>SMP with an economy.</i>
</span>
</center>
</div>
<img id="logo" src="image/WOCLogo.png" style="position:relative; left: 100px; top:-15px;" />
</div>
<!
<CONTAINER>><div id="container" style="position:relative; height:auto;/* background-color:white; border:2px solid black; margin:10px;*/padding:-2px;">
<table border="0" style="width:100%;">
<tr>
<td valign="top" width="auto">
<!
<NAVBAR>><div id="navbar" style="margin:7px; margin-right:3px; min-height:350px; width:260px; background-color:#E8CC9F; background-image:url(graphic/dirt.png); padding:20px; border:2px solid black;">
<table border='1' style='padding:0; background-color:white; width:100%; height:100%;'>
<script type="text/javascript" ></script>
</table>
</div>
<!
<CONTAINER:tags>></td>
<td width="auto" style="width:100%;">
<!
<CONTENT>><div id="content" style="margin:7px; margin-left:3px; margin-right:7px; background-color:white; background-image:url(graphic/sand.png); border:2px solid black; min-height:350px; min-width: 370px; padding:20px;">
<script type="text/javascript" ></script>
<span> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@
</span>
<!
<CONTAINER:tags>></td>
</tr>
</table>
</div>
<!
<FOOTER>><div id="footer" style="position: relative; margin:10px; margin-top:0px; height:50px; background-color:white; background-image:url(graphic/bedrock.png); border:2px solid black;">
</div>
</body>
</html>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
does it not support javascript?
Can you please make it so that it doesn't re-create it's files every time I start the server ? I don't want the chat folder and those banner files there but it keeps re-creating them... I'm just gonna delete them from the jar file for now.
EDIT: you should also add a config option for that banner file, maybe some people don't want it.
Thanks.
@Ticksy
The V10 scripting language has some functions to manage a server, but not many. Have a look at the integrated chat for examples (you need web admin rights for some functions).
Can I use the plug-in to remotely manage the server?
@cocoson
Sorry, but that's not possible. It says it can't find the class org/bukkit/configuration/InvalidConfigurationException - as the path shows, it's a class from bukkit, not from BukkitHTTPD. It's part of the new configuration API which is in bukkit since RB 1317 (but buggy, better use 1337).
i keep getting the same thing as mbl111
and mine is up to date using build 1337
Oh wow :D
Seriously good work right here, nice!
@V10lator
Ahh, thanks heaps. I thought i was on the latest version. But apparently i forgot XD
@mbl111
Your bukkit server is outdated. Please update it. :)
I keep getting an error, I happened the first time i run it, and it keeps happening.
@ewized
Done. :D
What about php and can you add support for that.