Skip to content

Instantly share code, notes, and snippets.

@huberflores
Last active August 1, 2016 19:23
Show Gist options
  • Save huberflores/6907658 to your computer and use it in GitHub Desktop.
Save huberflores/6907658 to your computer and use it in GitHub Desktop.
MochiWeb installation
/*
* author Huber Flores
*/
#MochiWeb - Erlang
#Getting started
#Start by getting a copy of MochiWeb using Git:
$ git clone git://github.com/mochi/mochiweb.git
#MochiWeb source tree contains a README file that tells you how to create a new project. Let’s create a project called greeting:
$ cd mochiweb
$ make app PROJECT=greeting
#We can now compile the code for our new app and start it:
$ cd ../greeting/
$ make
#if ./mochiweb_request.erl:9: can't find include lib "kernel/include/file.hrl"
#then
#you have to install the package "erlang_dev" to include/use some libraries such as "stdlib/include/qlc.hrl"
#Another problem that was encountered is related to the universe APT repository was commented out in /etc/apt/sources.list. Once #I enabled them and apt-get install erlang-src erlang-tools
$ apt-get install erlang-dev erlang-tools erlang-src
#Now you can start the server
$ ./start-dev.sh
#You should see a bunch of PROGRESS REPORT messages. Among those message you should see something like {port,8080} which tells #you that your app is running on port 8080. You can now point your browser at http://localhost:8080 and you should see a message #telling you that it’s successfully running.
#If you go back to the terminal and press return you’ll get an Erlang shell that you can use to interact directly with your app. #It will come very handy for debugging or experimenting with libraries, similarly to the ./script/console of Ruby on Rails or #the manage.py shell of Django.
@KIVagant
Copy link

KIVagant commented Aug 1, 2016

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment