tag:blogger.com,1999:blog-2718170321131838315.post1546224744070080697..comments2024-01-17T12:30:25.176+00:00Comments on The Megalomaniac Bore: C++ based CGI with Apache on Win32 & LinuxXeloushttp://www.blogger.com/profile/05678230259156258183noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-2718170321131838315.post-79562861939012965232016-10-26T23:43:36.319+01:002016-10-26T23:43:36.319+01:00Where are all the new viewers to this old post com...Where are all the new viewers to this old post coming from? Has this page been linked somewhere else?Xeloushttps://www.blogger.com/profile/05678230259156258183noreply@blogger.comtag:blogger.com,1999:blog-2718170321131838315.post-32536821801111500242016-08-31T16:46:39.379+01:002016-08-31T16:46:39.379+01:00I'm not sure I follow, but you need to bind th...I'm not sure I follow, but you need to bind the apache to listen on an interface or IP which you have allowed through your security measures, and then visit that new URL....<br /><br />How you do that totally depends on your security measures and set up, and will be pretty unique.<br /><br />I for example at home, would make the server host on say 192.168.0.100, and make apache "listen" on 80 rather than 8080.<br /><br />I then visit my LinkSys router, go into security, into the firewall and add a pass through from the external internet to the internal IP 192.168.0.100 on port 80.<br /><br />All external requests coming into my cable connection from the outside to my linksys router, will now direct inside my house to the server on that 192.168.0.100 address.<br /><br />At work, this would be far more complex, I would need to assign the Mac address to the DHCP to assign the IP address automatically, reserving it, then tunnel the connection through both the external router, to the internal firewall, to the managed switch, to the right internal IP...<br /><br />So, in short, over to you... Xeloushttps://www.blogger.com/profile/05678230259156258183noreply@blogger.comtag:blogger.com,1999:blog-2718170321131838315.post-19092629059420743522016-08-09T10:48:12.895+01:002016-08-09T10:48:12.895+01:00How to view the same page from a remote system wit...How to view the same page from a remote system within the same network?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2718170321131838315.post-64960882016564751622014-12-10T13:53:58.311+00:002014-12-10T13:53:58.311+00:00%1 is obviously some application name... And it co...%1 is obviously some application name... And it could not start your application, you may need to add a Mime type for "*.cgi" as application/octet-stream... But other than that you simply could not run your CGI... Re-read the post, and check against your code/settings, because my info here works I used it again today.Xeloushttps://www.blogger.com/profile/05678230259156258183noreply@blogger.comtag:blogger.com,1999:blog-2718170321131838315.post-39119841674438929702014-11-01T16:40:34.043+00:002014-11-01T16:40:34.043+00:00This is the message from my error log, please help...This is the message from my error log, please help me!!<br /><br />[Sat Nov 01 22:07:19 2014] [error] [client 127.0.0.1] (OS 216)This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher. : couldn't spawn child process: C:/Apache Software Foundation/Apache2.2/cgi-bin/HelloWorld.cgi<br />AAhttps://www.blogger.com/profile/12220846536131524259noreply@blogger.comtag:blogger.com,1999:blog-2718170321131838315.post-90681360729265038712013-06-27T15:17:11.889+01:002013-06-27T15:17:11.889+01:00Just a heads up to dipti - look up std::wstring to...Just a heads up to dipti - look up std::wstring to handle your unicode needs - you can see I've updated my C++ knowledge a little with the latest book from Bjarne, I highly recommend it.Xeloushttps://www.blogger.com/profile/05678230259156258183noreply@blogger.comtag:blogger.com,1999:blog-2718170321131838315.post-26423059265316748042013-01-03T15:50:57.768+00:002013-01-03T15:50:57.768+00:00My programs are compiled in "multi-byte"...My programs are compiled in "multi-byte" mode, meaning when I call "ReadConsole" it actually calls down to "ReadConsoleA", and I can not therefore call into "ReadConsoleW".<br /><br />There are however a whole plantheon of other sources on using WCHAR and the standard template library wstring classes to pass Unicode in and out of places.<br /><br />Just remember to change your build target to be Unicode, not multi-byte, and check your calls to *W functions are correct.<br /><br />Quite why you're getting an error of invalid handle I can't comment, I don't know anything about your system, nor software, nor code, nor compiler. But hey ho, hope this helps.<br /><br />P.S. Sorry for the late reply, didn't spot I had a comment until just now.Xeloushttps://www.blogger.com/profile/05678230259156258183noreply@blogger.comtag:blogger.com,1999:blog-2718170321131838315.post-62566129151608695172012-12-13T09:27:54.494+00:002012-12-13T09:27:54.494+00:00How do we handle Unicode input as postdata? With m...How do we handle Unicode input as postdata? With my tests after URL-Decode I am seeing the value is coming as UTF-16. Is this always true or dependent on some setting?<br /><br />The ReadConsoleW gives error "Invalid handle". Cann't I use this function with CGI?<br /><br />please let me know your thoughts.<br /><br />Thanks.diptihttps://www.blogger.com/profile/03744622190734301217noreply@blogger.comtag:blogger.com,1999:blog-2718170321131838315.post-44765493019082432112011-07-04T18:27:12.102+01:002011-07-04T18:27:12.102+01:00Addendum, the use of getenv is deprecated you shou...Addendum, the use of getenv is deprecated you should use _dupenv_s. So here's my function to help you get an environment variable as an srd::string<br /><br />///<br />/// Get the environment variable<br />///<br />string Helpers::GetEnvironmentVariable (const string p_VariableName)<br />{<br /> // The result<br /> string l_result = c_UnknownVariable;<br /><br /> // Get the value<br /> char* l_buffer;<br /> size_t l_length;<br /> errno_t l_error = _dupenv_s(&l_buffer, &l_length, p_VariableName.c_str());<br /> <br /> // If we had no error & there is data<br /> if ( !l_error && l_buffer != NULL )<br /> { <br /> // Set the result<br /> l_result = string(l_buffer); <br /> }<br /> <br /> // Free the original buffer<br /> // Note: Its fine to call free with NULL<br /> free (l_buffer);<br /><br /> // Return the result<br /> return l_result;<br />}Xeloushttps://www.blogger.com/profile/05678230259156258183noreply@blogger.com