Jump to content

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


Recommended Posts

Posted

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

Posted

<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
Posted

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
Posted

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

Posted

# 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.

Posted

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.

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...