How to run CGI-C in Mac?

What must I do to run CGI-C scripts in Mac?
We were required in class to use CGI for the server-side processing of HTML. And we use the C programming language.
Anyway, so what I did was that I made an HTML file in Documents with form action='/Library/WebServer/CGI-Executables/sample3.cgi', made a C file and compiled it in CGI (sample3.cgi). I saved this in /Library/WebServer/CGI-Executables but when I ran the HTML file and clicked some buttons, it opened the folder instead and did not execute the CGI file. My professor said something about setting up a web server first, but he didn't exactly tell me how, why and how it was going to help with anything. Can anyone tell me the best thing that I should do in step-by-step? Or if there was something wrong with the directories I used? Thaank you.
For additional info, I use 2013 MacBook Air, the gcc compiler for C and Xcode as my editor.

Sorry been away for a few days.
If the local web server is running you should be able to access the cgi files by referencing them in your HTML document as
/cgi-bin/program_name
I know the folder is CGI-Executables but the httpd.conf file aliases that to cgi-bin so that is the name you use in the HTML code.  Try that and see if it works.
Here is a simple perl cgi script
#! /usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><body><h1>Hello World!";
print "</h1></body></html>\n";
Save that to CGI-Executables as test.pl  chmod it to 755.
With the above installed you should be ale to open a web browser and enter
http://localhost/cgi-bin/test.pl
and the script should run.
Here is  a simple html document to test it also
<html><body><h1>It WORKS! in sites</h1>
<FORM ACTION="/cgi-bin/test.pl"
METHOD="GET">
<DIV>Your input:<BR>
<INPUT NAME="data" SIZE="60" MAXLENGTH="80"><BR>
<INPUT TYPE="SUBMIT" VALUE="Send"></DIV>
</FORM>
</body></html>
When you press the submit  button  the cgi program will run.
As I wrote its been a while since I used CGI (most of this has been replaced by php) and I can;t remember if there needs to be any changes to the https.conf if that doesn't work post back and we'll see if the conf file needs to be modified.
regards

Similar Messages

  • How to run .exe files in mac pro?

    how to run .exe files in mac pro?
    i am looking for this to play games in my mac pro.
    if someone got a answer, just let me know
    cheers.

    mailking wrote:
    And I fail to see why you are attacking me...
    My comment is Valid...  " .exe files will not run natively on Mac OS X..."
    I am sorry. I had the false impression that it was commonly known that .exe files did not run on Mac OSX natively and failed to see any constructive critique you were bringing. Maybe I am wrong. Again deepest apologies.
    Unfortunately... these days... not every one is aware of this .exe  fact..
    Apology accepted.. and Thank You..

  • Install complete - how to run elements on my mac

    install complete - how to run elements on my mac?

    If Installation has been completed, then you can go to the Applications menu on your MAC and you find Photoshop elements listed out there.
    For understanding PSE, you can check this : http://helpx.adobe.com/photoshop-elements.html

  • How to run ipad applications in mac

    how to run ipad applications in mac i ahve downloaded the application in macbook air . But i do not know how to run?

    It can't be done. iPads use iOS as the operating system. Macs use OS X as the operating system. iOS apps don't run on Macs and OS X apps don't run on iPads.
    That's why if there is an app that has been developed for both platforms, you have to buy them separately; iOS apps from the iTunes App Store and Mac apps from the Mac App Store.

  • How to run presentations developed in Mac OS system 9 ?

    We would like to run our old presentations. Do you have an idea how to do?

    Eric, thanks a lot! Will try in according with your proposal.
    Otherwise I have to find hardware for system 9 and run my old
    applications on that.
    Regards Torsten
    2010/9/18 Erik Lord <[email protected]>:
    As there's not been a Mac version of Authorware in a real long time, I think since system 8, these applications likely weren't developed on the Mac, unless Authorware 4 was used... Do you have any way of knowing for sure which version of Authorware was used to develop? Do you have the source files? If so, do those files have an extension - like .a4m, .a4p, .a5p, etc?
    >
    What version of OS X do these need to run on? If it can be older ones, like the first two (Tiger and Panther? I dunno, I'm always unsure of the version names) then it may be possible. However, I think the Authorware runtime simple does not work on newer versions of OS X. I'm not sure of that either, not having tested, but that's my understanding.
    >
    SO, what might work is:
    upgrading the source to the last Authorware version - 7 - on the PC.
    Package without runtime.
    Get that .a7r file to a Mac
    Run it through the Mac Packager
    test the results.
    >
    Helps?
    Erik
    >

  • How to run windows on a mac

    i have a stupid computers class which requires me to have a pc... which i refuse to get. i would like to know how to run windows on my new macbook pro for about the next 15 weeks or so... just until i finish this class...
    if anyone knows how to go about doing this, PLEASE HELP (: thanks!!

    Windows on Intel Macs
    There are presently several alternatives for running Windows on Intel Macs.
    Install the Apple Boot Camp software.  Purchase Windows XP w/Service Pak2, Vista, or Windows 7.  Follow instructions in the Boot Camp documentation on installation of Boot Camp, creating Driver CD, and installing Windows.  Boot Camp enables you to boot the computer into OS X or Windows.
    Parallels Desktop for Mac and Windows XP, Vista Business, Vista Ultimate, or Windows 7.  Parallels is software virtualization that enables running Windows concurrently with OS X.
    VM Fusion and Windows XP, Vista Business, Vista Ultimate, or Windows 7.  VM Fusion is software virtualization that enables running Windows concurrently with OS X.
    CrossOver which enables running many Windows applications without having to install Windows.  The Windows applications can run concurrently with OS X.
    VirtualBox is an Open Source freeware virtual machine such as VM Fusion and Parallels that was developed by Solaris.  It is not as fully developed for the Mac as Parallels and VM Fusion.
    Note that Parallels and VM Fusion can also run other operating systems such as Linux, Unix, OS/2, Solaris, etc.  There are performance differences between dual-boot systems and virtualization.  The latter tend to be a little slower (not much) and do not provide the video performance of the dual-boot system. See MacTech.com's Virtualization Benchmarking for comparisons of Boot Camp, Parallels, and VM Fusion. Boot Camp is only available with Leopard or Snow Leopard. Except for Crossover and a couple of similar alternatives like DarWine you must have a valid installer disc for Windows.
    You must also have an internal optical drive for installing Windows. Windows cannot be installed from an external optical drive.

  • How to run sage on a mac mini

    Does anybody know how to use Sage on a mac mini?
    Thanks
    James

    Windows on Intel Macs
    There are presently several alternatives for running Windows on Intel Macs.
    Install the Apple Boot Camp software.  Purchase Windows XP w/Service Pak2, Vista, or Windows 7.  Follow instructions in the Boot Camp documentation on installation of Boot Camp, creating Driver CD, and installing Windows.  Boot Camp enables you to boot the computer into OS X or Windows.
    Parallels Desktop for Mac and Windows XP, Vista Business, Vista Ultimate, or Windows 7.  Parallels is software virtualization that enables running Windows concurrently with OS X.
    VM Fusion and Windows XP, Vista Business, Vista Ultimate, or Windows 7.  VM Fusion is software virtualization that enables running Windows concurrently with OS X.
    CrossOver which enables running many Windows applications without having to install Windows.  The Windows applications can run concurrently with OS X.
    VirtualBox is an Open Source freeware virtual machine such as VM Fusion and Parallels that was developed by Solaris.  It is not as fully developed for the Mac as Parallels and VM Fusion.
    Note that Parallels and VM Fusion can also run other operating systems such as Linux, Unix, OS/2, Solaris, etc.  There are performance differences between dual-boot systems and virtualization.  The latter tend to be a little slower (not much) and do not provide the video performance of the dual-boot system. See MacTech.com's Virtualization Benchmarking for comparisons of Boot Camp, Parallels, and VM Fusion. Boot Camp is only available with Leopard or Snow Leopard. Except for Crossover and a couple of similar alternatives like DarWine you must have a valid installer disc for Windows.
    You must also have an internal optical drive for installing Windows. Windows cannot be installed from an external optical drive.

  • How to run .rdp file in Mac OSX?

    I have installed Microsoft Remote Desktop 8.0.5 For MAC OSX 10.8.5 and added new remote connection in the list which works fine.
    Now i export same connection to .rdp file but when i execute it mstsc opens remote os login screen for user password to login (which is already in keychain store).
    Question:
    how can i launch .rdp file so that it will not ask remote user password?
    where/how to store password?
    ------- .RDP File ----------
    screen mode id:i:0
    use multimon:i:1
    session bpp:i:32
    full address:s:192.168.1.130
    audiomode:i:0
    username:s:mylabs\administrator
    disable wallpaper:i:0
    disable full window drag:i:0
    disable menu anims:i:0
    disable themes:i:0
    alternate shell:s:
    shell working directory:s:
    authentication level:i:0
    connect to console:i:0
    gatewayusagemethod:i:0
    disable cursor setting:i:0
    allow font smoothing:i:1
    allow desktop com
    bookmarktype:i:3
    use redirection server name:i:0
    Thanks in advance

    Hi Mandar,
    Thank you for your posting in Windows Server Forum.
    “create a simple shell script to launch my remote desktop connection. Eg: if I want to launch SteiniServer.rdp, then my script would look like this:
    open "/Applications/Remote Desktop Connection.app" ~/Documents/RDC/SteiniServer.rdp”
    (Quoted from below article).
    Please go through below article might helpful in your case.
    Quickly Launch Remote Desktop Connections on Mac OS X
    Hope it helps!
    Thanks.
    Dharmesh Solanki

  • How to run powerpc apps on mac 10.8

    Hi i download and installed Rossta and it did not work but it did installed but how do i by pass the powerpc apps are no longer support of
    i need to install this software
    i can't upgrade the software or install osx in virtualbox itired that and it didn't work because it can't read the cd it needs the cd to ber in the drive when in use

    detour12,
    Did you understand the conclusion in this thread?
    You use software called parallels which will allow you run two operating systems at once.
    You install Snow Leopard as the second oparating system.
    The reference on how to buy Snow Leopard was
    http://forums.macrumors.com/showthread.php?t=1365439
    To puchase Parallels see
    http://www.parallels.com/landingpage/pd/upgrade/?utm_nooverride=1&gclid=CJWM2pTq -rkCFfBaMgodDWcA1A

  • How to run diagnostic on your mac before installation?

    Is there a way to do that even though my hd needs to be installed with an OS?
    during installation, it powers off... So I want to know what's wrong...

    This depends a bit on which mac you are using, so posting that information would help us out here.
    You can likely run diagnostics off the recovery partition or installation disk (depending on what mac and OS you are using). Instructions here:
    http://support.apple.com/kb/ht1509
    If you are on a newer system, as per the directions linked to above, just hold 'd' while starting up.
    You can also run disk utility from the installation DVD (hold option while starting up and select the DVD) or recovery partition (Hold cmd-r during startup), and use it to verify/repair disk errors.

  • How to run unbuntu on my mac without installing as seperate os?

    I know VPC did it but outdated any other ideas?

    I use Virtual Box to run UBUNTU as well as several other LINUX flavors and of course an XP partition. Free, works great, frequent updates and performs great.

  • How to run external drives w/ mac mini

    Hi, I recently bought a mac mini and I have two external hard drives hooked up to it. One for time machine and the other for photos.
    When I looked up this topic and did a search I found conflicting answers but I know so little about this...maybe I just don't understand.
    Here is the question: should I leave the external hard drives hooked up 24/7 even through restart etc... or am I supposed to unplug them? Unplugging seems like it defeats the purpose of time machine. On the other hand I don't want to ruin any equipment. What is the standard practice?
    Thanks.

    I'll vouch for the 'get hot'. As in play a dvd for an hour and then take it out hot. Who needs a heater unit with multiple drives going?
    I generally set the Time Machine to OFF and leave it there. Just before and after I add or subtract something significant, I hit Command key and the dock's Time Machine Icon together and choose the backup now function. Now I have a record of Before and After the event. (I also keep a physical log book of what events were changed day/time so if I need to turn the clock back to a specific event I know where to go rather than hunt and peck.)
    ps. the less you let Time Machine make a backup any time IT feels like it, the longer your MB space will last.
    Also, if you can keep your Time Machine backups and other storage saves to just before you are shutting down your system anyway, you can just turn off the drives after the computer is shut down. I learned to do this because my firewire Western Digital MY BOOK drive would only go to sleep mode otherwise even with the computer off.
    Message was edited by: KathleenTarget

  • Any recommendation for how to run exe files in mac os!?

    I have an external hard drive which has a password that is a exe file. I figured if I could find an app that opens exe files it would be the best idea, but since I upgraded to mountain lion that app doesn't support mountain lion!
    any syggestiin guys?

    http://winebottler.kronenberg.org

  • How to run .exe files with Virtual PC for Mac

    Hey Guys, I'm new around here and with mac technology as well. Anyway, I have an iMac OS X 10.5.1 Leopard and I've recently purchased the Virtual PC for Mac 7.0.2 software. So I'd like to know how to use this program properly, because I need to run some executable files in my computer. It is confusing for me because I don't know how to get started, and I only get to the part when it says "OS not found, Install an OS on this hard drive".
    Honestly I've no idea of what an OS is or where do I get that. So I'd really appreciate if one of you guys could tell me, step by step, what to do to use Virtual PC properly, and finally learn how to run .exe files on mac.
    Thanks in advance!
    Have a nice day!

    Always nice to see new faces
    Honestly I've no idea of what an OS is or where do I get that.
    This brings up the second part of your problem. The first part is setting up either a proper Virtual Machine program like Parallels or VMfusion, or setting up a Boot Camp partition on your drive.
    http://www.parallels.com/
    http://www.vmware.com/products/fusion/
    OS stands for Operating System. You are running Leopard 10.5.7 as an operating system on your Mac (MacOS X).
    The second part of your problem - You will need a copy of Windows XP or Vista if you want to run Windows on your Mac.
    There is at least one other solution for running Windows programs on a Mac. It's called "CrossOver" by a company named 'Codeweavers'. It's based on a project for "Wine" to be able to run PC programs on a Mac or Linux, without having to buy or install Windows. It works with a narrow subset of Windows programs so you would want to make sure the program you want to run is compatible with CrossOver before you buy it.
    http://www.codeweavers.com/products/cxmac/
    In addition to all the above information, you need to upgrade your Mac to the latest 10.5.7 from 10.5.1. "Software Update" is located under the black Apple icon in the Menu Bar at the top left corner of your monitor. After you are updated you will want to update your Profile here so that it shows the proper OS version.
    With your level of experience with MacOS X and the Windows OS's you should probably get some help from a local Apple store. They have an appointment system and do offer many types of help and training, and they can offer assistance with choosing the proper programs for you to purchase for your machine.
    You are also welcome to continue to ask questions here, of course. You will want to ask your questions with different issues that come up in different threads so that the answers stay focused on the title of the thread.
    Message was edited by: dechamp to try to be more accurate with a fairly complicated issue...

  • How do you run Windows on a Mac?

    I have had a Dual Core MacBook Pro since last July, but I have never run Windows on it. Could someone here please explain to me how I can run Windows on my Mac, how to switch between Windows and Mac OSX, and if Windows Vista is able to be run on a Mac. Or, at least point me in an article already posted on this subject. Thank you!
    MacBook Pro   Mac OS X (10.4.8)   17" Screen, 2.16 GHz Processor, 1 GB RAM, 120 GB Hard Drive

    Please search the discussions before posting. You'll find hundreds of threads detailing how to run Windows on a Mac and could have answered your own question. Or better yet, just search Google.
    http://www.apple.com/macosx/bootcamp/

Maybe you are looking for

  • Problem Playing Video in Premiere Pro CS4

    I am having a problem playing video in premiere pro. When I input any movie clip and try to play it in both the timeline and in the preview mode, the audio works fine but the video only plays a few seconds worth of footage at a really slow pace so th

  • Can you spot any glitches in this workflow for my projects

    I have been going back and forth on this topic of what format to use for my projects and have proposed various solutions which have not worked out because of some issue I overlooked. After much thought and a lot of reading, I came up with this one: I

  • Photos are not showing up in my photo stream

    Cannot see pictures on my photo stream . It says my photo stream is empty but I have lots of pictures. All sharing buttons are on and I'vv backed it up.

  • Acrobat X Pro Died after InDesign Export

    After viewing a documet exported from InDesign (CS6) for about 10 sec Acrobat X Pro died.  Now it will not open.  What is the best was to fix this - reinstall? I am rnning Windows 7 Pro on a Dell T3500 workstation with 12 GB memory. Thanks for your t

  • Getting warning in SMD Home page

    Hello All, I have installed Solution Manager 7.0 EHP1 ( SP18 ) I am getting the warning while opening the link http://10.39.4.107:50000/smd 1)Upgrade status for the current version is outdated. Please upgrade now. 2)Maintenance mode is enabled. Some