Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8162257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:40:03+00:00 2026-06-06T18:40:03+00:00

I’ve installed Snap/Haskell on my production Ubuntu server (on EC2), and checked-out my project

  • 0

I’ve installed Snap/Haskell on my production Ubuntu server (on EC2), and checked-out my project – but how do I run it?

I mean, locally, I run it from command line:

project-name -p 8000

Does snap come with it’s own web-server (it looks like it), and if so how do I go about configuring it to run as a daemon of some sort?

Any tips?

Edit 2:

On the wiki they say:

snap-server is an HTTP server library that supports the interface
defined in snap-core.

While here, the haskell wiki about “Deployment/Backend options for your haskell web code” says that Snap:

includes its own server. see Web/Frameworks

But HOW? How would I run it’s own server? Why must I know about deployment of the damn thing if I am just interested in programming…

Edit: related question: Deploy Haskell code that uses the Snap Framework

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:40:04+00:00Added an answer on June 6, 2026 at 6:40 pm

    Ok, so after some digging and asking, here is what I came up with.

    Big idea

    Compile your Snap application into a binary and then run it as a service with the help of upstart.

    Step by Step

    1. Compile your webapp. For the sake of this example, we’ll assume the webapp is at /home/john/webapps/mysite:

      $ cd /home/john/webapps/mysite
      $ cabal install
      ...
      Preprocessing executable 'mysite` for 'mysite-0.1'...
      Installing executable(s) in /home/john/.cabal/bin
      

      As we can see the, the binary is placed in /home/john/.cabal/bin. You may move it to any place you like, but we’ll leave it there.

    2. Create a log in your application folder, otherwise snap will complain:

      $ mkdir /home/john/webapps/mysite/log
      
    3. Now we will create a service that will run our webapp. To do so we will use Ubuntu’s service facility called upstart.

      a) We name our service simply by creating a conf file with the desired name in the /etc/init/ directory. Let’s call it mysite:

      $ sudo vi /etc/init/mysite.conf
      

      b) Now let’s add the description of what our service is:

      start on startup
      chdir /home/john/webapps/mysite
      exec /home/john/.cabal/bin/mysite -p 80
      

      First, we say that the service should run on startup (or on bootup) of the system.

      Second, since snap needs it’s snaplets and other static resources (like the log directory we created earlier) – we tell the service to run inside our project’s directory.

      Lastly, we specify the binary that actually will run as a service: /home/john/.cabal/bin/mysite. We pass the -p 80 parameter to the snap webserver to make it run on port 80. (Note: you have to disable all apache and nginx servers, so that they don’t take up that port any more)

    4. Done. You can check if it is running and start it manually if you need to:

      initctl list | grep mysite
      initctl start mysite
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to construct a data frame in an Rcpp function, but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.