Skip to content

Hypnotoad prefork web server

yuki-kimoto edited this page Mar 1, 2011 · 13 revisions

Hypnotoad Prefork Web Server

Mojo::Server::Hypnotoad is built-in prefork web server in production environment. hypnotoad is command line interface to run Mojolicious application by Mojo::Server::Hypnotoad.

Note that Mojo::Server::Hypnotoad and hypnotoad is EXPERIMENTAL and might be changed without warnings.

Management

Start Server

Start Server.

hypnotoad myapp.pl

Server start on port 8080 by default. you can access it from web browser.

http://localhost:8080

Process ID file is created in the same directory.

hypnotoad.pid

Stop Server immediately

If you want to stop server immediately, send TERM signal to server porcess ID which is saved in pid file.

cat hypnotoad.pid | xargs kill -TERM

How to start server automatically after OS start.

If you want to run server from root user, you switch application user and type hypnotoad command.

su - appuser -c 'hypnotoad $HOME/webapp/myapp/myapp.pl'

And you add this into OS startup config file such as rc.local

/etc/rc.d/rc.local

Clone this wiki locally