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.
Related
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
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am trying to create an ACL (Access Control List) to block or allow mallicious webtraffic in the web application.
Is there a way to dynamically update the ACL (of a router, firewall, IIS, Apache webserver or Windows server) through a web application programming language like ASP.NET, PHP or any web application programming language at all?
I want to be able to dynamically make a deciscion to block ip address via the web application.
If you use older versions of IIS, you can give this a shot.
If you are on IIS 7, you should try to make use of the Dynamic IP Restrictions (DIPR) module for IIS 7.0. It provides protection against DoS and brute force attacks. DIPR automatically tracks the IPs and you don't have to do that yourself. Check this out.
If you still want to take matters into your own hand, you can look at using the IP restrictions feature settings. This basically changes the section system.webServer/security/ipSecurity in the ApplicationHost.config file, which you can programmatically do. Take a look at this. I have not tried this. So, cannot tell you this will work for sure but it is worth giving a shot at. You can always test and see if it works.
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 10 years ago.
Improve this question
Apache noob here. I have a virtualbox instance with debian squeeze installed and apache. I'm seeing all 4 of my cores max out for about 10 minuets then it goes away. This is happening a few times per week. When I'm able to load top I can see apache processes maxed out.
/usr/sbin/apache2 -k start
When I check the access log I'm not seeing a huge amount of traffic. I installed mod_evasive last week thinking they might have been a ddos or bot hammering on login pages but I can't see that in the logs. I'm suspecting there might be some bad php code somewhere. How would I go about tracing where that might be?
The web server is hosting about 4 wordpress sites for a small business and another php application with about 10 users.
I've ensured i've updated debian. I'm running on the latest wordpress.
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.
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.