Getting Started with the Mako Server

To fast track your Mako Server development, follow these simple steps:

  1. Read this page and watch the video below
  2. Download the Mako Server for your platform
  3. Optionally run the LSP tutorials by running the included 'tutorials script'
    • Linux and Mac: ./rundemo.sh
    • Windows: MAKO-TUTORIAL.cmd
  4. Follow the command line tutorials below
  5. Optionally install the Mako Server as a Service (daemon) on Linux

Prerequisites (What You Need To Know)

Although the server can be installed as a background process (aka daemon), you'll find it a whole lot more convenient to start and stop the server using the command line during web application development. We assume you have sufficient experience in running command line programs. We also assume that you have experience in using text editors such as Notepad on Windows and some experience in HTML and CSS design.

You do not need to know how to design or create server side Lua web applications. All you need to learn in order to get started with Lua and LSP is included in the Lua and LSP tutorial.

Command Line

You can start the Mako Server from the command line as soon as you have unpacked the server. The image slideshow below shows how to start the Mako Server on Windows and Linux. Mac users should use the Linux commands.

The server will automatically use alternative port numbers if the server is unable to open the default HTTP port number 80 and HTTPS port number 443. The center image above shows the server using alternative port numbers.

You can navigate to the server using a browser as soon as the server is running.

Enter http://your-server-address:port in your browser, where "your-server-address" is the domain or IP address to the computer running the Mako Server and "port" is the port number the server is listening on. You do not need to enter the port number if the server is listening on the default port 80. Enter the address http://localhost:port if the browser and server are running on the same machine.

Command Line Tutorial

To load an application, create a new directory such as "www" and start the server as follows:

mako -l::www

The above command tells the Mako Server to load the directory "www" as a root application. (See also the command line documentation for a detailed explanation of the above command). See Command Line Error below if the server fails to start.

Note: you will still get a “404 page not found” message when navigating to the server since you do not yet have any web pages in your newly created directory. You should now go ahead and create a new file in this directory. This can be done by simply performing a copy and paste of the LSP example (shown on the right here) into the file by using your favorite editor.

Save the file as "www/index.lsp" and press the browser's refresh button. You should now see a page that is dynamically created by the server. Note that the page you have created will change dynamically every time you press the refresh button.

Command Line Error:

You will get the following error if the Mako Server executable is not in your path:

  • Linux and Mac : 'mako: command not found'
  • Windows : 'mako' is not recognized as an internal or external command

You may either set the PATH environment variable to the Mako directory location or you may copy the Mako executable to a location in your path such as /bin; however, initially it is just easier to directly specify the path on the command line as follows:

  • Linux and Mac : /path/2/where/make/is/mako -l::www
  • Windows : \path\2\where\make\is\mako -l::www

If the Mako Server is in the same directory as your www directory, you may start the Mako as follows:

  • Linux and Mac : ./mako -l::www
  • Windows : mako -l::www

See also Installing Mako Server as a Service (daemon) on Linux.

Command Line Video Tutorial

The following three minute video gives an introduction to using the Mako Server from the command line: