running local CGI scripts

philbert

Registered
Can anyone be so kind as to offer a Mac-like explanation of how to set permissions of CGI scripts in personal web sharing?

Hopefully I have correctly configured Apache to permit CGI. And I know how to serve html files via my local Apache.

I think I just need to learn how to set the permissions of the CGI's.

I've been doing this via FTP (Fetch) on remote Unix servers for 10 years, but have no clue how to do it on my own machine.

If at all possible please recall you are teaching a *Mac* user, not a Unix user. I don't understand the path structure of OSX, hate command line and terminal window stuff. That's why I bought a Mac! :)

I did search the forum first, but explanations I found all read like a Unix manual, and I don't get it.

Many thanks for any assistance, I really appreciate it.
 
If you're going to be a web coder, you can't be afraid of the Terminal!

Try this:

Open Terminal.

Type "chmod +x " (no quotes, note the space at the end)

Drag the CGI file you wish to be executable to the Terminal window -- the path should fill itself in.

Press Enter.

That should make the CGI script executable.
 
Thank you very much. I was hoping for a way to do bulk permissions, as my programs typically contain dozens of files, or more.

With FTP I can highlight an unlimited number of files on the remote Unix server, and set permissions for all of them with a click. It's a Mac experience! :) It's a bit baffling to be retreating in to classic primitive Unix land on a 21st century brand new Mac...
 
ElDiabloConCaca said:
If you're going to be a web coder, you can't be afraid of the Terminal!

Been a web coder for 10 years. Never needed the terminal before. And I don't need the terminal now for coding on remote Unix servers, only on the local one.

If Apple, and Mac app developers, can provide us with a Mac GUI for working on remote Unix servers, why not on the local one???

What's the point of having a Mac if we're going to fiddle around with config text files and a thousand obscure command line instructions??? Why not just get a cheap Linux box if we want to do that dance?

To me, the point of writing CGI programs is to provide web users with a friendly interface to advanced features that empower them with tools that help them do their thing, not slow them down and get in the way. It's the Mac philosophy, eh?

I'm guessing you write CGI too? Do you give your users a command line interface to your apps?

You don't find it rather odd than modern Macs do not use the Mac GUI philosophy for something as universally desired as web serving?

"You must master the Terminal" made sense fifteen years ago, it seems nutty to be using a Mac to return to a world that most Mac users have already rejected.

Sorry for the rant, but I code because I find interface issues very interesting.
 
The way I see it is that one person has to bear the grunt work of command-lines and terminals so that the other person doesn't -- me, being the webmaster, must write CGI scripts, PHP code, set up mySQL databases and the like so that the end user can have a pretty, easy-to-navigate web site.

I just don't think technology is advanced enough to where both the end-user AND the coder can work all day in a nice, fluffy GUI. There will ALWAYS be coding to be done, and no GUI is going to make that any easier, even with code-completion, syntax coloring and error checking.

At any rate, I completely understand your rant. Mac OS X client version isn't meant to be used as a robust web server that handles PHP and SQL and CGI flawlessly -- so there will be some Terminal work to be done. Mac OS X Server, on the other hand, is a fully functional web server with CGI, SQL and PHP support built-in and nice GUI utilities to make it all come together.
 
Hi again, thanks for your thoughts.

I hear you, and am not asking for a GUI for programming perl. Maybe somebody has, or will, create such a tool, and that would be interesting indeed, but I don't expect that in the OS.

And I'm not disappointed that the civilian version of MacOSX doesn't make it easy for me to serve pro web hosting to thousands of clients, or do sophisticated customizing of the web server etc. That would be an unreasonable expectation.

I just thought my 2005 brand new $2000 Mac might have the same ease of use GUI as my free
Fetch FTP program had in 1995, for those kind of very basic server access features.

Macs are agressively sold for their point and click ease of use, so if they're going to include a web server it should meet that standard, at least for something as basic as setting permissions. Imho.
 
But is installing your own CGI scripts really a basic operation? I mean the basic stuff is just letting Aunt Tilly serve up pictures of here doily collection, for which the static stuff works fine.

One thing to keep in mind to is that you mac includes a sftp and an ftp server. So you could just enable that and ftp the files into place yourself in the way you feel comfortable. I did things that way once (from the command line heathen that I am) so that I could test some deployment scripts. Then I could put things on my local account or the public server with the same script and remove lots of human errors from the mix.
 
lurk said:
But is installing your own CGI scripts really a basic operation? I mean the basic stuff is just letting Aunt Tilly serve up pictures of here doily collection, for which the static stuff works fine.

Yes, doily serving! That's what I want to do! Where's the darn doily button?? :)

Seriously, I take your point. I guess there's a logic to assuming that Perl programmers wouldn't mind command line stuff. Though most who might want to install a Perl program wouldn't actually be programmers.

I think my problem is that as Perl coder, I spend all day everyday agonizing about how to make an interface more friendly, and thus my brain has been trained to be unforgiving in the interface arena.

Anybody remember ListSTAR/WebSTAR? I spent about a billion hours in ListSTAR (OS 8 list hosting software) and learned a bit about WebSTAR (OS 8 web server software) in the process. Both of these programs did a lot of quite sophisticated stuff, and I don't remember any commands lines. Well, for sure none in ListSTAR. It was all point and click. There was some free web server software around at the same time, that was also point and click, can't remember name.

So, against that background, the interface to Apache seems like a step backwards from what I was using 6-8 years ago.

lurk said:
One thing to keep in mind to is that you mac includes a sftp and an ftp server. So you could just enable that and ftp the files into place yourself in the way you feel comfortable.

What a great idea, sounds perfect for me. Many thanks! I'm guessing enabling the FTP server involves some command line too :) but I'll investigate before whining or asking more questions.
 
Nope you can enable FTP from the sharing pane in System Preferences. If possible it is better to turn on remote login (ssh) and then use sftp to transfer your files, it is more secure. But if you FTP client doesn't like sftp then you are stuck with ftp.

As for the GUI it really is cultural thing, I am a Unix refugee so I think it is the best thing since sliced bread. Before I bought my Mac the only thing they had to show me was Terminal.app before I knew I could make it work.
 
lurk said:
Nope you can enable FTP from the sharing pane in System Preferences.

Aha, I see it, thanks Lurk!

lurk said:
As for the GUI it really is cultural thing, I am a Unix refugee so I think it is the best thing since sliced bread.

Hmm. Well I'd guess that mastering Unix command line syntax would give you more control over any Unix based server, so once you've made that time investment I can see you'd be pleased to have that power.

And I can see that a GUI is extra overhead on any machine, and in some cases you'd be better of without it.

These are all good arguments in favor of Unix, which I don't argue with.

But like millions of others, I bought a Mac, for the GUI. Making a Mac web server dependant on the command line makes no more sense to me than
doing so in iMovie, Mail, Safari, etc.

Fully GUI Mac webservers have been created, so we know it's possible.

To me, it's just a case of Apple not finishing the service they advertise they are selling, and then passing the buck back to us when we complain.

"Dear Mac user, you don't know 3,347 unix commands?? Tut-tut, what's wrong with you?" :)

A fair way to resolve this, imho, would be for Apple to simply state that the Mac version of Apache is currently in a beta state. It's been offered as is for free, with no guarantees etc. Stamp that on the sales literature, and credibility is restored.
 
Thanks to lurk, I can FTP to my own computer, upload CGI files, and set permissions. I can see my huge doily html site no problem.

It's a bit unsettling to see my directory structure via FTP, think I'll be turning FTP off inbetween use. Thanks to the Mac GUI, and lurk, it's just one click! :)

Apache tells me I don't have permission to access the CGI files.

I carefully followed some instructions on manually editing config files within Apache, but as yet don't have evidence I did it correctly.

Would this error indicate incorrect permissions settings, or incorrect Apache config, or?

You don't have permission to access /~home/$first.cgi on this server

Thanks again!
 
Back
Top