Mineuniverse
Log in Register
Plugins

Uniport WebServer

A simple HTML Webserver running on the same port
by _ForgeUser15648997
Download Claim this project
2,834 downloads
0 likes
Updated Jun 30, 2026
0 hypes
Developer Tools General Informational Mechanics Website Administration

Does your hoster only gave you one port and you want to have a website trought? So here it is: a server mod that makes your bukkit server to both: Web and MC-Server :D

Uniport Webserver = HTML Webserver on same port as server :D

Configuration

  • Use own plugin OR
  • logMissingPages: true/false - Should the plugin log missing files? (by user request)

Specials since "little Download Update"

  • If you want to the user to download the file use the suffix "?download" for your file name (e.g. <a src="/index.png?download">Download</a>)

PHP-Data since "PHP Update"

  • $_REQUEST: array of http headers (e.g. Host, Accept-Language or User-Agent)
  • $_GET = $_POST: request parameters (e.g. ?v=Video123)

Commands

NONE

Permissions

NONE

How to install?

  1. Make sure you have CraftBukkit 1.7.x or 1.8.x and paste the folders from the zip into your bukkit.jar (main directory, a JAR = a renamed ZIP, use e.g. 7zip or WinRar to open and copy and paste)
  2. Then paste the WebBukkit.jar or UniportWebserver(maybe lite).jar into your plugins folder.
  3. Start your server.
  4. Add your website sites into the "UniportWebserver"-folder :D

How to handle the HTTPRequestEvent (for pros)?

@EventHandler
public void onHTTPRequest(HTTPRequestEvent event){
    // Request example: "GET /Minecraft HTTP/1.1 ..."
    String req = event.getRequest().split(" ")[1];
		
    if(req.equals("/")){
        req="/index.html";
    }
		
    File f = new File(getDataFolder()+req);
    if(f.isDirectory()){
        f = new File(f, "index.html");
    }
    if(f.exists() && !f.isDirectory()){
        try {
            event.setImage(IOUtils.toByteArray(new FileInputStream(f)));
            if(!f.getName().endsWith(".html")){
                event.setContentType("*/*");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Is there more data from the HTTP/1.1 Request?

Yes there is in the getRequest()-String, But there might be a wrong ip and port in the request file...

The PHP-Interpreter don't knows date() etc...?

Yes, you should use the Quercus/Java expressions for that (see http://quercus.caucho.com/quercus-3.1/doc/quercus.xtp)

 Templates...

best try to avoid them since they don't know about the 256kB limit. You should be able to create a website on your own with some tutorials from youtube, e.g. https://www.youtube.com/watch?v=3JluqTojuME

Bugs

Max file size 1.7.2

When the file is to big (>256kB - that's a lot for a text file as html, css or javascript) you will get a crash report (it seems big files need to long so the packet handlers notice that and fire an exception) in 1.7.2, in 1.8.x the download will stop without

To fix this for your website just split big files and load the parts. If you have a big background image you should upload it elsewhere - then it'll work (http://www.fotos-hochladen.net/ is free, for .zips or .jars or anything similar use Mega or Mediafire)

This plugin uses Metrics since "PHP Update"/"lite Update"

What is sent? http://mcstats.org/plugin/UniportWebserver + number of files downloaded

Special Chars Fix, extract like zip, then follow installing desc.
MC 1.7.2, CB 1.7.9-R0.2, CB 1.7.2-R0.2, CB 1.6.4-R2.0, 1.7.4, 1.8.3, 1.8.1, CB 1.7.2-R0.1, 1.8, CB 1.7.2-R0.3, CB 1.7.9-R0.1
Release 2017-02-05 Get
Lite Update
MC 1.8.1
Release 2016-01-09 Get
PHP Update
MC 1.8.1
Release 2016-01-09 Get
The little Download Update
MC 1.8.1
Release 2016-01-06 Get
Universal Uniport-Server (really...)
MC 1.8.1
Release 2016-01-05 Get
Old and first Release - only 1.7.2_R1
MC CB 1.7.2-R0.1
Release 2015-12-25 Get

More from _ForgeUser15648997

FallingTrees
46,676
Pictures
2,583
DiaPusher
1,469
The 3D Project
1,450
Plugin Help
1,193
MoreBlocks API
1,090

You Might Also Like

MCPanel
Plugin for MCPanel, control your server when you're not home.
7,839
SimpleClansStats
SimpleClansStats
7,828
PlayerLocations
Output JSON player data with the ability to hide
7,249
TwitBukkit
TwitBukkit
6,951
myBukkitAdmin
Administer your Bukkit Server from the web
6,930
WPAuth
Do you run a WordPress Website? Have your users promoted automatically!
6,355