Code Monkey home page Code Monkey logo

ammarserver's Introduction

AmmarServer

AmmarServer

A lightweight extendable barebones HTTP server for linux

Please see the wiki for more info on whats going on in this repository : ) https://github.com/AmmarkoV/AmmarServer/wiki

This repository is also tracked via OpenHub https://www.openhub.net/p/AmmarServer

One of the most basic philosophies behind this is to try to add as much functionality possible in a reusable way WITHOUT overly increasing loc and dependencies.. The biggest recent improvements have been actually trying to merge common functionality and reducing loc.

Building


The projects build dependencies are the gcc compiler , pthreads , cmake and pretty basic things so if you issue sudo apt-get install cmake build-essential ( assuming a Debian/Ubuntu based system ) you should be able to compile it without problems..

Compression is supported , so you might want to also apt-get install liblzma-dev if you ENABLE_COMPRESSION at server_configuration.h MyURL Service needs libjpeg in order to serve captchas , so to add it sudo apt-get install libjpeg-dev

To perform a compilation you just need to issue "mkdir build && cd build && cmake .. && make" from the root directory

This should try to compile all of the project files which you can then run using the scripts listed in the list below

To update your version of the project you can use the provided script that updates directly from github It will remove any changes you have made to any of the files in the repository
./update_from_git from the root directory

Running


After building the server you can use one of the provided scripts in the root directory

  • ./run_ammarserver will start a basic file server ( serving public_html/ files ) on localhost:8080

  • ./run_myblog will start a small Wordpress like blog service on localhost:8086

  • ./run_social will start a small Social chat service on localhost:8087

  • ./run_myloader will start a file upload service on localhost:8085

  • ./run_mytube will start a youtube like service on localhost:8084 , you will need to change the VIDEO_FILES_PATHS paths and recompile

  • ./run_myurl will start a url shortner service (like tinyurl/goo.gl etc ) on localhost:8082

  • ./run_habchan will start a small 4chan clone on localhost:8083

  • ./run_geoposshare will start a GPS location server on localhost:8081 to track mobile phones ( see this Android Application )

  • ./run_myremotedesktop will start a remote desktop session viewable by a browser on localhost:8080 ( see video )

  • ./run_mysearch will start a server that serves a google like front page ( that does no searching though and is only cosmetic ;P ) on localhost:8080

  • ./startAmmarServerSuite.sh will start most of these simultaneously ( except remote desktop ) so you can try them out..

  • ./stopAmmarServerSuite.sh will stop them

Installing


Install scripts are provided ( ./install.sh and ./uninstall.sh ) but at the moment they only provide the "vanilla" file static server. Until sufficient testing has been done it is not advisable to use this in a production enviornment..

Features


This Repository contains :


AmmarServer is also an integral part , providing network connectivity and used in the following projects :

This project has also been successfully deployed as a means to control embedded platforms like Robots

ammarserver's People

Contributors

ammarkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ammarserver's Issues

Add a client request dispatcher

If we have multiple AmmarServers running on different machines , it would be cool to have a primary AmmarServer that is always on and redirects requests ( like a reverse proxy ) to load balance the other servers..

The same goes for high availiability content , we could create two different instances of the server redirect to the second one , recompile the first one and then change the dispatcher to have no downtime ..

Dynamic Request not handled properly

One one occasion the
./stats.html request got handled using the file ./stats.html instead of the dynamic request handle ..
this needs to be investigated..

When restarting AmmarServer it worked ok ..

Change the project name

I don't like "AmmarServer" as a webserver's name.

You should try something different. What do you say about "MasterServer", "MonsterServer" or something like that?

Add Apache like logging capabilities

AmmarServer should mimic the way apache logs visits in order for log analyzing programs that are compatible with apache to be compatible with ammarserver too..
Logs should also be FlashDisk friendly so there could be some kind of internal memory to hold them and maybe compress them before writing them on the disk.. , or writing them after an interval and not on each visit..

Add detailed input header parsing

Most of the HTTP header content gets ignored , some of it could be useful so there should be more detailed input header parsing instead for various other HTTP fields ..

Add Adminstrator/Stats WebInterface

I am thinking of adding a seperate dynamic webserver service which will be able to view active transactions , ban ip's , review bandwidth statistics , error messages etc ..

It will be a major feature for the WebServer.. It will bloat it though so it maybe should be implemented as a side project to AmmarServer ..
In any case there are a lot other things to be done before this , so its not the time yet..

Add Gzip compression

Add Gzip compression on text files to both reduce memory used by the cache but also reduce the bandwidth consumed on the upload channel of the webserver..!

Implement POST requests

POST requests must be implemented to allow interactive web pages to be served..
This is actually the goal of this server so it is pretty important

Add content generation helpers..

C isn't particularly friendly to multiline strings and other things that are handy when generating dynamic conetent for HTML/CSS/JScript pages..
Make some tools to improve this..

Accept absolute URL's in a request

accept absolute URL's in a request with a small parser that will not open up the server to malicious absolute URL's as per HTTP1.1 spec

MyBlog and General Content Creating Workflow

There needs to be an implementation about a content creation API workflow

For example in order to generate MyBlog indexes etc , there are some template text files that should get parts of them replaced with actual content , see this :
https://github.com/AmmarkoV/AmmarServer/blob/master/src/Services/MyBlog/index.c#L148

For now this is a first way to prepare buffers to be served to clients , there needs to be a proper implementation of the inject mechanism that will auto reallocate memory buffers etc

https://github.com/AmmarkoV/AmmarServer/blob/master/src/AmmServerlib/AString/AString.c#L196

any ideas are also welcome

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.