Jump to content

[Answered] Running A Cgi App Written In C++


srh124

Recommended Posts

Hi guys.

I'm gonna use Mapserver which is provided in this link: http://mapserver.org/download.html

first of all, i don't know which binary of mapserver for linux i should use.

Second, i didn't understand what this link says: http://wiki.helionet.org/C%2B%2B/C_as_CGI

It sounds some kind of configurations should be done, but i don't know how.

I'm so sorry. I've been using windows all the time, so i'm not familiar with linux and its words.

 

Any help would be greatly appreciated.

Best Regards

Link to comment
Share on other sites

<p>Basically:</p>

<ul>

<li>Drop source into /cgi-bin</li>

<li>Set up a cron command to compile it into a .cgi: <br />

<pre style="font-family: monospace, 'Courier New'; padding: 1em; border: 1px dashed rgb(47, 111, 171); color: rgb(0, 0, 0); background-color: rgb(249, 249, 249); line-height: 1.3em; font-size: 13px;">

gcc /home/user/public_html/cgi-bin/mysourcefile.c -o /home/user/public_html/cgi-bin/outputfile.cgi</pre>

</li>

<li>Make sure the cron command is set to run sometime after you create it</li>

<li>Add the cron job</li>

<li>Let the cron run</li>

<li>Enjoy your C/C++ cgi</li>

</ul>

 

  • Like 1
Link to comment
Share on other sites

Like a lot of things in computing, if it's beyond your understanding perhaps you should learn more before you try it. Compiling C++ code into a functional cgi is pretty high level stuff, and there are multiple ways to easily get your account permanently banned if you mess it up.

 

Furthermore, if you look at http://mapserver.org/installation/unix.html#installation you will see that there is more to it than just compiling a single cgi file. It looks to be a full install of executable software and the cgi is just the web interface. You won't have access to install anything like that on Heliohost. In order to have shell access and be able to compile and install binaries you will most likely have to buy a VPS or run your own server. It's certainly not something that most shared hosts will allow because of security concerns, and Heliohost is no different.

  • Like 1
Link to comment
Share on other sites

Thanks a lot.

In fact, i didn't want to compile mapserver from scratch.

a folk told me you can get binary version of mapserver out of rpm packages using 7zip. but extractring rpm and copying mapserv file to cgi-bin doesn't solve the problem. (I think at least without its dependencies it should display a meaningful error, not 500 error)

Anyway, i followed link provided by Support Admin. i can't understand this line:

[

You’ll want to setup a symlink to that executable from your cgi-bin directory:

 

 

# ln -s /usr/local/bin/mapserv /usr/lib/cgi-bin/mapserv

 

]

Could u tell me how it would be performed, please?

 

Regards

Link to comment
Share on other sites

# ln -s /usr/local/bin/mapserv /usr/lib/cgi-bin/mapserv

 

Could u tell me how it would be performed, please?

I already said it once, but I guess I didn't explain it well enough.

 

That executable doesn't exist because it hasn't been installed. You don't have access to install executables for security reasons. It's not going to work.

Link to comment
Share on other sites

So sorry. I didn't get what were saying

 

Strange!! as it appears, they have a developed an advanced open source application which can not be easily used. Most of the websites don't have shell access to install or this kind of stuffs.

 

Anyway, Thank you and pardon me for bothering you.

I thought i can test Mapserver in CGI mode but i was wrong.

Link to comment
Share on other sites

they have a developed an advanced open source application which can not be easily used.

It can easily be used. Take a computer you own, install Linux, install this mapthingy program, and you're good to go.

 

The problem is that shell access is a huge security issue in shared hosting so you have to use a server that only you have access to such as a VPS or a spare home computer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...