Best way to run local server using c or c++ - c++

I'm wanting to create a local server on my laptop that runs on c or c++ for the sake of web development. I'm building a website and the backend will run on c or c++ so I'm wanting my development environment to be very similar to the production environment. I've never done anything like this before. What's the best way to go about this? Also if I use https protocol, does that make it 'safe'? Thanks

The simplest way is to install lampp or xampp and use apache. On linux you are going to install your C programs as *.cgi in your directory /opt/lampp/cgi-bin , first get your install to work then you can worry about making it secure, most people will tell you to use PHP and/or other languages instead of C. There is no reason not to use C if you like it. It works fine.

Related

Probably a very basic question: can I build and maintain the same website (in Django) from both Windows and macOS?

Disclaimer:
First, I apologise if I'm incorrectly applying technical terms here or, worse, completely misunderstanding things. I'll edit if corrected.
Context:
Lately I've been building and deploying some basic website ideas to Heroku using the Django framework. I've been doing this on Windows, using venv as my virtual environment "wrapper". I've been building these exclusively from the command line interface.
I also have a MacBook that I'd like to use to access and manage those websites, and in future, larger projects. I would prefer not to install Windows on this MacBook.
To be clear, I know that it's possible to build and deploy a website using Django and Heroku on macOS. I know there are, at the very least, some syntactical differences in how I would approach this from the CLI versus Terminal.
Desired outcome:
I would like to set up a website in the fashion indicated above on Windows or macOS, and then access and manipulate it from the other OS.
Questions:
Is this possible? (Or if I set it up on Windows must I only use Windows to manage it?)
If I set up a website in this fashion using Django, Heroku, and venv on Windows, how (if at all) might I then access and manipulate that website from macOS? I think what I'm mostly stuck on is that, as far as I can tell, I can't use the same virtual environment on both Windows and macOS (I believe venv is itself Windows-only).
Is it possible to "wrap" my website in both venv (Windows) and virtualenv (macOS)?
Am I correct in thinking the only real (i.e. non-syntactical) difference that I need to account for is the virtual environment itself?
--
Sorry if I have massive gaps in my knowledge. I'm self-taught and have historically been terrible at asking for help. I'm trying to fill the gaps by improving my question-asking.
Finally, I suspect that the fact I'm using Heroku may be irrelevant, but I'm including that information in case I am mistaken.
Yes, for most of the projects, you will be able to develop your Django web site on Windows, MacOS and Linux simultaneously. Your virtual environment "wrapper" doesn't really matter, you will use or install and use the one you like or available on your OS.
Then you will learn about Docker.

Integrate C++ gRPC with Bazel on Windows/MSVC?

I know that according to this, integrating gRPC for C++ using Bazel on Windows is currently not supported, CMake is the preferred way. But since Bazel is very adaptable and gRPC integration works like a charm on Linux I was wondering if there is some example/howto that's not officially supported, ideally for MSVC. I could not find any.
gRPC for C++ doesn't support this yet, although that is indeed the plan, so there is no current example/howto from the team.
You're welcome to try it out and send pull requests for anything you end up patching to make it work. Alternatively, you can create a new feature request at https://github.com/grpc/grpc/issues.

How to do code-review/debug/coding/test/version-control for C++ on perforce and VMS

I am working on C++ programming with perforce (a version control tool) on VMS.
I need to handle tens or even hundreds of C++ files (managed by perforce) on VMS.
I am familiar with Linux, python but not DCL (a script language) on VMS.
I need to find a way to make programming/debug/code-review as easy as possible.
I prefer using python and kscope (a kde based file search/code-review GUI tool that can generate call graph) or similar tools on VMS.
I do not have sys-adm authorization, so I prefer some code-review GUI tools that can be installed without the authorization.
Would you please give me some suggestions about how to do code-review/debug/programing/compile/test by python on VMS meanwhile using kscope or similar large-scale files management tools for code-review ?
Any help will really be appreciated.
Thanks
Your question is pretty broad so it's tough to give a specific answer.
It sounds like you have big goals in mind which is good, but since you are on VMS, you won't have a whole lot of tools at your disposal. It's unlikely that kscope works on VMS. Correct me if I'm wrong. I believe a semi-recent version of python is functional there.
I would recommend starting off with the basics. Get a basic build system working that let's you build in release and debug. Consider starting with either MMS (an HP provided make like tool) or GNU make. You should also spend some time making sure that your VMS based Perforce client is working too. There are some quirks that may or may not have been fixed by the nice folks at Perforce.
If you have more specific issues in setting up GNU make (on VMS) or dealing with the Perforce client on VMS, do ask, but I'd recommend creating separate questions for those.
Indeed, it's not clear from your question what sort of programming you want to do on VMS: C++ or python??
Assuming your first goal is to get familiar with the code-base, i.e. you want the ease of cross-ref'ing the sources:
If you have Perforce server running on VMS, then you may try to connect to it directly with Linux Perforce client. And do "review" locally on Linux.
If you've no Linux client, I'd try fetching the latest revisions off and importing raw files it into an external repository (svn, git, fossil etc.). Then again using Linux client and tools.
If your ultimate goal is to do all development off VMS, then it may not really be viable -- the code may use VMS specific includes, system/RMS calls, data structs. And sync'ing the changes back and forth to VMS will get messy.
From my experience, once you're familiar with the code-base, it's a lot more effective to make the code-changes directly on VMS using whatever editor is available (EDIT/TPU, EDT, LSE, emacs or vim ports etc.).
As for debugging - VMS native debugger supports X-GUI as well as command-line. Check your build system for debug build, or use /NOOPT /DEBUG compile and /DEBUG link qualifiers.
BTW, have a look into DECset, if installed on your VMS system.

Cross Platform C++ webserver Library

I am looking for a cross platform Library in C++ that can run a web server.
Does any one know if tntnet can work on windows computers.
or libmicrohttpd
POCO has a HTTP server, among lots of other useful stuff. Runs on Windows, Linux, etc.
Currently tntnet does not support windows. It is possible to port tntnet to windows but nobody has done the work. Sorry.
The boost.asio library documentation includes several example HTTP servers
http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/examples.html
I fond these extremely useful in developing an embedded web server for my own applications.
This might not answer your question directly, but if you have your heart set on one of those, you could always compile them in cygwin.

Cross platform c++ with libcurl

I am a perl developer that has never went into the client side programming of things. I'd like to think that I'm a pretty good developer, except I know that my severe lack of knowledge of the way desktop programming really takes away from my credibility.
That said, I really want to get into doing some desktop applications.
I want to try to develop a simple application that will connect to my server and grab an rss feed, then display it in the console. My plan of attack is to use libcurl (and curlpp) to grab the feed (I'd also like to do more curl stuff in the future). But I want to be able to run this small program on linux, windows, and mac because I want to understand developing cross platform.
So here is the question (and I know it is extremely noobish): How do I write c++ code that will use libcurl and curlpp, and will work on the 3 major OSes? The main thing I don't understand is if I have to compile libcurl and curlpp, then how does it work when trying to take it over to the other platforms?
You need to write the code portably - basically make it a console application. You then transfer the source code (not the exe) to the other platforms and compile it there and link with the version of llibcurl on each specific platform.
Neil is right, but using a framework will make your life easier. Try QT it is very nice. It has a cross platform http API, and integrates curl.
I'd recommend Qt4 as well, I've wrote a small'ish tutorial on how to setup a windows gcc compiler on linux and compile Qt4/OpenSSL with it for windows, hope that helps.
http://www.limitlessfx.com/mingw-openssl-qt4-for-windows-on-linux.html
You can easily adapt that tutorial to compiling libcurl instead of just moving to Qt4.