Limit Bandwidth per Apache Virtual Host [closed] - apache

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm going to launch a 2GB Linode VPS to host a couple of Wordpress CMS sites and one based on Yii framework. I planned on using Apache virtualhosts to assign each site it's own webroot on a user's home directory instead of leaving everything in /var/www
Is it possible to limit the bandiwdth allocated to each Apache virtualhost? I was planning on using Debian Squeeze or CentOS for this box. Not that I envision any of the sites maxing out the 4TB of bandwidth allocated from Linode but it just seems like good practice.
I think using a VPS is the best option as none of the sites are particularly large and the cost of using a PaaS seems a bit much for a few simple CMS sites and a lightweight Yii app.
Also - I know this is subjective and somewhat against the rules here - but is Debian particularly easy to use compared to CentOS for a newbie? Linode have an extensive guide on their Wiki about launching and running a CentOS server but I'm sure there are equally as good guides out there in the wild for Debian?
Thanks in advance for any advice :)

There are several modules for Apache to limit the total bandwidth for each website. A well known one is mod_bw. Here are some good tutorials on how to set it up:
http://www.gavinwill.me.uk/2012/09/limit-apache-bandwidth-with-mod_bw/
http://linuxpoison.blogspot.tw/2012/02/setup-and-configure-bandwidth-limiting.html
http://www.pwrusr.com/system-administration/apache-mod_bw-for-virtualhost
Here are the modules that I'm aware of which perform bandwidth limiting:
mod_bw
mod_bandwidth
mod_cband

Related

Can LAMP and Ruby on Rails run together on the same VPS server [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Now , I have a LAMP and run a codeigniter website very well on a VPS (512M) .
another site i want to built it on Rails .
How could i do? is there any recommend tutorials ?
I'm afraid the memory is too tight . because my vps only has about 256M memory now!
You can run using Passenger. It will compile an apache module that you can then use to run Rails websites. You can also use any other approach such as Unicorn.
512M of RAM is not a lot, but for a smaller Rails app it should be enough, especially if you fiddle with the settings a bit. I used to have a 512M VPS and I did occasionally experience crashes because the VPS ran out of RAM, so be wary of this. With a small VPS nginx would probably a better option as opposed to apache.

Ruby on Rails webhost recommendation [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Can someone recommend a web host that will allow me to use the latest versions both of Ruby and Rails? I tried Dreamhost but they're running Ruby 1.8.7 which would mean I'd have to rewrite my entire app. But the most I can afford is around $10/month.
Heroku is your friend.
Free for a single dyno.
Lots of addons with free tiers.
No mucking about in server admin duties.
Deploy via git.
Specify your Ruby interpreter and version via Gemfile
Asset compilation on-push
It's just too easy.
Check out webfaction. Not free, but very cheap, awesome support. Shared hosting, but you get ssh access and close to full control. You can install your own software if needed. It is great if you want more control or want to do more than just a rails site. And it is easier to manage yourself, e.g. when compared to a linode for instance (where you have complete control, but have to setup everything yourself).
$10 is a pretty big budget in my opinion, you could perhaps look into getting a VPS? One of my friends (text book village (.) com) got a vps from computinghost.com , they compiled everything for him but the $10 control panel gives you Zpanel as your control panel.. So, if you can manage through command line or can do everything through your application's interface.. I would recommend it.
They also give shared hosting services, maybe contacting their support would help
For Rails, it's better to have your own environment than a shared hosting like Dreamhost.
Heroku, will be the first recommendation, the current stack is Cedar Stack which supports Ruby 1.9.3. Free if you are using only one Dyno (approx. 512MB RAM), 10K records in DB.
We also use DigitalOcean - http://digitalocean.com for some of our hosting. Plans start from $5 for 512 MB RAM. You can run a decent sized rails app on this.
You can also look at AWS, which provides one year free tier, basically hosting, storage etc - http://aws.amazon.com/free/ It's a good option if you think you need to scale in by end of the year.

Possible Apache throttling HTTP requests [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have Apache running on CentOS and I was wondering if there is a specific setting in httpd or otherwise whereby there is a timeout period for multiple requests from the same IP.
I am developing on the server, and hence I'm doing a lot of page loads when I keep refreshing the page to check my work. I frequently get 504 time outs, or it takes ages to return the page, but then other times it is lightning fast. Its usually really fast when I leave it for a bit (for the first few page loads, then it times out again).
I'm sure that this is an inbuilt/default setting to prevent loads of requests from one client, but its incredibly frustrating to me when I am trying to develop!
I am running Plesk on Apache, which I guess could also be throttling me?
Any clues or hints greatly appreciated!
Not on the standard apache modules, and not (AFAIK) on the modules which ship with Centos. That you are getting a 504 error implies that the timeout is occurring with the request on Apache (rather than on a firewall in front of apache). Is this static content?
I am developing on the server
Bad idea to use you production system for development / testing. This also implies that the page is generated from a script - it's more likely your script is at fault. Try profiling it.
I'm doing a lot of page loads
Really? you probably need to spend some time thinkig about your code, and how you develop your code.

Magento: Lighttpd vs Nginx [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm using Apache in all my Magento installations. I wonder if I should start to use Lighttpd or Nginx to improve performance. What do you think?
EDIT 1
I've seen that:
nginx:
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento
lighttpd: http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/installing-with-lighttpd-and-fastcgi
Should you ditch Apache?
In my experience (using Nginx + PHP for about 3.5 years) it's a wonderful choice and I would never go back to Apache. There are two main advantages:
Reduced memory usage: Using Apache, PHP is loaded inside the webserver itself. If you have 80 Apache processes listening, everyone of them will run a different PHP environment, using 20-30MB of RAM each. Nginx, on the other hand, communicates with a bunch of php-fpm processes which you can scale separately. I usually have to run only 3-4 PHP processes, so this drastically reduces my memory usage.
Very fast static assets: Nginx is faster than Apache at serving static assets (CSS, JS, images, ...), and uses very little memory to do so.
One possible drawback is the lack of .htaccess files support. This means that if the PHP software you're using relies on this type of file and doesn't directly offer Nginx configuration examples, you will have to "translate" the Apache .htaccess file to a format that Nginx understands. In my experience, I had to do it for a couple of Wordpress plugins. Again, it's not too complicated and you can usually find someone who has already done it by googling.
The other thing to keep in mind is that Nginx+PHP-FPM is not some kind of magical panacea. If you have crappy, slow PHP code, this won't fix it. I have limited experience with Magento so I cannot offer you any specific insight. In the case of Wordpress (which I consider extremely bloated), Nginx is indeed a lot faster at serving static content, uses less memory and is a bit faster at serving PHP pages, but it certainly doesn't cut your PHP execution time in half ;)
Nginx vs Lighttpd
Nginx has recently gained a lot of popularity. Its usage has almost doubled in the last year and it's already 16 times more used than Lighttpd based on these statistics.
There doesn't seem to be a huge difference in performance between the two, so I would definitely go with Nginx.
Keep in mind that you will have to use PHP as php-fpm. It's not that difficult to configure, and there are countless, easy tutorials on how to make them work together.
A faster Web server: ripping out Apache for Nginx
Getting started with nginx and php-fpm
nginx + php-fpm + apc = awesome
Edit: Sorry I re-organized my answer, I kind of missed the point of your question at first.

Nginx only or Nginx(reverse proxy) + Apache [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I just rent a VPS, and I want to install nginx as a server, however, most of the article on the internet is use nginx as a reverse proxy, rather than as a server, what benefit with this configuration?
Is it possible to use 2 nginx (1 as reverse proxy another as server)?
another non-related this topic question, I'm now using cpanel, how can I fully stop apache, because the httpd is always restart after sometimes, thanks.
Nginx works great by itself and will likely be much faster than Apache. It also uses far less resources (RAM, CPU). That being said, Apache brings some goods to the table, namely simplified deployment for some scenarios (and 2.4 has compelling caching features).
Nginx vs Apache is a false dichotomy. Nginx makes Apache better. By all means, put Nginx out front, but don't write off Apache entirely if it suits your needs.
What are you going to do with your Nginx? If you just want a web server you can go with only Nginx, that's fine.