I've just installed XAMPP and just wondering what are the benefits of running Apache as a service?
One of the benefits is that when installed as a service is that you can limit the privileges (directories read/write access, network access, this means better security of course) of the account that runs it (the default is the LocalSystem account on Windows, you can find more about it here).
And as admin pointed out, you can also keep the service running without you being logged in all the time.
The benefits of a service in general (on Windows) :
It can automatic start at System Logon
Start and stop not related to a specific user session
Run in Background
Can run under a special account (LocalSystem, Network Service)
From Vista/Server 2008 onwards run in Session 0 (Isolation)
If you use apache only for developing purpose you can avoid to install it as service and run it when needed directly from your user session, in a production enviroment is highly recommended to install and run it as service ...
-Don't have to start it after each boot.
-If you log off the server continues running.
If you will use the server all the time, set it as a service... If not, just start it when you need it to keep the resourses free.
Related
Azure VM, Cloud service or Web job?
I have a configurable console application which runs continuosly. Currently it is running on a VM and consumes lot of memory (it is basically doing data mining).
The current requirement is to have multiple instances of this application with different set of configuration which can be changed by specific users.
So where should I host this application such that the configuration can be modified using some front end which provides access managements(like Sharepoint),ability to stop it/restart (like WCF service) without logging on the VM?
I am open to any suggestions/ideas. Thanks
I don't think there's any sold answer to this question as there is the preference variable but for what it's worth, if it were up to me I would deploy it against individual azure VM's for each specific set of users. That way if the server resources went up because of config changes the user group made it is isolated to that group, and with azure, will scale automatically to meet the resource demand. Then just build a little .net web app to allow user to authenticate and change configuration settings.
You could expose an "admin" endpoint for your service (obviously you need authentication here!) that:
1. can return the current configuration
2. accept new configuration
3. restart the service (if needed). Stopping the service will be harder, since that leaves the question on how to start it again.
Then you need to write your own (or use a 3-party (like sharepoint or a CMS)) application that will handle your users and under the hood consume your "admin" endpoint.
Edit: The hosting part: If I understand you correctly your app is just an console application today, and you don't know how to host it? Well, there are many answers to that question. If you have a operations department go talk to them, if you are on your own play around and see what fits you and your environment best!
My tip: go for a http/https protocol/interface - just because there are many web host out there, and you can easy find tools for that protocol. if you are on the .NET platform check out Web.API or OWASP
Azure now has Machine learning to process data mining.
You should check if it's suit to you.
Otherwise, you can use Webjob:
Allow you to have multiple instances of your long time running job (Webjon scaling out).
AppSettings can be change from the Azure Portal or using the Azure Management API
I have a self hosted wcf service with a startup task that runs
netsh http add urlacl url=https://+:{PORT}/{SERVICENAME} user=everyone listen=yes delegate=yes"
previously the service didn't have ssl, but the old http url reservation was still there (or was added by something else I'm not aware of).
So do I need to add a netsh remove to startup task?
EDIT:
I remove desktop-ed to the role to check if the reservation is there.
To make you understand better the scenario, when you deploy your application in cloud, you are running application in a virtual machine within virtualize environment. Your application will be running within a data center however the virtual machine will be hosted on a host machine which can be changed any time due to any particular reason. This is possible due to Guest OS or Host OS update, hardware failure, resources change requirement, and any other reason. Because of it you should not consider that your virtual machine will always be same, to be more specific it is "virtual".
You can never assume it will be the same, it often is, but if there were a hardware failure and your role were restarted within the data center elsewhere, it certainly wouldn't be. Any startup task would need to be idempotent.
I'm following this tutorial and seems like to implement WCF in my application it would need to run with administrator privileges.
I want to use remoting only to communicate between processes in the same machine. Anyway, everyone seems to recommend WCF even when this is the case. But if this will require my application to run only with administrator privileges then I'd rather find another solution than WCF.
There seem to be a workaround that involves running the command line and using some tool that varies depending on the Windows OS version. Is this the only way? Would I have to tell my users to run the command line and all that stuff or can this be automated, considering that my application runs on XP, Vista and 7?.
Administrative privileges are only needed for the HTTP URL namespace reservations. If you are using named pipe communication (which would be the recommended way to go for inter-process communication), then you can run fine as a normal user.
It could well be that because you are registering the endpoint information programatically that you need the elevated permissions. WCF does not require them in most circumstances.
Services such as this one require permission to register HTTP
addresses on the machine for listening. Administrator accounts have
this permission, but non-administrator accounts must be granted
permission for HTTP namespaces
I have multiple content servers on different machines. I need to check the status of every server. I'm concerned about things like disk size, priority etc.
One solution that I'm using now is to install a Window Service on each machine which regularly checks the server but I have to manually install the service on each server.
Is there any way I can get the server information like disk space from a WCF service or using a windows application? I want to create a single watcher for my servers as I have to add servers sometimes.
Look at windows WMI you can make remote calls to machines so long as you have permissions to do so. You will only have to run one service on one server that can connect to the others.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394582(v=vs.85).aspx
Maybe there is a better way. Here is what I want to do.
I connect and download quotes all day and night using Web Server / Browser Based Application and SQL Database. How can I move this session to my web server so I do not have to use local resources to manage this process? When I connect to my Web Server using RDP, it will, of course, log me off all applications (including web browser) when I exit.
Thank for help and advice.
Craig
With RDP you should not be logged off. The session should remain even if you close RDP. But if you want to perform automatic repetitive tasks on a server, you should look into cron jobs, services or daemons, instead of relying on a user session with a running application.