WAMP servers... why just for web development - wamp

What is to stop you using a WAMP server (or similar) to run single-user business database applications day-to-day?
I read everywhere that WAMP and the like are intended for the development of web apps, but why can't they be used to deploy desktop apps - what're the downsides?

Personally I think WAMP/MAMP/LAMP are great applications that CAN be used for production servers.
I have started doing this myself as I do not have the complete knowledge in server administration on the linux end and my PHP applications are not compatible with IIS.
If you are a small operation than it should save you time then go for it.
If your business grows and you can afford to put on staff to manage dedicated servers with the Apache, PHP ect all installed separately then I also recommend this.
The main difference I can see is that WAMP probably wont be as scalable as the preferred setup. The binaries are all integrated and sometimes I have had issues trying to figure out which php.ini file the system is using.
WAMP is just as secure as any other server as long as you know how to do so, is provides a UI layer which cost CPU time but like I said if you are only serving small web sites/apps than this should be just fine.
My other recommendation is to install it on a Server (Windows 2008 RS or 20012) Windows servers are more reliable and powerful than the Windows User version. Just remember to turn off IIS and any other roles not used by the Windows Server.
Make sure you your WAMP folder backed up regularly!
Good luck

I haven't found one yet. I guess the speed won't be as good as a 'pure' setup, but it sounds like that isn't an issue.
I run an epos web app for a photo studio no problem at all!

WAMP usually stands for Windows, Apache, Mysql, PHP or whatever your particular choice for P is. It describes a stack meant for specifically for deploying/developing web applications and is a rough equivalent to LAMP. Most things that would be considered desktop applications wouldn't use a webserver and more than likely would not be written in PHP.
The issue is not so much one of downsides as it is Apples and Oranges: Desktop applications are usually built with a less web centric stack.

Actually i used with wamp for many purposes; I used it with VB.NET apps, PHP, etc...but I think if you want to use it for deployment, you should start by configuring it to do so.
For example, for PHP deactivation errors display in php.ini, start listening on all allow all in httpd.conf, activating safe mode, setting a password for MySQL; and many other options that have to be configured.
I personally prefer because it is a quick and lightweight tool.

Related

Which is the best development/production environment for Django projects?

A bit of background
I work for a little company as Django developer. The previous developer left the company and I am the only developer (that is the reason they were looking for a Django developer). The company has a simple web application that needs to be mantained and scaled. It seems that the company is getting sales and incomes are increasing. There is a possibility to hire another developer in the short or mid-term. Right now I am analizing possible improvements. This is my first professional job as Django developer, but I achieved to deploy some little personal projects in the past. As you can imagine I am not an expert at all.
The issue
We use a Ubuntu VPS for development, using Django's integrated web server. And another Ubuntu VPS for production, using Nginx+Gunicorn. We use git for version control. The only user we use (for everything) in both VPS is root. I don't work locally in my computer, but connected via ssh to the servers. These are my insights about the structure:
Use of root is unsafe. No doubt about it and we should change this.
What if another developer is hired? Could we work together in the development server?
The question
As the title says, I want to know which would be the perfect working structure for a developers team. After googling a few hours my approach would be something like this:
Production server.
Testing server (replicating as much as possible the production server).
Development environment. Every developer should work and test their code locally in their computers before testing it in the Testing server.
Use of Git for version control.
Use of non-root users for both testing and production servers.
This is just my point of view and I haven't even tried it. I would appreciate you to share your knowledge and experiences.
Thanks in advance!

How to publish web service on a website

I know how to create a web service in C++ Builder/Delphi. But, I don't know how to publish it on my web site. I'm using a web hosting service, not my own personal web server. For example,
I usually use the first option "Stand-alone VCL application". Can this one be published on the web site? What are the differences between those types anyway?
Standalone VCL and console applications are mainly for debugging purposes. You use them when you develop your service because this way it is much faster. You can debug your code and use the WebApp debugger that comes with delphi.
If you want to deploy in production use either ISAPI or CGI. ISAPI is a dll that gets loaded by Apache or IIS (most common but there are other web servers that support it). Usually it was faster then CGI because it loaded once and ran inside the host process, the web server itself, but because it is a DLL that meant that if crashed, it could bring down the whole web server.
CGI on the other hand is a standalone executable. It was used a lot on linux where forking a process is cheap and fast. Every request used its own instance of CGI executable. But since then, projects like fast CGI and others made this a lot faster and more appealing. This also goes for ISAPI. Since then, there are ways to isolate ISAPIs into its own sandboxed processes.
As for hosting. Both are 32 or 64 bit Windows processes. So you need a Windows platform to run them. Mostly that will be Apache or IIS. This is not the best option for hosting because hosting is mostly done on Linux. This is the reason why PHP is still so popular. It runs on Linux and 99% hosting environments support it. So if your hosting is not Windows based and does not support CGI or ISAPI then you are out of luck.

Choice of server for local Django webapp?

I've put together a Django app that was intended to run on Pythonanywhere. However, I soon found out that Pythonanywhere's free plan blocks the remote sites which I intend to interact with, so I decided running the app on a local machine would be good enough for my purposes.
Now, I know that Django's development server isn't meant to be run in a production setting. So, what server daemon do I run on the aging Windows workstation the app's probably gonna be deployed to? Apache, lighttpd, Cherokee? Something else?
My first priority here is conserving system resources as much as I can; I'm probably also going to use Python's built-in sqlite3 instead of MySQL.
Personally I deploy Django with fcgi and Nginx. Nginx offers various strategies to conserve system resources; its use as reverse proxy is well documented and widely used.
The question/answer pair here might help you clear some initial questions about the various components when deploying Django.
Sorry to hear you can't use PythonAnywhere's free version :-(
I'll second the usage of nginx; it's what we use as the front-end for PA. However, we use uwsgi for the backend. It works really well for us and is very easy to configure.

Development server & production server

What is the right way to handle a production and development website on the same server? the development code shouldn't be available until it's used for production.
I'm using Apache and Django and VPS hosting.
What should I configure? Apache- so it will have a special prefix for development stuff, Django- and have some URL mangling in the urlconf, or just get another VPS for development?
Find an old computer and stick it in your basement. you really don't need tons of horsepower for a dev machine & should be able to do it for a couple hundred bucks.
The problem with developing on a production machine is that you could crash processes [apache?] with some 'not quite debugged yet' code and affect live services, even if you have configured separate subdomains or virtual hosts.
never never never develop live.
-sean
PS> another VPS is a workable solution if 'spare hardware' is not available. However you could have availability issues.

Using C++/Qt4 application as backend for web application

for one of my applications I'd like to provide a minimal web interface. This core application is written in C++ and uses Qt4 as a framework. Since I'm also using some libraries I wrote to calculate some things and do some complex data management, I'd like to use this existing code as a backend to the web interface.
Idea 1: Using an embedded web server
The first thing I tried (and which worked to some degree) was using an embedded web server (mongoose). As you can imagine, it is just a very thin library and you have to implement a lot of things yourself (like session management, cookies, etc.).
Idea 2: Using a normal web server and adding a fcgi/cgi/scgi backend to my application
The next thing that came to my head was using a mature but compact web server (for instance, lighttpd) and simple provide a fcgi/scgi/cgi backend to it. I could write the web application using a good framework, like Pylons, PHP, or RoR, (...) and simply have an URL prefix, like /a/... which allows me to directly talk to the backend.
I tried to implement the libfcgi into my application, but it looks messier than needed (for instance you'd have to implement your own TCP/IP sockets to pass on data between your app and the web server and tunnel it through the FCGI library, meh)
Idea 3: Creating a command line version of my application which does the most basic things and use a normal web server and framework to do the rest
This is the third idea that came to my head. It is basically about creating a web application using a traditional way (PHP, RoR, etc.) and using a command line version of my application to process data and return it when needed.
I've got some experience with creating web applications, but I never had to do something like this, so I'd like to hear some ideas or suggestions. I'd like to use JavaScript on the browsers (AJAX, that is) and pass some JSON constructs between web browser and server to make the user experience a bit smoother.
So what are your suggestions, ideas on this? I don't want to re-invent the wheel, honestly.
I would never expose a custom written application to the net as front-end, for that servers like apache or lighthttp are build. They give you some serious security out of the box.
As for interaction of your app with that webserver, it depends a bit on the load and what kind of experience you have with writing software in PHP, python or other languages supported by your web server (via interpreter of course).
A slight load, and a command line tool accessed from PHP might do perfectly well.
A more heavy load and you might wish to implement a simple (SOAP?) server with Qt and access that from a python (or php) script.
That way you don't need to do layout in you app, and you also don't need to implement security all that much.
I'm currently researching a similar situation (custom web app backend using Qt), and the least bad option is FastCGI. Found something you might be interested in. Not production ready without some serious testing, but this might be a good starting point for Qt - FastCGI interop: FastCGIQt
I've used the FastCGI Protocol Driver library for a similar project (also a Qt application), the download link is at the end of that page [Libfastcgi]. Integration with the application turned out actually comparatively easy. Lighttpd + mod_fastcgi was used as web server. Can't say anything about FastCGIQt, though.
You Wt works well to provide a web interface to Qt based applications. Both have a similar programming style, and there's an example that demonstrates the integration with Qt.
Here is example of embedded QML-server: https://github.com/ncp1402/ql-server