Apple included Apache, the most popular server with Mac OS X. The natural choice for Web Sharing in OS X. But the question of the day is:
“To serve or not to serve?”SecurityApache is a very complex server. It contains tons of options and can be adapted for virtually any purpose. Used incorrectly it can be a wide open hazard.
Obviously anything in the “Sites” directory is publicly accessible. One possible hazard is someone putting a
CGI script that contains potential bug into this directory. There are many bots currently patrolling the web scanning IP addresses for a server running one of these scripts. A popular script “Formmail” by Matt’s Scripting Archive can result in spammers using your system.
Another possible hazard is that new security issues are discovered relatively often in Apache, and
PHP. Since the release of OS X, there have been several notable security issues. While Apple does provide updates to patch the problem, it can potentially take weeks, leaving your system open to attacks. Knowledge of Apache and
PHP is a must for running a server safely on your computer.
An advantage to Apache is having the ability to develop
PHP & Perl scripts right on your home system, and test them out. Another is the ability to share files via the web. A good solution to balance security with these uses is to block anyone else from accessing it. To do this create a file titled “.htaccess” (don’t forget the period) and write the following:
AuthName “Private”
AuthType Basic
<Limit GET POST>
order deny,allow
deny from all
allow from 123.456.789.1
</Limit>
Replace 123.456.789.1 with your IP address. Now you can access your site and nobody else can. Add your IP address from work, school, or your second computer to provide access, but still keeping others away. Note if you don’t have a static IP address you will constantly need to update this.
PerformanceAnother serious issue is performance. It takes
CPU time for Apache to work when a user is requesting a file. This does hinder performance, as well as disk access. With a small site hosted, it may not be such an issue, but as a site grows, this can become an annoyance.
Secondly, bandwidth can become an issue. 56k users occupy all their bandwidth with ease. One user downloading a file can bring their system to a crawl. Forget about a spider from a search engine getting through. Broadband users have much more to worry about.
ISPMost
ISP’s have specific policies against running servers off of a connection. Most require that you upgrade to a “business” level plan, which typically runs over $100/month and is based on how much bandwidth is used. Here are a few that have specific statements against the use:
COX’s agreement states “You may not operate, or allow others to operate, servers of any type or any other device, equipment, and/or software providing server-like functionality in connection with the Service, unless expressly authorized by Cox.” [
Link]
Comcast’s agrement states “You may not run a server in connection with the Service, nor may you provide network services to others via the Service unless you are subject to a Service plan that permits otherwise. Examples of prohibited uses include, but are not limited to, running servers for mail, http, ftp, irc, wifi, and dhcp, and multi-user interactive forums.”
Verizon DSL’s agreement reads “(q) to use your
VIS account for the purpose of operating a server of any type;”
I know for a fact that all 3 actively monitor for servers, and will cancel accounts with little or no notice. Be careful.
So what to do?Well there are several alternatives to running your own server. If you don’t need
CGI access, MacVillage.net does provide free hosting for up to 12
MB. For a few dollars there are no ads [
Hosting]. Apple has a similar offer with iTools [
Link]. There are many low cost hosts who will be able to provide the space and features you need, and they also will be more reliable since they mostly use multiple uplinks to connect to the net not to mention backup power.
The goal of this article was to make sure that before you switch on Web Sharing in Mac OS X you are aware of all the can happen. While not everything may apply to you, other potential problems may apply that I haven’t even discussed. If you have any doubts you should think twice before using this powerful feature.