Apache Web-Serving with Mac OS X: Part 1
by Kevin Hemenway12/07/2001
Editor's note: Most people know that Mac OS X ships with a built-in Apache web server, but don't realize that it's easy to configure and run. In fact, you can host a web site in minutes after completing just a few simple steps.
But that doesn't mean that Mac OS X is a lightweight in this category. It's not. In fact, you can drill down and get very serious with this state-of-the-art serving software.
In this first installment of a multi-part series, Kevin Hemenway shows you how to start serving web pages directly from your Mac. In the articles that follow, he'll show you the techniques that system administrators use for maintaing robust web sites. As you read Kevin's tutorials, you'll learn the functions of some of those mysterious folders deep within your Mac OS X hard drive, and will soon become your own "X" Sys Admin.
You stare at the screen, fingers twitching nervously. You've been telling the rest of the world how great Mac OS X is, basking in the sheer enjoyment of upgrading your Classic applications to jelly-powered delights. After much spouting, your boss has finally given you a chance to prove your saliva-laced rantings. The task is quite simple: "build the GatesMcFarlaneCo [1] intranet with features up the wazoo."
Once again, it's time to convince the herd about Mac superiority. What better way to begin than to use a well-respected web server that's proven its mettle time and time again?
Introducing Apache to the Mac faithful
Apache is regarded as the most popular web server available today. With its incredible portability and support for anything you'd ever want to do, Apple wisely decided to ship Apache with its Unix-based operating system. With this web-serving powerhouse at your fingertips, I'll explain how you can impress your boss and solidify your love for Mac OS X, all at the same time.
Getting started with Apache and Mac OS X
The easiest way to begin Apache web-serving is via your Mac OS X system preferences. Click your Apple Menu, choose "System Preferences," then select "Sharing". Within the Sharing preference panel you'll see a number of options, only one of which is of immediate value. See that Web Sharing label? Simply click the Start button beneath it to fire-up the built-in Apache web server.

Figure 1. Apple has cleverly disguised the Apache Web Server as the "Web Sharing" option in the "Sharing" system preference.
By default, the Apache server has been configured to use your Mac OS X "short" user name. (You can find your short user name in the Users preference panel. Click on "Edit User".) If your short user name is "morbus", for example, you can access your personal web site by opening any web browser on the local network and typing http://127.0.0.1/~morbus/. Don't forget that last forward slash!
That 127.0.0.1 (also known as "localhost") is pretty special -- every computer has one. Both names represent the computer itself; by going to 127.0.0.1 in a web browser, you are accessing the local Apache web server you activated in the Sharing preference panel.
Now that you know an easy way to serve a site to local users, how do make your web pages available to folks on the World Wide Web?
The answer is found in your Sharing preference panel. Go there and note the IP address listed. Using that IP address is how outsiders can access your Apache server. If you see 209.204.146.22, visitors could access http://209.204.146.22/~morbus/ and visit your personal web site. In a future article, I'll discuss how to block outside access to only those you deem worthy.
Your personal web space
If you went to your personal web site now, you'd see a generic introduction written by Apple describing Apache and how to use "Personal Web Sharing." We'll soon be deleting this page, but be sure to give it a read because it contains some helpful bits of information.
Much in the same way your personal web site is based on your user name, so is the location of your web space in the Mac OS X file system. Continuing our assumption of the "morbus" user name, our current web space lives at /Users/morbus/Sites/.
If you browse there now, you'll see the introductory file (index.html) as well as an images/ subdirectory. Delete (or back up) everything, and use a text editor (such as BBEdit) to create a new index.html file with the following contents:
<html>
<body>
<h1>Gleefully Served by Mac OS X</h1>
</body>
</html>
Upon saving, reload http://127.0.0.1/~morbus/, and you'll see your rather bland, boring homepage. This certainly isn't very impressive -- downright pathetic, actually. You can't use server-side includes, can't install CGI programs to your /Sites directory, and can't use PHP or mod_perl. Plus, your inTRAnet is wide open to the InTERnet. Not so good, bub.
Turning on the magic
|
Related Reading
|
What we've done so far won't impress anyone. We have no features and an ugly web site address filled with tildes and unprofessional user names. We've got a long way to go before we can feel good about showing off our masterful Mac OS X box.
Our first step is to give the site a prettier URL. Above, we placed our index.html file into our own user directory (such as /Users/morbus/Sites/) -- now, we'll place a copy into Apache's DocumentRoot. The DocumentRoot is the default server (not user) location that Apache will serve documents from. For Mac OS X, this is located in the /Library/Webserver/Documents/ directory.
This directory also has a default introductory file -- to see it, visit http://127.0.0.1/ within your preferred web browser.
Localization or "content negotiation"
If you browse to /Library/Webserver/Documents/, you'll inadvertently run across another nice feature of Apache: content negotiation. Depending on your visitor, Apache can serve up international versions of your site -- for example, index.html.en for English speakers, or French (index.html.fr)
and German (index.html.de) versions. Apache for OS X comes with over 25 translated versions of the default index.html file.
You can take advantage of this feature on your own pages. When you're creating the GatesMcFarlaneCo intranet in your native language, you can translate your pages into other languages and add the two-letter language encoding ("de" for German", "fr" for French, "es" for Spanish, etc.) to the file name. Any time international employees of GatesMcFarlaneCo access your intranet, they'll automatically be served the page that's in their native tongue.
For now, backup or delete all the
files you see in /Library/Webserver/Documents/ and copy over the index.html file we created a few steps ago. If you return to http://127.0.0.1/, you'll see our "Gleefully Served"
page.
What's next?
This is a good point to catch your breath and play with what I've outlined here. You might want to build some nicer HTML pages to serve as your test site.
In the next installment of this series, I'll tackle CGI access for your Apache server. Until then, enjoy playing with your new Mac OS X web server.
[1] A rather stupid joke within a joke. McFarlane Toys is often considered the "one to beat" in action figures, and thus the loose association with Bill Gates. The combination of the two names resembles "Gates McFadden" who played Beverly Crusher on Star Trek: The Next Generation. Wil Wheaton, who played her TV son, Wesley Crusher, recently announced that he may be reprising his role with a cameo appearance in the final Star Trek: TNG movie. Wesley Crusher is often regarded as the most-despised Star Trek: TNG character, and that's where we make full circle back to Bill Gates. Glad you wondered?
Kevin Hemenway is the coauthor of Mac OS X Hacks, author of Spidering Hacks, and the alter ego of the pervasively strange Morbus Iff, creator of disobey.com, which bills itself as "content for the discontented."
Return to the Mac DevCenter.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 250 of 327.
Next Page ![]()
-
Solution to 403 Forbidden. You don't have permission to access
2007-12-15 00:21:11 louisej [Reply | View]
-
Thats Right, I need help. How do I change the [Name.home] page instead of the name.home/~name
2007-12-10 14:40:07 Will-(Probably-Needs-Help!) [Reply | View]
I'm running Mac OS X 10.4.11, MacBook. Intel Core 2 Duo, Useless information probably though I feel it neccessary to say. I cannot change the name.home page (Or the 127.0.0.1 page. I DO NOT need to know how to change the 127.0.0.1/~morbus/ page. Anyway, Just wonderin'
Thanks, Will
-
No access on Safari
2007-12-01 09:46:38 Garnet [Reply | View]
I ran my address on "Safari", and got "FORBIDDEN
You don't have permission to access /~LODESTONE/ on this server."
Then it gives the "Apache" server details and port number below a line.
What does this mean?
Can I not run "Apache" without changing my browser.
Does the fact that I used FTP to attempt to upload a website to a server have anything to do with this?
-
Ip Probloms
2007-11-22 08:33:35 forthfriend [Reply | View]
I've heard that you have to set up your router to work with the outside ip function, but does an airport or a cable modem count as a router?
SOMEONE PLEASE HELP!!! -
Ip Probloms
2007-11-24 16:12:06 dalesignup [Reply | View]
It depends..... If your MAC is getting an address in the range of 10.x.x.x, 192.168.x.x then some device between you and the Internet is doing Network Address Translation (NAT). The device could be an Airport or Cable Router.
The concept of NAT can be confusing but essentially the router WAN interface gets the Internet address from your ISP and gives your MAC a different address. A feature called Port overloading (PAT) enables the router to share 1 Internet address with multiple computers behind the router.
<Mac><---><Router><---><Internet address>
To allow incoming connections (Web) to your MAC you must tell the Router(NAT) which IP address to send the WWW requests to. (As you may have multiple computers) The Internet only sees the real ISP address of your network, not the other addresses behind the router.
-
Ip Probloms
2007-11-17 14:17:41 forthfriend [Reply | View]
In Personal Web Sharing, when I look at my ip, it isn't my ip, but rather 10.0.1.2. How do I change this? -
Ip Probloms
2007-12-27 16:48:48 feball [Reply | View]
This IP address is given by your router (more likely an apple airport station). This IP address is internal, which means that the only computers that will be able to access your pages will be the computers in your home network.
There are two things that you can do about this; the first one is to connect directly from your ISP provided modem to your mac computer, you will notice that if you do this and get access to the internet, your IP address will no longer start with a 10.x.x.x. Although this is the easier route, I would not recommend it first because you will only be able to connect one PC to your home network (since you just got rid of the router!), and second, because your computer will end up with a less secured connection.
The second option, and in my opinion the best route to go about your problem, is to keep the connections just as you have them right now,(Computer<->Router<->ISP Modem) and create what is called "PORT FORWARDING".
PORT FORWARDING is something that you can get setup on your router, but to do this, you will need to do three things:
- Find out how to access your router configuration pages (maybe through a configuration utility?)
- Once you are into your router configuration, find your external IP address, it should be listed there somewhere
- Find out how to setup port forwarding on your router
Since I assume you don't know how to do these three things, and I don't know exactly what type of router you are using, my best advice to you is to contact your router manufacturer (i.e. apple) and ask them how to do these. For them these should be pretty straight forward questions, and they should be able to answer them right away.
Now a little more technical information about what you are doing. Your router acts as sort of a wall between the computers in your home and the rest of the internet. It protects your home network by preventing a lot of traffic known to be harmful by blocking or monitoring PORTS. For now think of PORTS as several pipes that are used to send and receive information. These ports are numbered, and some of them have specific functions. Most of the PORTS in your connections are closed by your router, but some that are well known are open, so you get access to communication services. For example, port#80 is the standard port for accessing the world wide web, if you close this port you will loose access to most of the internet. port#25 is used to send e-mail, etc.
When you allow port forwarding, you are allowing traffic through a specific PORT, so the idea is that in your router you will specify a number of a port and "open the pipe" for incoming and outgoing traffic. To be on the safe side, I would say that a good range for this port would be between 10000 and 11000. Just trust me on that one, there are a lot of other optional port numbers that you could do, but I think this range is pretty safe.
Once you have setup port forwarding on your router (make sure you allow TCP and UCP if you have that option) take note of your external IP address and also take note of the number of the selected port.
If you want to access your pages on computers that are outside your home network instead of putting 10.0.1.2 on the url, you would put something like:
external ip address: port number -> 74.23.122.14:10453
just remember, there might be other things that you need to put in there, like slashes, and your short username, but the IP address should be replaced exactly as I mentioned. Two more things: your external IP address could change at any moment, so this might not work for too long, but at least you will be able to try these tutorials and get the pages to work outside your network. Second, your IP address under system preferences will not change once you do port forwarding, however, this should not matter.
Good luck! hope my explanation helps -
Ip Probloms
2007-12-27 16:47:23 feball [Reply | View]
This IP address is given by your router (more likely an apple airport station). This IP address is internal, which means that the only computers that will be able to access your pages will be the computers in your home network.
There are two things that you can do about this; the first one is to connect directly from your ISP provided modem to your mac computer, you will notice that if you do this and get access to the internet, your IP address will no longer start with a 10.x.x.x. Although this is the easier route, I would not recommend it first because you will only be able to connect one PC to your home network (since you just got rid of the router!), and second, because your computer will end up with a less secured connection.
The second option, and in my opinion the best route to go about your problem, is to keep the connections just as you have them right now,(Computer<->Router<->ISP Modem) and create what is called "PORT FORWARDING".
PORT FORWARDING is something that you can get setup on your router, but to do this, you will need to do three things:
- Find out how to access your router configuration pages (maybe through a configuration utility?)
- Once you are into your router configuration, find your external IP address, it should be listed there somewhere
- Find out how to setup port forwarding on your router
Since I assume you don't know how to do these three things, and I don't know exactly what type of router you are using, my best advice to you is to contact your router manufacturer (i.e. apple) and ask them how to do these. For them these should be pretty straight forward questions, and they should be able to answer them right away.
Now a little more technical information about what you are doing. Your router acts as sort of a wall between the computers in your home and the rest of the internet. It protects your home network by preventing a lot of traffic known to be harmful by blocking or monitoring PORTS. For now think of PORTS as several pipes that are used to send and receive information. These ports are numbered, and some of them have specific functions. Most of the PORTS in your connections are closed by your router, but some that are well known are open, so you get access to communication services. For example, port#80 is the standard port for accessing the world wide web, if you close this port you will loose access to most of the internet. port#25 is used to send e-mail, etc.
When you allow port forwarding, you are allowing traffic through a specific PORT, so the idea is that in your router you will specify a number of a port and "open the pipe" for incoming and outgoing traffic. To be on the safe side, I would say that a good range for this port would be between 10000 and 11000. Just trust me on that one, there are a lot of other optional port numbers that you could do, but I think this range is pretty safe.
Once you have setup port forwarding on your router (make sure you allow TCP and UCP if you have that option) take note of your external IP address and also take note of the number of the selected port.
If you want to access your pages on computers that are outside your home network instead of putting 10.0.1.2 on the url, you would put something like:
external ip address: port number -> 74.23.122.14:10453
just remember, there might be other things that you need to put in there, like slashes, and your short username, but the IP address should be replaced exactly as I mentioned. One more thing: your external IP address could change at any moment, so this might not work for too long, but at least you will be able to try these tutorials and get the pages to work outside your network.
-
Problem with Apache
2007-11-08 18:50:37 confounded [Reply | View]
Hi,
I was trying to learn about servers, I don't know anything about php or servers, except for HTML.
I'm having a problem with apache (I never knew Macs came with a server). I'm nervous that I may have screwed up something with the Apache.
I turned on "Personal Web Sharing" and have OS X v10.4.10, did the exercise "Gleefully Served by Mac OS X". I see the page in Safari browser if I type in /Library/Webserver/Documents/ but not if I type in http://127.0.0.1/
If I do that, I keep getting a message "cannot connect to local host"
The internet is shared by 2 computers, one a pc and this mac.
Is there a way to resolve this?
Thanks for any advice
Confounded
-
new to macs
2007-08-22 14:57:09 hadandowa [Reply | View]
Hi,
Not only am i new to macs but i know no programming at all. I can get http://myip/~myusername/ to work with apple/apache message and then my own page - yay! But http://myip/ only comes up with a different apache (no apple ref) message that I can't change, even by going into library/...../webserver and changing all the files in documents to my index.html file - help!
I also can't access anything from 'outside'. And don't know how to change "router" details but have noticed that eg my ip is 192.168.1.64 but router is 192.168.1.254 so how do I make one talk to the other.
Please help in BASIC terms an enthusiastic but clueless user - assume no knowledge except love of macs. (reference to truly step-by-step instructions expecting no knowledge would be gratefully received) :-)
-
new to macs
2007-10-04 02:45:53 Ed_Online [Reply | View]
Also... To get to your computer from outside the firewall there are a few steps.
1. Personal Web Sharing only works on Port 80, 427 & 443
This must be enabled..
2. Your router must be configured to allow access to your computer.
This means you must look at the instructions for the router and set it up accordingly. Look at your IP address assigned to the computer from your router. This is the IP you will have to set the router to allow outside access thru port 80.
If I knew the type router you had I could explain the steps. -
new to macs
2007-10-04 02:35:05 Ed_Online [Reply | View]
The problem is that just using the IP address and not the /~username/ at the end makes the server read the /test/ directory.
So look in the MacHD/Users/test/sites directory and place the modified html page there. Then you will see it when you only use the IP address...
-
Servlet support
2007-07-05 23:21:03 rajuk_2004 [Reply | View]
Hi,
I am new to Mac OS. I am able to browse http://127.0.0.1/~morbus/ and start & stop using "sudo apachectl start".
But how to run a servlet on this apache server?
Is it possible to deploye java web application(war file) directly?
Thanks in advance.
rajk
-
Log modul for web server.
2007-06-26 11:28:42 The-final-cut [Reply | View]
Hello from Sarajevo.
I have already set web server on my dual g500 ,it works just fine behind the NAT ,and thanks to the fact that router support dyndns its available from the internet.
I also have set FTP server on the same computer and its just great!
The think that i would like to do next is to have little better log for monitoring access of the web server.
Default log is situated in console where all of the other mac logs are.
Also is there any differences form apache documentation for linux and mac os x ,so is it possible to use this documentation for OS x .
And at last default apache at mac os x is 1.3
P.S. sorry for bad english
Do we need to upgrade to 2.2
-
Apache web serving & stealth mode
2007-06-08 02:39:40 niteOwl [Reply | View]
Thanks for the great article - it's really helped me configure Apache & PHP on my Mac.
My problem is this - I recently enabled stealth mode in system preferences > sharing > firewall (Mac OS X Tiger). This is great for keeping me 'under the radar' while on the Net, but the downside is since I use PHP functions in my web development that fetch the server name, these are no longer working when I test pages pages served from the Sites folder (i.e. stealth mode on - no response).
Is there a way I can configure the firewall to allow incoming requests to my IP address only, but not respond to anything else? At the moment it's a hassle turning stealth mode on & off when developing.
I'm guessing I might need to go into the terminal, but I have no idea of the commands.
-
a thing i don't understand..
2007-05-26 23:20:43 D.C. [Reply | View]
.. I'm running a Mac Mini behind a router, and when I switch on Apache, I see the address 192.168.0.10 in my System Preferences. At the risk of stating the obvious, this is only going to work within my LAN.
I'd like to have everything in ~/Sites as I create my webpages using iWeb, and I just want to be able to 'publish' to that directory, and not have to faff around with anything else.
Afterwards, I'm going to change DNS on my domain name, and hope that when people 'on the web' type my domain name, they'll automatically be served what's in ~/Sites.
I've tried changing /etc/httpd/httpd.conf to point to that directory, but I get an error 503. When I ask the question on Usenet, I get insulted and accused of having 'broken' apache.
Can anyone help ? Thanks...
D.C. -
a thing i don't understand..
2007-06-06 01:56:38 AminNegmAwad [Reply | View]
You stated the obvious. ;-)
The IP# in your SysPrefs is the local IP# of your computer in the LAN. (Thounds of computers have excatly this IP# on their local network.) When you log into internet, your provider transmits a single WAN-IP# for your net, i.g. t"the router". Let's say 80.241.36.121.
When somebody tries to access your web-sites, this request is sent to the router with the WAN IP# 80.241.36.121. But there is no Apache running on your router, so he will get no response. You have to configure your router that way, that an access on the http-port (80) will be routed to the local computer with the local IP# 192.168.0.10. For this purpose the router has soe settings, usually labeled "routing", "virtual servers", "NAT" or something like this – depends on the router.
-
trouble
2007-03-28 04:29:02 madhurima [Reply | View]
i did the neccessary changes in httpd.conf file as given in http://www.cgi101.com/book/intro.html and wrote my first cgi program placing it in Sites folder. But when i tried to view my page in safari an error of permission denied is being given. Want some help please... -
trouble
2007-03-28 19:13:52 rubah [Reply | View]
I just had this happen to; you need to chmod your files (as they say on *Nix). In os x, just go find the file in Finder, view it, at the bottom where it says permissions set group and other to "Read Only" instead of "none" (you can set it to Read and Write later if you need to do some PHP or CGI magic)
-
Please HELP with Apache
2007-03-16 14:53:53 wencryo [Reply | View]
I need help with Apache. I think I have modified some files, and now nothing is working.
if I do
sudo /usr/local/apache2/bin/apachectl start
it says:
httpd (pid 270) already running
but I can get Web Sharing to start up
can someody help me? PLEASEEEEEEE
-
Web Sharing Starting Up...
2007-02-18 05:51:09 shuffm [Reply | View]
Great article. I want to start doing this. I have a brand new MacBook Pro. I haven't really installed anything on it yet.
I followed the directions, and web sharing just says it's starting but never starts.
I went to the terminal and typed: sudo apachectl start
I get this:
Processing config directory: /private/etc/httpd/users/*.conf
Processing config file: /private/etc/httpd/users/+entropy-php.conf
Syntax error on line 8 of /private/etc/httpd/users/+entropy-php.conf:
Cannot load /usr/local/php5/libphp5.so into server: (reason unknown)
/usr/sbin/apachectl start: httpd could not be started
I'm a Windows and ASP guy. I have no clue how to get the server running. Sounds easy, but something is apparently not working. A couple other people have the same problem on this post, but I see no solutions. Please help...anybody. Thanks. -
Web Sharing Starting Up...
2007-10-20 00:21:25 darren14 [Reply | View]
Are you using Apache 1.3 which is the default Web server of Mac?
If yes, just go to Systems Preferences click sharing then check Personal Web Sharing
And if you have another Apache version installed, uncheck the Personal Web Sharing. Then, open your terminal. I am sure that you have a directory local that resides on /usr/ ... it goes this way /usr/local/apache2/bin/./apachectl -k start
this should solve your problem... -
Web Sharing Starting Up...
2007-09-04 06:04:38 august29of73 [Reply | View]
I had the same problem, but it was becasue I was trying to install with bundles. If you remove everything you tried to install previously and compile Apache, PHP, and MySql from the command line, you will be able to handle this with success.
I started with MySQL, then installed Apache2, and PHP last.
It is a little tedious if you have no real IT experience and have only done WinBlows, but it is definitly worth it. Besides, you may learn something -- and there are many tutorials on how to do this available for your google pleasure. -
Web Sharing Starting Up...
2007-03-16 14:44:03 wencryo [Reply | View]
I need help with Apache. I think I have modified some files, and now nothing is working.
if I do
sudo /usr/local/apache2/bin/apachectl start
it says:
httpd (pid 270) already running
but I can get Web Sharing to start up
can someody help me? PLEASEEEEEEE -
Web Sharing Starting Up...
2007-03-16 17:01:09 pnolans [Reply | View]
If you have Apache2 in /usr/local you (or someone else) installed Apache2 there.
There is an Apache 1.3.??? server that comes with
os x , and is turned on by "Personal Web Sharing" or
something like that in System Preference > Sharing.
So, you can't run both of them, unless you override
the listen port on one of them (the default is 80)
Also, it might have simply been already running!
Did you look for it? It would be several process named httpd in the activity monitor in Applications > Utilities
Next time, try restart instead of start. Then if
it complains, it's probably the first problem.
-
Solved my own problem.
2007-02-18 07:09:47 shuffm [Reply | View]
Well, in case anyone else has this problem in the future. Here is what I did. I went to Mark Liyanage's site on installing PHP on a Mac OS X 10.4. I followed the directions to download and install the PHP 5.2.1 Package for Apache Server 1.3. It installed PHP, MySQL, and a ton of other stuff. Best of all, when it was done, I went to Sharing folder and the server was already up and running.
-
Problem Connecting to Mysql Please help
2007-01-30 20:27:36 Lucci [Reply | View]
I have successfully set up my development site and am trying to connect to mysql. I installed the DBI module. Here is what I am turning up in the error log
###########
#Error
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
Expected in: dynamic lookup
dyld: Symbol not found: _mysql_init
Referenced from: /Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
Expected in: dynamic lookup
[Tue Jan 30 18:28:28 2007] [error] [client 72.134.38.10] Premature end of script headers: /Users/calypso_44256/Sites/first.cgi
#end Error
###########
Script I am using to connect
#!/usr/bin/perl
use CGI;
use Date::Manip;
use DBI;
#
print "Content-type: text/html\n\n";
my $server="localhost"; #also tried the valid IP address
my $user="root";
my $pass="******";
my $name="*****";
############
#
my $source = "DBI:mysql:$name:$server";
my $dbh=DBI->connect($source,$user,$pass) or die "Can't Connect to $config{'dataSource'}
$DBI::errstr";
-
apache on macs
2007-01-25 11:10:38 colombimac [Reply | View]
that was good but I need more info about running .pl or .cgi programms.
-
HTML rendered in Chineese font??
2007-01-06 18:03:29 StephenWilkerson [Reply | View]
I started apache and created a very simple html page. When I open this page in any browser it is rendered in a Chinesse font? Has anyone experienced this problem?
-
PHP module
2006-12-22 02:12:41 ianwj [Reply | View]
I deleted most of the files in /Library/Webserver/Documents/ as mentioned in the article. However the PHP module will not work and Apache post the following error:
[Fri Dec 22 17:50:26 2006] [error] [client 192.168.0.2] File does not exist: /Library/WebServer/Documents/favicon.ico
Seems it want to see the favicon.ico file. What is this and how do I get it back?
-
Web server can connect locally but cannot remotely
2006-12-01 10:31:19 sjm65536 [Reply | View]
I have Personal Web Sharing turned On, the Firewall is turned off, and computers (Tiger and WinXP) on my private network can connect to my webpage (and my users' private webpages) via my domain name. But remote visitors cannot connect to my webpage (from their computers on other networks) via my domain name (nor my IP address).
What could be preventing remote webpage connections?
Thank you in advance.
--sjm65536 -
Web server can connect locally but cannot remotely
2007-05-30 22:05:15 Zugmeister [Reply | View]
Something this article doesn't mention (I think because it would muddy the water a bit and take the wind out of the writers sails) is that a residential connection will commonly BLOCK outgoing traffic on port 80, or web service going out. If you really want to host your own site from home, look into getting a SOHO account or just call your ISP and ask them why your web service isn't getting out. Something else you may need to do is set up your router so that any requests made on port 80 (web) get routed to the computer on your network that's serving the pages. This is often called "port forwarding" and can be used to get around the port 80 block.
-
httpd could not be started
2006-11-17 15:05:36 simple_ton [Reply | View]
Hello, my trouble is that in my OS X preferences under Sharing, Personal Web Sharing does not respond properly when I select Stop or Start.
Within Terminal, I tryied to start Apache using: sudo apachectl start
and this is the message that follows:
Processing config directory: /private/etc/httpd/users/*.conf
Processing config file: /private/etc/httpd/users/+entropy-php.conf
[Fri Nov 17 15:55:23 2006] [warn] module mod_php5.c is already added, skipping
Processing config file: /private/etc/httpd/users/username.conf
/usr/sbin/apachectl: line 193: 551 Bus error $HTTPD
/usr/sbin/apachectl start: httpd could not be started
MyComp:~ username$
I activated the php mods in httpd but altered nothing else. It worked up until one day at which time it gave me the previous message upon trying to start Apache.
What is wrong and what should I do to correct it?
Thanks for the help!
-
httpd could not be started
2008-03-10 17:13:30 crippendorf [Reply | View]
thanks alfredo,
i had the exact same problem, i had php5 installed but as i had some new wordpress installations the httpd.conf file was altered. commenting out the refernces to PHP4 worked and apache is running again. -
httpd could not be started SOLUTION
2007-07-26 06:30:45 AlfredoSanchez [Reply | View]
I know the above is an old post, but I had this problem today and found this post in Google.
So for others with the same issue:
I had the same problem. I installed Entropy, then afterwards the Personal Web Sharing service (aka Apache server) refused to start because of a "Bus Error".
It's because Entropy tried installing PHP 5 when I had already tried installing PHP 4 myself. The solution for me was:
Open the /private/etc/httpd/httpd.conf file and remove all lines with references to PHP4.
Reinstall Entropy.
Restart apache (at the terminal: "sudo httpd restart")
The bus error then disappears and Personal Web Sharing starts with no problems.
-
formated hdd
2006-11-09 15:47:17 thomascattral [Reply | View]
I formatted the hdd on my mac, and now apache isnt installed and i cannot run the personal web sharing, a function in which i trully loved. How can I fix this problem?
-
apche on darwin (mac os x)
2006-08-13 04:33:23 Saroo [Reply | View]
Hello all,
I am trying to execute .pm file on in-built apache webserver of mac os x 10.4 and instead of executing my script it is executing only .html file and printing as it is as a text the entire perl script. The script I a trying to execute is rocks.pm . If the same script I execute as rocks.pl it dint display anything just a blank page. Somebody please help.
Thanxs!!!
-
apache
2006-07-09 19:55:25 elfarose [Reply | View]
Do I have to be a geek to learn this? do I have to know Unix, script, or html?
-
Apache doesn't work
2006-06-21 09:05:07 balijewel [Reply | View]
Hello, I'm using iMac intel chip with mac osx 10.4.6. I have the problem on Apache webserver:
1. On my system preferences/sharing, personal sharing check box is off. So i can not make it on.
2. localhost doesn't work, apache need to be resatart. I try to go to terminal and type sudo apachectl start ( sudo: apachectl: command not found ) and sudo apachectl graceful ( sudo: apachectl: command not found ). Please help me. Thanks,
Deni -
Apache doesn't work - SOLUTION
2007-02-03 09:26:55 steveninthesun [Reply | View]
The solution for me was to re-edit the 'httpd.conf' file. The problem started after I installed php software and was told to remove the '#' from the lines '#LoadModule php4_module libexec/httpd/libphp4.so' and '#AddModule mod_perl.c'. By putting them back, my Personal Web Sharing now starts.
-
Apache doesn't work
2006-07-09 18:36:35 snegin [Reply | View]
I'm having the same problem, also using a macbook and os 10.4.6. It occured after one of two things - probably the second...
1. I installe x-code. I don't think this is the problem, but I hadn't checked apache since I did this.
2. I tried to build php4.3 (i am new to working with unix in this way, and have never built/compiled - only used binaries.) It wasn't working out, so I tried to undo what I did by removing the files I had installed. This also involved installing and using fink, and installing some libraries, which I probably should have read more about before I did. I was trying to follow instructions, but I must have done something wrong.
I have already replaced the httpd.conf with the httpd.bak. This did not help.
The message I am getting in the console is:
Processing config directory: /private/etc/httpd/users/*.conf
Processing config file: /private/etc/httpd/users/+entropy-php.conf
fopen: No such file or directory
httpd: could not open
but that is not true because that path and those files do exist.
Any advice or suggestions would be appreciated. Thanks.
--Shana -
Apache doesn't work
2006-08-03 05:37:51 Alfasthlm [Reply | View]
I started yesterday, installing php and mysql from a cd I got with a book. The php-installation did not succeed, I don't know why...
Trying to start Apache, this message shows:
Processing config directory: /private/etc/httpd/users/*.conf
Processing config file: /private/etc/httpd/users/+entropy-php.conf
Syntax error on line 8 of /private/etc/httpd/users/+entropy-php.conf:
Cannot load /usr/local/php5/libphp5.so into server: (reason unknown)
/usr/sbin/apachectl start: httpd could not be started
c-8fb5e055:~ alfasthlm$
Does anyone understand what this means? And WHERE do I find these "lines" to edit them???
Best, Al
-
i finally did it!!!!!!!! yeah !!!!!!!!!!!!!
2006-04-17 18:14:26 sputnikV [Reply | View]
I fianlly got my web server running!!!
-
javascript and apache for os x
2006-04-17 17:22:46 newtothis [Reply | View]
I have Apache installed and running but the javascript isn't working when I preview pages from Dreamweaver, using the localhost as a testing server. Did any of this make sense? I thought javascript is a clientside script, so why won't my browser process it when it's the local browser? I tried changing the server model to ASP javascript but that didn't work. You may finally have come across the person who know the least and has posted to this page! Thanks in advance for any insight.
-
Simple, and elegant
2006-03-28 11:05:54 pbshoe [Reply | View]
I like the writing. makes this semi-complex issue, very simple. thanks.
-
FTP
2006-03-18 00:08:22 BHEIBERT [Reply | View]
Is it possible to customize what appears in the ftp server when the user logs on?
I am using Web Sharing and MacOS X with No-IP Software
www.no-ip.com
-
CGI-BIN
2006-03-17 23:39:45 BHEIBERT [Reply | View]
Willl there be a part (whatever) on how to create/use cgi-bin access on the server?
-
Thought I'd share how to make the url nicer
2006-03-17 23:35:24 BHEIBERT [Reply | View]
I am using No-IP IP Updating software from no-ip.com
and I have a account with them that I registed my domain name with and it along with the MacOS X Web Sharing puts my web page on a nice url for example my url is heibertweb.com and it is being served off of my Macintosh computer
-
Cannot log onto my webpage using MAC OX 10.4.5
2006-03-05 19:15:27 Netripized [Reply | View]
I'm having the problem, Using the Belkin router (F5D7230-4).
From outside of the home I can't get to the website running on my machine. When I type out my server's (Personal Web Sharing - Apache) IP address (192.168.2.3) I always get the main router page.
I've set up Belkin Router's virtual server to point out port 80 TCP to this ip address shown above.
From outside of home, I cannot get onto my website using my home's IP address (69.xxx.xxx.xxx).
Any ideas? -
Cannot log onto my webpage using MAC OX 10.4.5
2007-06-26 15:10:54 The-final-cut [Reply | View]
You must to connect from other network otherways you will always get router login page.
Try with dial up or call someone to visit the page.
I have same problem (actualy its not problem its limitation) -
Cannot log onto my webpage using MAC OX 10.4.5
2006-08-14 22:56:31 tobiko2004 [Reply | View]
Hey Netripized, I just figured this out after a bit of fooling. Go into your router's admin area to the section of port forwarding. Check of port 80 to 80 (along with 20 to 21 for ftp) and where it asks to imput a number after 192.168.2. imput that of the computer you are using as the server. to find this number go to system prefs in the network and tcp/ip area you will find the number for your computer's network ip. its the last one after the .
-
airport
2006-02-03 02:47:25 copperX [Reply | View]
issues while using an airport to access the internet and use OS x as a webserver ??
-
NOT FOUND
2005-11-30 03:40:50 NewMacUser [Reply | View]
I was turning on the Web sharing.
But when I open the browser and writes http://127.0.0.1/~myshirtusername/
or http://localhost/~myshortusername/ or
just http://127.0.0.1/ .... I just get the message: Not Found. The requested URL... was not found at this server. Apache/1.3.33 Server at cak.local port 80
What is wrong?
I tryed to find the httpd.conf file, to take a look at the root adress, but I didn't find it.
-
server running?
2005-11-30 05:31:20 muenchow [Reply | View]
It appears that your server is not running. From a terminal, try the command
sudo apachectl start
which may give you some diagnostics on conflicts or permissions. On my G4 PowerBook running OS X 10.4.3 the httpd.conf file is in /etc/httpd
Good luck, Andreas -
Seems to me it's running ok.
2005-11-30 11:09:42 NewMacUser [Reply | View]
Thank's Andreas, but it doesn't seem to be the probleme.?!
The terminal gave me this answear:
/usr/sbin/apachectl start: httpd (pid 123) alredy running ...
I can find the file httpd.html.html, but I just can't find the httpd.conf file. I've searcht the whole machine.
I'll serach one more time...:-/ -
Seems to me it's running ok.
2005-12-03 22:02:32 muenchow [Reply | View]
Good, your server is running. Next, check the advanced options in your firewall settings (system preferences -> Sharing-> Firewall->Advanced, and make sure that the stealth mode is turned off. Don't ask me why, I am new to this, too.
andreas
P.S.: You may need to search from a terminal to find your httpd.conf file, try the command
cd /etc/httpd
and then
ls -la
and see what you get.
-
Need Help Setting Up
2005-10-17 13:24:40 sputnikV [Reply | View]
I have an Apple G4 Cube with OSX 10.3 on it.
I want to be able to host a website off of it that I can use for data that me and my friends can access, so I don't need a DNS domain name or any of that stuff.
I am currently behind DSL modem/router with no firewall except on the mac. I have several other things and another router pluged in to the router ports. I have two computers on the second router including the mac.
I followed the instructions above (press the web sharing button), and I can access my site internaly but not externaly.
How can I access them externaly? (like at someone else's house?) -
Need Help Setting Up
2006-04-17 18:13:08 sputnikV [Reply | View]
I finally did it!!!!!!!!!!!!!!!!!!!!!!!!!!! yeah!!!!!!!!!! -
Need Help Setting Up
2005-12-25 12:28:55 timlkane [Reply | View]
Get your DSL modem/router documentation. You have to http into the router and set it up to send a incoming request to your computer's IP address.
example your router address is 10.0.56.1
your computer's address is set up in the router is
10.0.56.11, you must tell the router to send all incoming requests to 10.0.56.11
Timlkane
-
Modifying the config file of Apache
2005-10-01 01:27:35 macguru65 [Reply | View]
Hello,
Anybody can help me on this.. How can I modify the config file for the Apache web server on OS X system to use another folder as the htdocs root of the web server?
Thank You
-
Personal WeB Sharing
2005-09-19 17:53:48 UncleJohn [Reply | View]
I'm running OS X 10.4. Can't turn on Personal Web Sharing. Click box--get "Starting... " but it never happens. Any ideas? -
Personal WeB Sharing
2006-09-01 04:46:57 pixeljuggler [Reply | View]
I am getting the same problem, it was fine before I installed the latest php5, any progress? -
Personal WeB Sharing
2005-09-30 03:47:02 fred0815 [Reply | View]
got the same problem after upgrading to OS X 10.4. My .config file changed during the update. I changed it back to my orig. .conf but that didi'd work either!
I'm thinking it has something to do with apple changing their app name "Randevouz" to "Bonjuor".
If u have a solution PLEASE HELP!
fred
__
-
bbedit tool error -10814
2005-08-31 16:18:08 monica1 [Reply | View]
If I type 'bbedit /etc/httpd/httpd.conf' into terminal I get an error message 'Sorry, the bbedit tool has experienced an error: -10814 LaunchServices could not locate your copy of BBEdit.'
I use system 10.4.2 and BBedit 7.1.4.
Any idea how to fix this?
Thanks!
-
I'm not sure ....
2005-07-07 04:41:25 PHP_lovers [Reply | View]
Ok -- I'm not sure if anyone is still reading this or not, but it's worth a shot.
I'm having some really strange things happening. I'm trying to get a simple server up and running using Jaguar. I've followed all of the instructions and understand most of it.
Problem #1
I have configured my router to pass requests to port 80 to a specified IP address. In my case, I'm using **.**.**.25 -- where the first three fields are the first three digits in the routers IP address (Using a simple Belkin router, I'm unable to change these anyway).
My problem occurs when I try to configure the server IP. When I set it to get an IP via DHCP, I have an internet connection; however, when I choose Configure IP Manual" in the Network Control Panel and enter all of the information, I lose internet connection. For the manual configuration, I type in the correct IP, Subnet Mask, and Router IP.
Interestingly, when I swith back to get IP via DHCP, the router sets the same address that I have in Manual and I then have an internet connection. Of course I don't want to have a dynamic IP on my server (ie, if my router has to be reset, etc... it may assign my server another IP).
Does anyone have an idea? Ive also tried using DHCP with a Manual Address with the same results....my computer doesn't see the router.
Problem #2
Just to test it out, I left my computer set to using "DHCP" to obtain the IP address. I then simply configured my router to pass web requests to the IP it assigned to that computer. However, when I tested it from another computer (ie, entered my permanent IP in a browser), I did not see my webpage. Instead, I got the front-page utility of my router! This freaked me out and I disabled websharing and the virtual server of my router. Again, any help will be very appreciated.
WAny help will be appreciated!
thx,
Mike -
I'm not sure ....
2005-07-27 01:17:56 randallz [Reply | View]
Hey Mike,
There are a few IP addresses to consider.
In your home there is an IP address for each computer attached to your Belkin router, as well as one for the configuration page of the router itself.
Let's say your computer is 192.168.2.25, another computer at home is 192.168.2.26, and you get the configuration page by going to 192.168.2.1.
Your cable modem, or whatever you use to connect to the internet, has another IP address according to the outside world. Everything on your home network has this same IP as far as the outside world, and it is up to your router to sort or properly ROUTE all traffic from outside.
So, your computer thinks it's address is 192.168.2.25, the same address that you get in the System Prefs web sharing panel. However, http://www.whatismyip.com/
will report back to your real address according to the outside world. (Note, that this is not the same as the IP address for configuring your router)
For the sake of illustrating this, you can go to another computer on your home network and confirm that you get the same answer from Whatismyip.com.
So how does everything keep from getting confused? The router is essentially a small computer. When you type in an address, a request for data to be sent to your x.x.x.25 IP address is sent out. The router rewrites this to the real/outside IP address, then when the request is filled and the data begins to roll in it routes it to the same computer it knows asked for the data.
It is different when you are the website. Setting up the router to send all port:80 requests to the computer at x.x.x.25 makes all requests sent to your real/outside IP address will be forwarded to your computer.
I hope that makes sense, and that I didn't misunderstand your question.
If you'd rather not require people to memorize a changing IP address, you can also find free services that will forward a more conventional text-url to your computer.
eg. http://www.dyndns.com/services/dns/dyndns/
-Randall
-
Outgrown hard disk space-How to overcome it
2005-05-27 01:55:52 WSG-Photo [Reply | View]
I would be thankful if anyone can advise me how to configure Apache in Mac OS X to overcome the default hard disk limitation.
I handles huge number of digital photos in the website (a necessity). I had outgrown the default hard disk capacity. I wish to configure Apache web server to look for Index.html or secondary level HTMLs in an external hard disk instead.
Can somebody please help.
Thanks in advance. -
Outgrown hard disk space-How to overcome it
2005-06-22 19:37:44 Jagil [Reply | View]
Use a symbolic link. You can create one in terminal using the 'ln' command:
Do this:
Type 'cd ' (notice that space at the end) and then drag and drop you website root folder from the finder into the terminal window then press return.
Type 'ln -s newImageFolder ' then drag and drop where your new image folder is on the other hard drive. Press return.
That should have created a symbol link called 'newImageFolder' and when you open that in the finder, it should go over to the new image folder if itis working correctly.
-
problems with apapche2
2005-04-22 21:52:17 Gus_Dueńas [Reply | View]
instead of using the default apache web server on my osx jaguar 10.2.8 I've recently intalled a new apache, the 2.0.something and is exactl;y whe my problems have started.
First the site runs very well on my localhost and IP but only in my machine, when I start apache and it starts ok, others computers in the internet can't see any pages in there, I've already installed Open ssl, Bind9, Mysql, Phpmyadmin,PHP 4.3.3 and to be true, I've tried everything, I'm just a designer so that matters of programming are really new for me, would somebody help me?
Right now is ok to run dinamic pages on my localhost but I'd like to show the pages through my cable connection to my clients.
Thanks.
Gustavo Duenas
-
Does it do any good?
2005-04-01 14:12:37 kathryne [Reply | View]
...to post on this forum? I just answered to, " Autostart Apache 2 after reboot?" and my post doesn't show up beneath the poster's question, rather I have to click view to see my post.
So, I know the question I tagged at the end, won't show up either. Here it goes again...
Anyone have any idea where I can find the Apache 2. upgrade/version? Think I saw it somewhere, but I can't remember where. Thanx!
Kathryne
-
I can't get this to work
2005-01-07 17:11:48 Cineander [Reply | View]
I see the webpage on my own computer, but no one on any other comuter can see it.
-
Access to the sites
2005-01-03 08:28:40 mhaysom [Reply | View]
Hi, was wondering if someone can help me, ive got a LAN setup with my Mac and PC, the Pc has the main connections with the Mac running off it, ive set up a server on the Mac and when i test it on the PC i can obviously see it but is it possile for other people not on the network to see it? i guess this might be a dumb question but im not too good with all this network stuff :D. id appreciate any help. many thanks in advance.. -
Access to the sites
2005-04-05 14:41:58 kathryne [Reply | View]
<< guess this might be a dumb question but im not too good with all this network stuff :D. id appreciate any help. many thanks in advance. >>
Hey......no question is a dumb question, especially when you're first setting up and getting started doing your own webserver. I'm having some problems too and basically I feel like I'm out on a desert posing questions which I can never get answers to...not only on this forum, but on other forums as well. I've read on how to setup in the "Mac OS X, the Complete Reference Manual," but it's of little help. Apple needs to put up some websites with step-to-step visual instructions on how to host and get your website to be seen by others. This is very exasperating! Hope you find answers to your questions.
-
Autostart Apache 2 after reboot?
2004-12-29 16:02:59 RickMGoldie [Reply | View]
Anyone know how to get apache 2 to startup automatically after OSX reboots?
-
Is FileVault the problem?
2004-12-08 11:41:08 Drachentöter [Reply | View]
I was confronted with an error message "You have not the Permission to ...." after enableing WebSharing. But access to localhost worked fine. Mhh, this is actually the Documentroot directory which is far away from my user directory. That in mind I turned FileVault off and now it worked!! Has anybody similiar expiriences?
-
hey... what happened to default.html??
2004-11-27 14:22:48 riggs_jt [Reply | View]
I have a virtual host set up on my mac... when I try "http://mysite/" I receive a "Forbidden - You don't have permission to access / on this server" error. However, when I try "http://mysite/default.html" the site loads as expected. Why is Apache trying to access a site index rather than the default.html page? Am I missing something in the httpd.conf?
-
Why can I view PHP pages but not html ones?
2004-11-16 07:47:15 CrazyPsyRoller [Reply | View]
My problem seems rather strange...I have no problem viewing php pages through my browser or LAN using this kind of address
http://127.0.0.1/~Tristian%20Bougeard/insert.php
but when i try to view a html page in the same way I get this error in my browser...
"
Forbidden
You don't have permission to access /~Tristian Bougeard/index.html on this server.
Apache/1.3.29 Server at tristian-bougeards-computer.local Port 80"
im probly being really dumb, anyone got any idea's how to sort this out?
-
Acually I think it might be a permissions problem
2004-11-19 03:43:16 CrazyPsyRoller [Reply | View]
Ah update....I now know the server will accept html....the real problem is something to do with permissions....it opens up index.html or index.php but whenever I click on a link I always get the forbidden error telling me I dont have permission to access the file...
please please someone help, I really dont know what to do.... -
Acually I think it might be a permissions problem
2004-12-08 11:56:20 Drachentöter [Reply | View]
I think you have turned on FileVault right? The process of enableing FileVault cause a change of the permission setting of your home directory - I do not know why this havens? But if you start your terminal then go to your home directory and enter "chmod 755 ~" then it is working again and well.
-
Apache doesn't start anymore
2004-09-16 07:12:09 pixelized [Reply | View]
Since i wasn't able to save changes to the httpd.conf file, i made a stupid thing: after having edited it, i saved it on the desktop and then i changed the file properties (permissions, owner and so on), copying them from those ones belonging to the original file. Then i replaced my new httpd.conf file with the original one, placed in httpd folder. Now, if i try to turn on 'web sharing', from the sys prefs, nothing happens (it says it is starting but it never starts). I see that in the httpd folder there is a httpd.config.bak file, can i enable it to somehow make it work?it is a copy of the httpd.conf original file, isn't it? There's also a httpd.conf.default file, over there... maybe it can be used too? you told to use sudo to edit httpd.conf or bbedit shell, but isn't there any other way to edit (and save!!) it? Thanks in advance, i hope you'll help me.
PS: i'm running Panther 10.3.4 on a 1.25GHz PowerPCG4 -
Apache doesn't start anymore
2005-08-19 21:06:09 dreamingkat [Reply | View]
you can get more information on why apache isn't restarting by using the terminal to restart it. Try "sudo apachectl graceful". (the command is apachectl (apache control), the option is graceful, and sudo means "hey os x, pretend I'm god and can do whatever I want for a few minutes". You'll have to enter your login password and be in the admin group for this to work.)
-
Apache doesn't start anymore
2006-06-21 09:49:48 balijewel [Reply | View]
I use mac osx 10.4.6, intel chip. I have the same problem with you, plus my system preferences/sharing/personal web sharing check box is off. I try this command: sudo apachectl graceful and here is the answer: sudo: apachectl: command not found
Anybody can help me? Thanks, Deni -
Apache doesn't start anymore
2004-10-12 19:53:07 diad [Reply | View]
ya duh, I did the same thing. Any luck getting an answer to this problem? I was trying to add a directory to my config file so GoLive would know where to place the site folder.It doesn't work if you change the permissions again.
Mine never says it's starting, just stays gray. And I see that I copied my httpd file back from my desktop to etc (it asked me to authenticate when I did) and now it's there without .config at the end. -
Apache doesn't start anymore
2004-10-14 14:47:33 diad [Reply | View]
Oh hey I figured it out. You can't drag it from your desktop back to the etc folder. Instead you have to go to the terminal and type:
sudo cp ~/Desktop/httpd.conf /etc/httpd/httpd.conf
I got this from Swanilda: http://swanilda.com/unix5.html
Don't know if it works but it makes total sense. I will try it now.




"403 Forbidden. You don't have permission to access"
I found an explanation of how to fix the problem in
http://www.gigoblog.com/2007/11/08/configure-apache-web-sharing-for-user-accounts-in-mac-os-x-105-leopard/
I followed that web pages "Activate All User Accounts" instructions, and created a file called /private/etc/apache2/users/local.conf. Now I can see my web pages - both on the computer that contains the web pages, and also on another computer which is connected to the Internet.
The only changes that I'd put into the gigoblog explanation are these:
1) Make sure that you're signed on as a system administrator before you start typing commands in Terminal.
2) After you're done, if you don't usually log onto your Mac as an adminstrator, exit from your administrator session.