To fast track your Mako Server development, follow these simple steps:
|
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.
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.
To load an application, create a new directory such as "www" and start the server as follows:
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.
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.
You will get the following error if the Mako Server executable is not in your path:
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:
If the Mako Server is in the same directory as your www directory, you may start the Mako as follows:
See also Installing Mako Server as a Service (daemon) on Linux.