Difference between revisions of "Icecast Server/Setup Windows Service"

From XiphWiki
Jump to navigation Jump to search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Most users that run Icecast on Windows want the ability to run it as a service, which was possible with older Icecast versions, but was removed in
+
Most users that run Icecast on Windows want the ability to run it as a service, which was possible with older Icecast versions, but was removed in recent ones.
recent ones. This page details the needed steps to run it as a service using <abbr title="Non-Sucking Service Manager">NSSM</abbr>.
+
This page details the needed steps to run it as a service using '''<abbr title="Non-Sucking Service Manager">NSSM</abbr>'''.
  
== 1. Install NSSM ==
+
== Install NSSM ==
 +
First, we need to download and install NSSM, the service manager that we are going to use.
  
First, we need to download and install NSSM, the service manager that we are going to use. Go to the [https://nssm.cc/download NSSM Downloads Page] and download the latest stable version.
+
Go to the [https://nssm.cc/download NSSM Downloads Page] and download the latest stable version.
Extract the zip archive. It will have two three folders:
+
Extract the zip archive. It will have two or three folders:
  
 
# src
 
# src
Line 12: Line 13:
  
 
If you are running a 32bit Windows version, open the win32 folder, else the win64 folder. (If you don't know, follow the steps on [https://support.microsoft.com/?kbid=827218 this page] to find out)
 
If you are running a 32bit Windows version, open the win32 folder, else the win64 folder. (If you don't know, follow the steps on [https://support.microsoft.com/?kbid=827218 this page] to find out)
Copy the contents of the respective folder to <code>C:\Program Files\NSSM</code> (or any other path, that is fine for you). Usually it is just the nssm.exe file.
 
  
== 2. Set up NSSM ==
+
Copy the contents of the respective folder to <code>C:\Program Files\NSSM</code> (or any other path you want). Usually it is just the nssm.exe file.
  
To set Icecast up in NSSM, open the Command Line by pressing the Windows Key + R and entering <code>cmd</code> in the execute Window.<br />
+
== Set up NSSM ==
 +
 
 +
To set Icecast up in NSSM, open the Command Line by pressing the '''Windows Key + R''' and entering <code>cmd</code> in the execute Window.<br />
 
'''Note''', if you are not logged in as Admin or your Windows Version has UAC, you need to run it as Administrator. Do so by either searching for
 
'''Note''', if you are not logged in as Admin or your Windows Version has UAC, you need to run it as Administrator. Do so by either searching for
 
cmd or going to ''Start'', ''All Programs'', ''Accessories'' and right-clicking Command prompt and choosing ''Run as administrator''.
 
cmd or going to ''Start'', ''All Programs'', ''Accessories'' and right-clicking Command prompt and choosing ''Run as administrator''.
Line 23: Line 25:
  
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
cd C:\Program Files\NSSM
+
cd "C:\Program Files\NSSM"
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Now we have to setup the Icecast service, to do so, type the following:
+
Now we have to setup the Icecast service. To do so, type the following:
  
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
Line 36: Line 38:
 
[[File:NSSM Setup.png|none]]
 
[[File:NSSM Setup.png|none]]
  
Click the three dots right to the Path field and browse the icecast.bat file, usually at <code>C:\Program Files\Icecast\icecast.bat</code>.
+
Click the three dots right of the Path field and open the icecast.bat file, usually at <code>C:\Program Files\Icecast\icecast.bat</code>.
 +
 
 
After confirming, it should automatically fill in the Startup Directory path (with the directory where the icecast.bat file is located).
 
After confirming, it should automatically fill in the Startup Directory path (with the directory where the icecast.bat file is located).
 
Switch to the Shutdown tab and uncheck both "Send WM_CLOSE to windows" and "Post WM_QUIT to threads".
 
Switch to the Shutdown tab and uncheck both "Send WM_CLOSE to windows" and "Post WM_QUIT to threads".
If you want, move to the Details tab and enter a proper name and description for the service. Confirm with the Install Service button, when you are done.
 
  
== 3. Start the Icecast service ==
+
If you want, move to the Details tab and enter a proper name and description for the service. Confirm with the Install Service button when you are done.
 +
 
 +
== Start the Icecast service ==
  
Now after having set up the service, let us start it. To do so, type the following in the command line window:
+
Since we have set up the service, let us start it.
 +
To do so, type the following in the command line window:
  
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
Line 61: Line 66:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
=== Show status ===
+
=== Show Status ===
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
 
nssm status Icecast
 
nssm status Icecast
Line 70: Line 75:
 
nssm remove Icecast
 
nssm remove Icecast
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
Added [[Category: Icecast]]

Latest revision as of 11:20, 16 May 2015

Most users that run Icecast on Windows want the ability to run it as a service, which was possible with older Icecast versions, but was removed in recent ones. This page details the needed steps to run it as a service using NSSM.

Install NSSM

First, we need to download and install NSSM, the service manager that we are going to use.

Go to the NSSM Downloads Page and download the latest stable version. Extract the zip archive. It will have two or three folders:

  1. src
  2. win32
  3. win64

If you are running a 32bit Windows version, open the win32 folder, else the win64 folder. (If you don't know, follow the steps on this page to find out)

Copy the contents of the respective folder to C:\Program Files\NSSM (or any other path you want). Usually it is just the nssm.exe file.

Set up NSSM

To set Icecast up in NSSM, open the Command Line by pressing the Windows Key + R and entering cmd in the execute Window.
Note, if you are not logged in as Admin or your Windows Version has UAC, you need to run it as Administrator. Do so by either searching for cmd or going to Start, All Programs, Accessories and right-clicking Command prompt and choosing Run as administrator.

Now we have to move to the right location where NSSM is installed, so if you put it in the above location you would need to execute:

cd "C:\Program Files\NSSM"

Now we have to setup the Icecast service. To do so, type the following:

nssm install Icecast

which should open a GUI where you can setup the Icecast service:

Error creating thumbnail: Unable to save thumbnail to destination

Click the three dots right of the Path field and open the icecast.bat file, usually at C:\Program Files\Icecast\icecast.bat.

After confirming, it should automatically fill in the Startup Directory path (with the directory where the icecast.bat file is located). Switch to the Shutdown tab and uncheck both "Send WM_CLOSE to windows" and "Post WM_QUIT to threads".

If you want, move to the Details tab and enter a proper name and description for the service. Confirm with the Install Service button when you are done.

Start the Icecast service

Since we have set up the service, let us start it. To do so, type the following in the command line window:

nssm start Icecast

Other commands

Stop

nssm stop Icecast

Restart

nssm restart Icecast

Show Status

nssm status Icecast

Remove Service

nssm remove Icecast

Added