Best way to rotate apache log files on Windows - windows

Being new to the Windows server platform I need some input to figure out which way is the best to rotate the apache log files. The server version is Apache/2.0.47 (Win32).
Apache is shipped with the rotatelogs.exe. I found this (rather) old post http://www.sitebuddy.com/Apache/Cat/Logging saying
Conclusion: It is unusable and dangerous (it will eat up all your
memory/file handlers ...etc...).
You can not even use rotatelogs.exe on 4+ sites, Apache will
lockup when starting (tested on Apache 2.2.0).
Same guy has created a dll-file http://www.sitebuddy.com/mod_log_rotate which I'm not to sure that our hosting company will be to happy to implement on the production servers.
So since we are running this rather old version of Apache (which I'm stuck with, since it is really the IBM HTTP Server shipped with WebSphere) I'm afraid of the rotatelog.exe, anyone aware of what would be the best option to implement?

Our hosting partner decided not to allow usage of rotatelogs.exe since they have had some issues for other customers. Therefore the solution was to create a PowerShell-script, that stopped the service, rotated the logs and started the service again.

Related

Heroku and Elasticsearch - which add-on to use?

I plan to use Elasticsearch on heroku.
I was looking for the best option of Elasticsearch add-on I can use.
Found was my first choice from the following reasons:
It is now part of elastic.
When using Elasticsearch on heroku it will be opened to the world - a secure wrapper to the transport client was introduced - https://github.com/foundit/elasticsearch-transport-module/
But it looks like this repository is not highly maintained, and Elasticseach 1.5 is the latest version which is supported.
What is the recommended add-on then?
If I want to use the latest version of Elasticsearch I am doomed to use an unsecure connection?
Maybe use the official java client?
Nick with Bonsai here. Based on your question, and my own obvious bias, I'll suggest Bonsai for the following reasons:
All of our clusters have SSL with basic auth to secure the connection. We feel pretty strongly that security comes as a standard feature.
We were the first hosted Elasticsearch provider, ever. (And one of the first addon providers on Heroku, ever, with our first search addon, Websolr.) So we've got plenty of experience hosting search and and thousands of other happy Heroku customers.
One definite tradeoff with using Bonsai is that we're generally always going to lag a bit behind the latest version of ES. As of this posting we're still running ES 1.7, but updates to ES 2.2 are just around the corner.
This is probably going to be true in the future as well. Part of the reason for this is that we're a small, bootstrapped company, and we have to be pragmatic in where we focus our engineering efforts. Plus as an operations company with thousands of businesses, we like to let major new upgrades spend a few months in the wild before we commit to supporting it.
We also work hard on providing managed upgrades, at least for versions that are sufficiently backwards compatible. Everyone has their tools for helping to manage upgrades, but I don't think any of the other providers do actual in-place upgrades.
Unless you have a hard requirement for a specific feature in 2.x (and if you do, please let me know) you may do fine on 1.7 until our 2.x support is fully baked. Drop us a line at info#bonsai.io to get whitelisted for the first release of that in the coming weeks.

How to minimise differences between a development and production server?

Lots of time, We build a web application in our own personal system, with a local server that comes in packages like WAMP, XAMPP. But, the configuration we have on our system hardly matches 100% with the server where we host that application. This adds up to the debugging complexity a lot. Specially when the server you host is configured to hide the errors. Relying on error logs to debug everything, is a uncomfortable options, which is also not guaranteed to be available.
What are the measures we can take to minimise such differences?
You guys might say, it depends on web server as the configuration might be different from server to server. Even in this case, or shared hosting, I would like to know of the pointers to take, before hosting a application or even start building it.
We use a staging server that is a clone of our deployment server. Running code by the staging server (using version control) is both fast and a reliable way to ensure that the new code/code changes work as expected on the live environment.
That said, we use Ubuntu servers and I've opted to use Ubuntu as my development environment as well, makes stuff so much easier.

windows django server

I have inherited a Windows Server and I have to deploy a django app on it.
Have anyone tried to benchmark http servers with django support on this platform?
Which one is fastest?
Use-case of my application would be:
not so much writes to db
heavy usage of admin panel
display tons of results
Have you looked at either wamp or xampp? They both deliver Apache/MySQL/PHP-and-Perl on a Windows platform. But you need more because neither includes Python. See this SO thread for how to proceed from there. Note, you may encounter problems. See this SO thread for an example.
Ps. Personally, I would just get a an account that supports Django (e.g. webfaction.com) and not screw around with this.
I run a Django site on Windows using Apache. I've posted a write up about some of the hurdles that you're going to face.

Horizontal Scaling of Tomcat in Microsoft Azure

I am working on this quiet a while, but still no conclustion.
I want to do horizontal scaling of Tomcat instances in Microsoft Azure (1,2,3,... Tomcat instances for one service). I read lots of articles about session replication, clustering,... with Tomcat. Since Azure does not support Multicasts, there is no easy way to cluster Tomcat. Also sticky sessions is no options, because Azure does round robin load balancing. Setting up two services - one with Terracotta or Apache mod_jk - and the other with Tomcat instances seems overkill for me (if even doable)...
Is this even possible?
Thanks in advance for reading and answering my question. Every comment/idea is highly appreciated.
There is the new appFabric caching service you could use, or there are examples of using Memcache on Azure, would that help?
http://code.msdn.microsoft.com/winazurememcached
Why do you feel that running 2 services is overkill, exactly? If you have no issue with scaling out to n Tomcat instances, adding another service for load distribution is a perfectly acceptable solution in my book. By running that service on a minimum of 2 instances, that service itself meets the Azure SLA requirements: your uptime will be as good as it is going to get on Azure, and you avoid a SPoF (single point of failure).
You could go with a product like terracotta, but it is also pretty straightforward to write a simple socket server to route HTTP sessions back to a particular instance running in Windows Azure. You would have to be aware of node recyles, but that is quite doable.
Be aware that memcached requires an additional Azure service as well (web roles), the appFabric caching service does not (but also has cost associated with it). I do not know Tomcat, but for IIS you can easily move session state from in memory to persisted (either SQL Azure or Azure Storage). Something to be aware of: for high volume sites, the transaction cost to Azure Storage can actually become a cost driver for your deployment if you store session info there. SQL Azure could well be the more cost-effective solution, but on the other hand might not be supported out-of-the-box for your solution.
I do not think that you can run Tomcat on Azure. Even if you could (using the virtual machine role) it is probably cheaper to run it on a Linux VM on Amazon EC2.
Edit
I see that this is possible using the Tomcat Solution Accelerator. But look at the disclaimer:
This solution accelerator is provided
for informational purposes only and
Microsoft or Infosys makes no
warranties, either express or implied
This is an unsupported solution. I know that it is often difficult to question management decisions. But using unsupported software for production systems, when a cheaper supported alternative is available, is generally not a good idea.

Setting up Mongo DB and hosting

Recently I stumbled across mongoDB, couchDB etc.
I am hoping to have a play with this type of database and was wondering how much access to the hosting server one needs to get it running.
If anyone has any knowledge of this, I would love to know whether it can be set up to work when your app is hosted via a 'normal' hosting company.
I use Mongo, and so I'm really only speaking for Mongo, but your typical web hosting environment wouldn't allow you to set up your own database. You'd want root-level (admin) access to the server to set up Mongo. To get that, you'd want something like a VPS or a dedicated server.
However, to just play around with Mongo, I'd recommend downloading the binary for your OS and giving it a run. Their JavaScript shell interface is very easy to use.
Hope that helps!
Tim
Various ways:-
1) There are many free mongodb hosting available. Try DotCloud.com. Many others here http://www.cloudhostingguru.com/mongoDB-server-hosting.php
2) If you are asking specifically about shared hosting, the answer is mostly no. But, if you could run mongoDB somewhere else (like from the above link) and want to connect from your website, it is probably possible if your host allows your own extensions (for php)
3) VPS
How about virtual private server hosting? The host gives you what looks like an entire machine... hard drive, CPU, memory. You get to install whatever you want, since it's your (virtual) machine.
In terms of MongoDB like others have said, you need the ability to install the MongoDB software and run it (normally as a daemon). However, hosted services are just beginning to appear, such as MongoHQ. Perhaps something like this might be appropriate once its out of beta (or if you request an invite).
It appears hosted CouchDB services are also popping up, such as couch.io or Cloudant. I personally have no experience with Couch so I can be less certain than with Mongo, but I'd imagine that again to run it yourself, you'd need to install the software (and thus require root access).
If you don't currently have a VPS or dedicated server (or the cloud-based versions of the aforementioned), perhaps moving your data out to a dedicated hosted service would be an ideal way to go to avoid the pain and expense of changing your hosting setup.
You can host your application and your database in the different hosting servers.
For MongoDB you can use mongohq or mongolab with space 0.5 Gb for free

Resources