Apache, IIS... Server Explanation for a newbie - visual-studio

Hi I'm a relatively new student in computer science university program. We're getting into web development now. So far, I've only used Visual Studio. Should I be learning how to work with Apache AND IIS? What is the difference? Can I use Visual Studio with Apache? If I download XAMPP, can I still use IIS on the same machine later on?

IIS is a web server that runs on Windows only, whereas Apache is a cross-platform server that will work on Windows, Linux, Mac OS X and various flavors of UNIX. Though you can make either of these servers work with pretty much any web technology (ASP.NET, PHP, Python) there are some natural pairings that you'll find are pretty common.
If you're working with ASP.NET, IIS is the natural fit since both are Microsoft products. Learning how to work with it will help you if you were to start placing your applications on IIS servers later on.
PHP and Python are more naturally paired with Apache. XAMPP, for example, already comes with PHP configured to work on Apache. (LAMP, WAMP and MAMP are other editions of this on various platforms.
You can download versions of PHP, Perl and Python to work with IIS. Some of this can be done with the MS Web Platform Installer, others require a bit more elbow grease. That said, there are installation packages available on many of the technologies' websites.
If you want to work with Mono's open-source port of ASP.NET, on Apache, you'll need to configure the mod_mono extension for Apache.
You can configure as many web servers as you want on the same machine, so long as each of them is listening on a different port.

They are both web servers. IIS is used mostly by Microsoft shop developers as it comes with ASP.NET support - the core of Microsoft's server side technology. Apache is used by almost everyone else (Java, PHP, Python, Ruby, etc. developers) on mostly Linux and Unix servers. Although Apache can technically run on Windows, if you are using Windows servers and programming on Visual Studio, it would make more sense for you to use IIS. Apache is generally more widely used worldwide http://news.netcraft.com/archives/2009/10/17/october_2009_web_server_survey.html

you can use IIS and apache on the same machine simply you would have to setup one of them not to listen on the standard port 80.
What language will you use for your test. if you use plain CGI apache and IIS are fine. If you are doing some dotnet project it would be better to keep playing with IIS.
It's possible to do some ASP.net on apache but require to use mono and that a bit more complex.
Also it's usually more easy to administrate some Apache server, there is a lot of resource on the web about apache. IIS is sometimes more difficult to figure out.

Yes, you should look at IIS and Apache to see how they compare.
What is the difference? One runs on Windows only. Apache runs on almost every platform.
I've never tried to use Apache with VS.
They can run on the same machine, as long as they're configured for different ports.

Related

ASP.NET Core launch settings: IIS Express, IIS, Project, Executable

My Google skills are lacking at the moment. When should I be using IIS Express vs. IIS vs. Project vs. Executable? What are the pros/cons of each?
IIS Express: A common default that runs the ASP.NET Core application behind the IIS Express development server. This is a good default.
IIS: When you actually have a full IIS installed, you can set this up, so that your application runs directly behind IIS. That isn’t really a good choice for development, at least not for ASP.NET Core, and I actually don’t even know if this works properly with ASP.NET Core.
Project: This runs the application as a console application. As a result, this is the same as running dotnet run from the command line. This is also a very good option for debugging, as you can directly see the logging output. Depending on your target production environment, this might even make more sense than running behind IIS Express.
Executable: This allows you to run an arbitrary executable. That’s not really useful for running your ASP.NET Core project.
So basically it comes down to IIS Express or Project. These are the two that are also configured properly by default in the launchSettings.json file that comes with the ASP.NET Core application template.
Whether you prefer IIS Express or running the application directly probably comes down to personal preference. So just give both a try and see what feels nicer to you.

Should I use a windows service?

Hi I have a console app which I need to start up when Windows Server 2012 starts and without needing to login. I've done a bit of research and people advise a windows service is the correct approach, however the links are quite old and I wanted to confirm this is still the case, or indeed correct at all. Cheers.
Yes, Windows Service is still the most popular way to write and run servers and or a 'daemon' in Windows OS.
Depending on what your application is doing, you might have other options though, e.g. hosting an application in IIS (Microsoft's Web server application in Windows Server).
More recently, Microsoft has been working with Docker to also allow the use of containerized application deployments, which is available in new versions of Windows Server (Windows Server 2016).
Here are a few resources for more reading:
For .NET developers: Walkthrough: Creating a Windows Service Application in the Component Designer
Not just for .NET developers: Quick Start: Windows Containers on Windows Server

for IIS, should i use Win7 or Server 2012r2?

Ill need to set up a test IIS.
From a rapid research, ive found that Win7 and Server 2012r2 are pretty much offering the same (for IIS purposes).
Major difference is supported RAM and parallel RDP sessions.
Rather than that, relying on the fact i need IIS, which one is the right OS ?
Many thanks !
Not really the same at all. Windows 7 uses IIS 7, whereas Windows Server 2012, uses IIS 8. Plus, Windows 7/Windows 8 are consumer class OSes. They're not intended for running things like web servers. Likewise, Windows Server 2012 is kind of inappropriate as something like a development machine.
If you're talking about "test" in the sense of QA/staging server, then you should use an actual server class version of Windows. If you're talking about a machine to do development on, then you can stick with something like Windows 7 or 8, but then, you shouldn't even be worry about IIS. You'd just have Visual Studio and run everything through IIS Express.

Web socket server for Windows or Ubuntu 9.04

Where can I download websocket server for Windows. Easy to install. Different from node.js I have already tried this one and couldn't manage to run it on my computer.
If you are developing for Windows you'll probably be using .NET. Here are a few .NET WebSocket server options (I'll also be updating this realtime technologies guide with tech as I find them).
XSockets
SuperWebSocket
WebSync (which works with IIS)
Pokein

How to development in Visual Studio and then deploy apps to Linux machine

How to develop app in Visual Studio and then deploy apps to Linux machine (OS - Ubuntu, web server - Nginx). Can any explain the steps, it will be a great help
I would say that there are three ways how you can develop apps for Linux using mono.
First is using only Visual Studio for development and from time to time deploy your app to Linux to see potential issues. I personally use this scenario because it's simple and when you are not messing with MS specific stuff or yet fully unsupported things then you shouldn't have problems (at least I didn't so far). Disadvantage is that you will discover mono specific problems only during runtime on Linux machine.
Second approach is using Visual Studio with Mono Tools. I tested it when it was in beta and it was sometimes quite handy (you will move the phase of discovering mono specific problems to your dev environment, however you can still have some certain issues on Linux machine), but since this tool doesn't support debugging for now I don't use it personally.
Third approach is to use only MonoDevelop on Linux (since debugging is now supported only in Linux). With 2.2 release this IDE becomes really good and suitable for development however I have tested only console and basic ASP.NET MVC apps so I can't tell you if it's ready for bigger projects.
Deployment to Linux is quite easy - I just installed proftpd on Linux machine, configured it and copied project there from Windows machine.
If you are developing an application for Linux in C (as Nginx is) or C++, you need to develop on Linux.
There are many IDEs for Linux that you can use for this.
You can also try to run Visual Studio in Linux using Wine.
Use Mono on Windows and compile your apps with it , I guess Apache is only supported ... Disclaimer - I do not have personally experience with it ...

Resources