When you use HTTP Live Streaming (HLS), you do not need to have a dedicated streaming server. A simple web server such as the one you use to share your website is sufficient. On the Mac, this is an Apache server.
Up until OS 10.7, it was possible to simply enable Web Sharing in the Sharing System Preference pane.
Since Mac OS 10.8, the Web Sharing option has been removed from the System Preferences > Sharing page. You then have 3 options that we'll explain below:
- Purchase the macOS Server application from the App Store (recommended)
- Configure with Terminal commands
- Use a third-party application
There are also a number of articles on the web explaining just that.
Enabling Web Sharing with macOS Server
First you need to purchase and install the macOS Server application from the Mac App Store. You can do that here.
Once installed, you will find in your "Applications" folder an application named "Server" (do not search for an "OS X Server application).
When you start "Server", it will ask you a few basic things. Refer to the help and manual to know how to set that up, but here are a few recommendations:
- macOS Server has always been sensitive to the IP address used and any modification afterwards is complex. So before doing anything, make sure to configure your network with a Manually set IP address, so you are sure that your computer won't change IP address later on.
- Once you did the basic settings, the "Server" app will install and configure a whole bunch of new services that are not present with the client version of Mountain Lion. There will be a lot of indexing from Spotlight after the install. When starting your Server from the first time, it will most probably block your computer temporarily, so avoid having any production application running (for example it could block your Softron playout or ingest applications).
Note that the Server application install a whole bunch of services. Some only works well when DNS is properly configured. Make sure that your DNS is running and is properly configured to avoid any issue.
We won't go into details here as there are a number of articles that explain just that. Here is one.
Enabling Web Sharing with Terminal
Disclaimer: The following manipulation will be done at your own risk and Softron will not be liable to anything happening on your computer when using the following tips.
Modifying the location of your html pages
By default, when you enable Apache the default shared folder is this one:
But this folder requires root privileges, so you can't modify the files easily. You could modify the privileges of that folder, but we do not recommend it as some system upgrade could change it back.
The best is to modify the Apache settings in order to use any folder on your mac. To do that, open the Terminal Application, and enter the following command:
sudo pico /etc/apache2/users/`whoami`.conf
A window such as this one will open (this is a basic text editor through the command line interface):
Copy and paste the following text (replace "yourusername" with your users' name, or set whatever path you want there)
Options Indexes MultiViews
Allow from all
Press Ctrl + O, then carriage return (this should save the text file), and then Ctrl+X to exit the text editor program.
Once you have properly set the location of your "website", you still have to enable the Apache Server. You'll do that either with Terminal or with a third-party application.
Enable the Apache Server with Terminal
To simply activate Apache using Terminal, first make sure that you've enabled the root user. Then open the application "Terminal" located in the "Applications/Utilities" folder, then type:
sudo defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled -bool false
You will be prompted for your root password. Note that this will make sure that Apache starts when your computer boots. If you want to stop using Apache, just replace "false" at the end of the command by "true".
Note also that PHP or other services won't be started and need to be turned on manually also, but this is not the purpose of this article.
Use a third party application
Disclaimer: Again, we recommend using the built-in Apache server of macOS, using either the macOS Server application or Terminal. The following software are not affiliated with Softron, the use of these services will be done at your own risk and Softron will not be liable to anything happening on your computer when using the following tips.
There are a few third-party applications that will allow you to have a web server: