LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-04-2012, 12:51 PM   #1
Freddythunder
LQ Newbie
 
Registered: Apr 2012
Posts: 11

Rep: Reputation: Disabled
Creating a cgi-bin folder


Hello, I tried asking my question in another forum and no one answered so either it's a really hard question.. or a really dumb question. I've done hours of searching for my answer but cannot find anything. But I may be using the incorrect nomenclature.

So, I'm a PHP programmer who's newer to linux. I have written a script in C that talks to mysql. I have future plans for this as it would be quicker than PHP. We have a dedicated server at goDaddy that has a cgi-bin, but it's not accessible from http. I think this is due to internal IP mapping. Both IP addresses that go to this server are internally pointed to two separate accounts.

I want to create a cgi-bin in those created accounts to run the (compiled) C scripts when accessed from a browser. I did find this, can I adjust the httpd.conf file at this point to "move" the cgi-bin file to inside the public_html folder in the setup account? Or is there a better way to "create" a new cgi-bin using command line?

Thanks!

Code:
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are trested as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
 
Old 04-04-2012, 02:00 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,738

Rep: Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586
Hi and welcome to LQ,

If you want to run cgi scripts from inside a user's public_html directory, instead of the global /cgi-bin, you can do the following:
Code:
ScriptAlias /cgi-bin/ "/home/user/public_html/cgi-bin"
<Directory /home/user/public_html/cgi-bin>
Options +ExecCGI
AddHandler cgi-script .cgi
Allow from all
</Directory>
Regards
 
Old 04-04-2012, 02:06 PM   #3
Freddythunder
LQ Newbie
 
Registered: Apr 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
I will give that a try - thank you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
could not execute bin folder of a package from cgi bin script using python ashish hasani Linux - Server 1 04-05-2012 12:18 AM
Cant seem to run any cgi scripts in cgi-bin folder, confused? j.smith1981 Linux - Server 5 02-14-2011 05:38 AM
Displaying JPEG files within the cgi-bin folder metalx1000 Linux - Server 0 12-07-2007 01:22 PM
why can't create a folder in /usr/lib/cgi-bin adam_ant Linux - Software 2 12-07-2005 05:05 AM
http://www.burstnet.com/cgi-bin/ads/ad7954a.cgi/3980/RETURN-CODE rverlander LQ Suggestions & Feedback 1 06-07-2002 07:35 AM


All times are GMT -5. The time now is 08:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration