Tag Info

Hot answers tagged

6

Yes. One of the web servers used to have a large spike in load every few hours. After looking into the logs, I found out when the load spike happened, there where a lot of people looking at the gallery. So I off-loaded 99% of the static content from apache to nginx. apache was left to serve all of the php. The load on my web servers dropped to a nice low ...


5

The 301 redirect that you are doing is the correct way to recover. The canonical tag that you are considering and 301 redirects can't be used at the same time. The canonical tag is only for pages that can't be redirected. Recovery should be in a week to a month. If it is longer than that, it is likely that something else has happened.


5

Nginx uses the try_files directive to 'see if something exists and fallback to another option' instead of using if statements and rewrites. Within your server block, create a location block that will match your files (e.g. files ending in jpg, gif, png - add whatever extensions you want). Within that block, you will add your try_files directive. Nginx will ...


5

It's a regexp metacharacter that matches the beginning of a string. Since all strings have a beginning, this regexp matches any string. This is a typical nginx idiom for "redirect any URL to http://test.com/". The $ metacharacter matching the end of a string would work as well, but ^ seems to be what everybody uses.


4

As suggested, I asked the question on ServerFault: http://serverfault.com/questions/161768/restart-webserver-without-entering-a-password But the short answer is: Backup your key: > cp server.key server.key.org Strip out the password: > openssl rsa -in server.key.org -out server.key [enter the passphrase] The newly created server.key file has ...


3

Yes, you can run vBulletin with nginx. The rewrite rules you need will be specific to your setup and any modules you are using (you do not need any rewrite rules to run a standard vBulletin installation unless you use SEO Friendly URLs - see this vBulletin forum post). Many popular mods have already had their rules translated, (e.g. vbSEO) however, you can ...


3

Someone was Fuzzing your server. Also see Wikipedia. Basically involves sending rapid blocks of invalid data to see if anything breaks. Nginx is set to return a 400 error error when no request data is sent. Don't worry about it. Nginx can just keep on bouncing them forever without breaking a sweat.


3

I'd recommend not just looking at the type of web-server, but instead primarily focusing on the kind of website that you're running. Keep in mind that a Sitemap file is basically just a list of the valid URLs on your website. There are many ways that you could come up with a list like that (and with the associated meta-data, if you wish to provide it). In ...


3

Tuning a vserver takes a lot of time. Most of the time, you are playing the try & error game. And sometimes, the results are not very satisfying... But: To tune mysql, run the tuning-primer against the mysql instance you are trying to optimize: http://www.day32.com/MySQL/tuning-primer.sh This script tells you which parameters should be changed. If I ...


2

A. Apache is a memory hog. You would get a huge performance boost if you switched to nginx with PHP via fastcgi. B. If MySQL is really your biggest problem (doubt it), you can disable InnoDB if you don't actually need InnoDB support for something else. Edit /etc/mysql/my.cnf and add a line saying "skip-innodb", then run "/etc/init.d/mysql restart". That ...


2

I've worked some pretty large sites (1bn pv/day on the largest), approx 1-2% of their traffic was random exploit probing/spiders/crawlers. Classic path manipulation stuff like ..\..\..\cmd etc. More sophisticated buffer-overruns in POST and/or GET looked similar to those in your logs Plain screwed-up home-rolled crawlers that mis-encoded or omitted key ...


2

I've been using Apache for the last several years, because it is easy to use and configure, runs smoothly over vast networks, and has many available modules to perform various tasks. Apache is process-based, and nginx is event-based. This means, it doesn't need to create a new thread for each thing it has to process. Keeping it short, I think you're best ...


2

See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3: The max-age directive on a response implies that the response is cacheable (i.e., "public") unless some other, more restrictive cache directive is also present. It's conceivable (likely?) that there are proxies in the wild which break this but since the only failure mode could be ...


2

I used lighttpd for a year and love the simplicity of the configuration files. It runs very light and does not require a separate service (php-fpm) like nginx. However due to my curiosity I have recently changed to nginx and the config syntax is much like perl. It is scary at first coming from lighttpd, but if you take a deep breath and give it a shot ...


2

The speed at which webservers deliver pages usually depends on how quickly they can pull the data together from where it is stored. Here are the places that data for a website is usually stored from fastest to slowest. In memory On disk In a network cache In a database So even when you are talking about static files on disk, it would be faster to have ...


1

It depends on your definition of fastest. If you measure the time it takes for one page to completely render, then, yes, static HTML with embedded resources would be the fastest when fully optimized: Deliver with compression (Gzip/Deflate). Minimize code, avoid white-space, use the minimum tags and properties needed. Spread resources across cookie-less ...


1

Assuming this is in the .htaccess in your document root, then you are almost there. You just seem to be missing the / (slash - directory separator) from the front of your destination URL (in the first example). RewriteEngine On RewriteRule ^somepage$ /abc/somepage.php [R=301,L] The slash (or whatever is the base URL) is automatically removed from the ...


1

If you server is running Nginx+Passeneger , you can start your Ruby application in the following way: cd /home/user/rails_apps/user; sudo -u user /usr/local/bin/ruby /usr/local/bin/passenger start -p 12045 -e production & sudo -u user /usr/local/bin/ruby /usr/local/bin/passenger start -p 12421 -e production & - the command for running is screen ...


1

You can block by IP address using the ngx_http_access_module of nginx. To block a single IP you can add a line to the conf file like deny 12.34.567.1; To block a range, use CIDR notation, like 12.34.567.1/24 for the 24-bit subnet block (of 256 IP addresses) which includes the 12.34.567.1 IP address. For more details see, for instance, this page.


1

I just started using Nginx and consider it easier to set up than apache. I'm with you, pretty inexperienced with setting up web servers, but have done a few for my own business. Fire up an Amazon EC2 instance and try it out for yourself. Google got me the answers I needed pretty quickly. It was far easier to set up virtual hosting in nginx than Apache, ...


1

Pingdom rates your site 77/100 (which is good), so, with the report of malware above I'm wondering if the problem might be local antivirus or anti-malware software blocking an attack - Microsoft security essentials often appears especially slow. It could also be a slow pickup on the database connection, which is common on shared hosting for wordpress. ...


1

phpFox has its own caching system that... You can disable the caching in phpFox by using the following code in your template files: <?php define('PHPFOX_NO_TEMPLATE_CACHE', true); define('PHPFOX_NO_CSS_CACHE', true); define('PHPFOX_LIVE_TEMPLATES', true); define('PHPFOX_CACHE_SKIP_DB_STORE', true); ?> You can also use your own caching on top using ...


1

I think your settings are incorrect. When there is a request to https://example.net/images/blank.gif it is sent to http://192.168.1.2/images/blank.gif and there will be a 404. Your two rewrites do not match, of course, because this request does not begin with /hp. Maybe you want proxy_pass http://192.168.1.2/hp?


1

I would suggest splitting your batch task into smaller ones (like 10 seconds each) and use AJAX to refresh the page and show progress. Waiting 60 seconds for a reply is long, very long. The longer your operation the more chances of failures you have. By splitting into smaller batches, if one crash, you only loose a fraction.


1

Hello Caio Tarifa, The following solutions works on my nginx dev server on Windows. In nginx.conf, add the following to your main server instance. location ~ \.jpg$ { root html; // edit if you use a different path to your server root. index index.html index.htm; // edit if you use other file types } If this solution doesn’t work for your ...


1

It is traditionally done by disallowing access or redirecting when the referrer is from another domain. There are a number of ways to accomplish this, including using .htaccess files to redirect based on referrer. For nginx, NginxHttpRewriteModule


1

Yes, this is a common thing to do. If the pass phrase would be stored on disk, an attacker could take over the certificate. Off course you could remove the pass phrase from the certificate, but I would not recommend that! Also other technical solutions exists with external peripherals.


1

There are a PILE of webservers out there. I expect depends on the usage you want. Apache will do most of what people want, it's known good, well updated, and will run on nearly any hardware and operating system combination. For a comparison of web servers, check Comparison of web server software.



Only top voted, non community-wiki answers of a minimum length are eligible