HOW TO: Enable Web Sharing ?

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 2 options that we'll explain below:

There are also a number of articles on the web explaining just that.

 

Enabling Web Sharing with OS X Server

First you need to purchase and install the OS X 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:

  • Mac OS X 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).
When Server has started and the window opens, scroll down the "Services" and search for the "Websites" service:
 
 
You can then click on the + icon to add a folder where your website will be stored. The default locations for that service are:
/Library/Server/Web/Data/Default/
 
Once properly configured, click on the on/off switch for the Website services and it should start.
 
 
About configuring your DNS

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 and/or a third party application

Disclaimer: Again, we recommend using the simple OS X Server application available through the App Store. 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:

/Library/WebServer/Documents/

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):

MLion_Terminal_Pico_empty.png

Copy and paste the following text (replace "yourusername" with your users' name, or set whatever path you want there)

<Directory "/Users/yourusername/Sites/">
     Options Indexes MultiViews
     AllowOverride All
     Order allow,deny
     Allow from all
</Directory>

 

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. You can read the following article to know how to activate those.

 

OR enable the Apache Server using a third party application

You can use an application such as the one from Cyclon Tyler which make it very easy to enable and disable your Apache service :

http://clickontyler.com/web-sharing/ 

Have more questions? Submit a request

Comments

Powered by Zendesk