Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


[DEBIAN] monkeyServer.sh :: A Script to install a full web stack at LEBs in 5 minutes
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

[DEBIAN] monkeyServer.sh :: A Script to install a full web stack at LEBs in 5 minutes

afterSt0rmafterSt0rm Member
edited December 2014 in Tutorials

monkeyServer.sh

Monkey Web Server

monkeyServer.sh is a simple shell script made to install a full web stack at low end boxes in about 5 minutes. It is built on top of Monkey Web Server, a really simple but feature rich web server. Monkey is really fast and stable, increadibly small and light on resources.

WHAT IS INCLUDED

monkeyServer.sh comes in two flavors:

DEFAULT FLAVOR

  1. Monkey Web Server
  2. PHP5-FPM
  3. MariaDB
  4. ConfigServer Firewall (CSF+LFD)
  5. Adminer

Running Process and Resource Usage for the Default Flavor:

Running Services
Memory Usage
SolusVM resources

NOSQL FLAVOR

This version don't include MariaDB or Adminer. Note that if you are using SQLite or any other database method that use files stored at your web root (like JSON files) you should configure the mandril plugin to deny access to the database files. This isn't built by monkeyServer.sh by default because we can't preview the filename patterns used by the users. Please refer to the documentation.

Running Process and Resource Usage for the NoSQL flavor:

Running Process
Memory Usage
SolusVM resources

WHAT MODULES IS INCLUDED IN THE INSTALLATION

monkeyServer.sh will build your stack with a very small set of PHP5 and Monkey Web Server modules. This should be enough to 99% of the use cases. Bellow you will find a full list of the modules.

MONKEY WEB SERVER MODULES

  1. auth
  2. liana
  3. liana_ssl
  4. logger
  5. fastcgi
  6. dirlisting
  7. auth
  8. polarssl
  9. palm
  10. mandril
  11. cheetah
  12. reverse_proxy

PHP MODULES

  1. mcrypt
  2. mysqlnd
  3. sqlite
  4. pear
  5. gd
  6. xml-serializer

MINIMUM REQUIREMENTS

  1. RAM: 128MB (or just 64MB if you use the noSQL option)
  2. HDD: 2GB
  3. CPU: Don't Really Matter
  4. Distro: by now, only Debian Stable is supported

P.S.: You can, actually, cut the RAM requirement in a half. BUT, for the default flavor, this can be equal to really boring problems with MariaDB if you use InnoDB. So, we will say that minimum memory requirement is to have a realiable server operation. Using less than that should work (with PHP-FPM tweaking you can run the noSQL with 16-24MB and the default with 32-64MB if you tweak MariaDB too) but is not recommended. In the near future, the embedded version should require only 8MB and the tweaks for PHP-FPM and MariaDB should be integrated.

HOW TO INSTALL

Just run /usr/bin/env bash <((wget -qO - https://raw.githubusercontent.com/alexandreteles/monkeyServer/master/monkeyServer.sh)) as root and follow the script instructions.

If you want to install the noSQL flavor, just run /usr/bin/env bash <((wget -qO - https://raw.githubusercontent.com/alexandreteles/monkeyServer/master/monkeyServer_noSQL.sh)) as root and follow the script instructions.

HOW TO OBTAIN SUPPORT

Here at Low End Talk or at the issue page of the project at GitHub.

WHAT IS PLANNED

  1. A menu based installation (this will join the default and the noSQL versions);
  2. A enableIPv6.sh script;
  3. App installation capabilities;
  4. FTP server installation;
  5. Embedded version (to require only 32MB of RAM)

LEARN MORE

  1. Take a look at this (a bit outdated) presentation about Monkey Web Server
  2. Read the official Monkey Web Server documentation. It's really handy.
  3. Learn about the reverse_proxy module in Monkey Web Server reading this article.
  4. Learn how to setup the reverse_proxy reading this tutorial.

RESOURCES

GitHub: https://github.com/alexandreteles/monkeyServer

«1

Comments

  • Oh wow, good work :)

  • Monkey Web Server performance comparison

    We all know that benchmarks can't say very much about real world conditions, but here you have some comparisons between Monkey Web Server and another good options out there:

    Benchmark: Raspberry PI - Monkey v/s Nginx - http://monkey-project.com/benchmarks/raspberry_pi_monkey_nginx

    Benchmark: Raspberry PI - Monkey v/s Busybox httpd - http://monkey-project.com/benchmarks/raspberry_pi_monkey_busybox

    Benchmark: Monkey v/s GWan in a Linux 64 bit platform - http://monkey-project.com/benchmarks/x86_64_monkey_gwan

  • Nice! thanks @EkaatyLinux

    I am using the nosql version

  • @Stevie said:
    Nice! thanks EkaatyLinux

    I am using the nosql version

    Please, let me know if you are facing any problems or have any questions/suggestions. Thank you!

  • @EkaatyLinux

    When I used the command you posted above it did not work at all, it did not give a error but did nothing, so I tried to wget it but would not download because of ssl certificate error, so I had to nano and copy and paste the monkeyServer_noSQL.sh and save the file which worked.

  • @Stevie said:
    EkaatyLinux

    When I used the command you posted above it did not work at all, it did not give a error but did nothing, so I tried to wget it but would not download because of ssl certificate error, so I had to nano and copy and paste the monkeyServer_noSQL.sh and save the file which worked.

    Can you paste the error here?

  • I would have to delete server and try again, I will do it tomorrow, a bit tired now. sorry.

  • @Stevie said:
    I would have to delete server and try again, I will do it tomorrow, a bit tired now. sorry.

    No problems.

  • Wuhoo, we got something on debian as well :)

    Good job mate, giving it a try ;)

  • Installed, Seems good but no love for dummies like me :(

    Would love an option to add virtual host like we have in centminmod :)

  • @Sady said:
    Installed, Seems good but no love for dummies like me :(

    Would love an option to add virtual host like we have in centminmod :)

    I will make a menu in the next release to allow vhost configuration and add IPv6 support. Obviously we will have some more options too but this is the priority by now. Take a look at /usr/local/etc/monkey/sites/default and copy/edit this file to enable new vhosts. You need to restart Monkey after that to enable the new vhost. In the op you will find a link to the documentation, look at this to find more options to the vhosts that you will setup.

    Just wait after the new year and I will release a new version :)

    P.S.: I will give a lollipop to anyone that take a little time to benchmark this setup. :D

  • installed it on one of my boxes good work brotha

  • Do you support auth with Pam or radius?

  • @catding said:
    Do you support auth with Pam or radius?

    With some configuration Monkey auth module can be capable to support pam. But I think that Radius is out of question. Today I will start to work with this script again and will try to figure how to do pam authentication. Do you want to use this in a embedded solution? If so, I think that you should wait for the embedded version (that will not have PHP support) and use Lua to serve dynamic pages.

  • Stevie said: not download because of ssl certificate error,

    wget linktodownload.com/file.ext --no-check-certificate
  • monkeyServer.sh v0.2alpha

    WHAT IS NEW

    1. New menu based instalation;
    2. Default and NoSQL flavors are now just one script;
    3. You can now create and delete vhosts on the menu install;
    4. Install SQL Admin on demand on a choosen vhost.

    KNOWN BUGS

    1. The option to install Adminer will list some directories under the vhosts dir that isn't actually vhosts;
    2. When restarting Monkey, the STDOUT don't render correctly, type a non default option and hit the return key to clean the interface;
    3. Local mail routes aren't being configured. Please, wait for the next release as we will include the right config files.

    PLANNED FEATURES

    1. Fix all the know bugs;
    2. Chrooted install option;
    3. Docker support;
    4. CentOS support;
    5. Embedded install option;
    6. Lua support;
    7. FTP server install option.

    HOW TO INSTALL

    Just use the command on the OP. If you face any errors with SSL or no error/no download just add a space and --no-check-certificate to the end of the URL on the provided install command.

  • Well, I like the idea! Never heard before about the money http server :) tried today, chose the full script and did everything in the menu from 1 to 6. But afterwards, there was nothing listening to port 80 (netstat -plant).. Do I have to start the daemon manually? Sorry if that's stupid, but I only used Apache and nginx this far :) was a VPS with Debian 7 i386.

  • Oh, monKey server for sure. Always this auto correction :D

  • Can you provide me the compilation log? I will make a update that creates a log on the current folder. Can you run it?

    If possible, provide me The output of this commands:

    which monkey
    which banana
    monkey (type CTRL+C to end Monkey execution if it keep running)
    And a tail of all files that are on /var/log/monkey/

    I will be here to help you solve this problem. Thank you!

  • what's the advantage of monkey over nginx besides the performance benchmarks you posted? or it's just "yet another web server"?

  • @EkaatyLinux no, I actually can't, sorry. Did this on a VPS for testing purposes only yesterday and wanted to test something else later, so I reinstalled it. I will use your script later again (it's nearly 2 am here in Germany now, I'm on my phone and kinda tired..) and post / Upload the log and outputs :) thanks for your support!

  • Can we install Wordpress on this...???

  • afterSt0rmafterSt0rm Member
    edited January 2015

    @CoolMoon said:
    what's the advantage of monkey over nginx besides the performance benchmarks you posted? or it's just "yet another web server"?

    Well, here you have some good points about Monkey Web Server:

    Monkey is ridiculously small, light, fast and powerfull

    Monkey was build to be a very small Web Server. The binary generated when you compile Monkey WS source have only 2MB if you use jemalloc or ~85KB if you choose the libc malloc. With some compiller tweaking you can have a ~60KB binary with little performance impact. Because of this aspects of Monkey, you can run a full featured web stack on really small machines. To say the truth, you can use Monkey on very restrained resources (like routers) to serve static and CGI pages.
    As Monkey is still a robust web server, it can handle high loads without doing any cache. This makes Monkey light on almost every resource: it requires low RAM, low CPU and low HDD.

    Monkey is easily extensible

    Monkey is really easy to configure and very fast with CGI/FastCGI interfaces. You can write plugins in no time as the Monkey API is very easy to use. OK, you need to know C and the learning curve is freaking crazy but is really easy to understand and apply the Monkey programming concepts.
    Monkey Web Server has a default set of plugins that can cover the majority of use cases that needs very huge and slow solutions (htaccess) or hard configuration (lighttpd/nginx). You can enable/disable the plugins on the fly and activate some of them on a "per vhost" way.

    Monkey is secure

    Monkey was one of the Web Servers that hasn't been affected by Heartbleed and others SSL vulnerabilities as it use PolarSSL or LianaSSL (their own implementation of SSL). The mandril plugin is very powerfull on permission control (as you have full control over the patterns used to block or allow user access to server resources).

    Monkey code is understandable

    Monkey code is very clean and follow a strict pattern. If you want to know what is happening on Monkey at every step of the server you can pick the code, read it, and with low efforces understand the architecture of the application. This way, you can easily write patchs to the code and really dominate the application that you are running on your machine.

    I like Monkey

    And this is one the key factors that makes me recommend Monkey. It is light, secure, fast, extensible, and I can actually have easy access to the developers and understand the code. I know that Monkey isn't suitable for all use cases (the reverse proxy, for example, isn't havily tested) but I love it and want to spread the Monkey name to the World :D

    P.S.: Sorry me for my bad english.

  • afterSt0rmafterSt0rm Member
    edited January 2015

    ****> @icry said:

    Can we install Wordpress on this...???

    Of course. You just need to install PHP-FPM and MariaDB or use the Wordpress SQLite plugin. If you want to use friendly URLs you will need to port the Wordpress htaccess rules.

    P.S.: the URL rewrite functionality is only partially available at the dev branch (Monkey source at GitHub)

  • @nexusrain said:
    EkaatyLinux no, I actually can't, sorry. Did this on a VPS for testing purposes only yesterday and wanted to test something else later, so I reinstalled it. I will use your script later again (it's nearly 2 am here in Germany now, I'm on my phone and kinda tired..) and post / Upload the log and outputs :) thanks for your support!

    No problems. I will be here to help you. When I update the code I will make a release post here on this topic to let you know.

  • Alright, the night got longer than I thought, huh.. The monkey is running now (on another server with Debian 7 amd64) but 500 internal server error when it should execute a php. Can I send you any error log? In /var/log/monkey/error.log it also just says internal server error, no "reason" why the error occurred. And yes, I installed php-fpm :)

  • @nexusrain said:
    Alright, the night got longer than I thought, huh.. The monkey is running now (on another server with Debian 7 amd64) but 500 internal server error when it should execute a php. Can I send you any error log? In /var/log/monkey/error.log it also just says internal server error, no "reason" why the error occurred. And yes, I installed php-fpm :)

    That sounds like PHP-fpm is not running or the web server is unable to connect to it.

  • WeblogicsWeblogics Member
    edited January 2015

    @EkaatyLinux

    I quickly reviewed the script and if I read it correctly, at the beginning it performs an apt-get upgrade then an apt-get dist-upgrade.

    Any valid reason for this? I would hesitant to blindly force a dist-upgrade on a production system as there can be issues.

    From the apt-get manpage:

    dist-upgrade
    in addition to performing the function of upgrade,
    also intelligently handles changing dependencies with new versions
    of packages; apt-get has a "smart" conflict resolution system, and
    it will attempt to upgrade the most important packages at the
    expense of less important ones if necessary. So, dist-upgrade
    command may remove some packages. The /etc/apt/sources.list file
    contains a list of locations from which to retrieve desired package
    files. See also apt_preferences(5) for a mechanism for overriding
    the general settings for individual packages.

    Also what is the install and purpose of Exim for? The end user should have the option of not installing software they may not want/need to be installed.

  • @Weblogics said:
    EkaatyLinux

    I quickly reviewed the script and if I read it correctly, at the beginning it performs an apt-get upgrade then an apt-get dist-upgrade.

    Any valid reason for this? I would hesitant to blindly force a dist-upgrade on a production system as there can be issues.

    This script was built to run on clean installs. I will add a option to not dist-upgrade the distro on the next update.

    Also what is the install and purpose of Exim for? The end user should have the option of not installing software they may not want/need to be installed.

    Exim4 will be installed only to provide local mail delivery when you install CSF+LSD. It will be used by LFD to send to root@localhost all messages from the intrusion detection system.

  • @nexusrain said:
    Alright, the night got longer than I thought, huh.. The monkey is running now (on another server with Debian 7 amd64) but 500 internal server error when it should execute a php. Can I send you any error log? In /var/log/monkey/error.log it also just says internal server error, no "reason" why the error occurred. And yes, I installed php-fpm :)

    You can send me a PM with the content from the logs? Did you tried the commands that I recommended on the previous post?

    The 500 internal server error should be a problem with PHP-FPM. Send me the output of the ps aux command with the logs.

    Thank you!

Sign In or Register to comment.