Tag Info

Hot answers tagged

12

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 ...


6

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 ...


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

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.


5

Great question! This can actually be done, but it's relatively tricky. Tumblr has made it very clear that they don't want you to do this. They have silently broken CloudFlare integration a while back, where everyone who did this reverse proxy stuff with CloudFlare has basically gotten booted off of their custom domain name without any warning. (Keep in ...


4

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.


4

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 ...


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

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

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 ...


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

I try this and it works for me: Insert the script code below at the end of your HTML code, just before the tag: <script> var _gaq=[['_setAccount','UA-XXXXXXXX-X'],['_trackPageview']]; (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; ...


2

Your first log snippet suggests that the file may actually exist, since nginx response is 200, with 731 bytes of payload data, so, don't be too fast to have it blocked. However, if you want to have such requests omitted from logs, you can use the following in all servers affected: location = /wpad.dat { access_log off; log_not_found off; } Or, ...


2

It is common practice to define a seperate logfile for each vhost. Without knowing your config, I assume, that the main nginx.conf has defined a default log file. It will log any request that is not matching any of the vhosts that might be configured. I assume that sites-enabled/mysite is a vhost that is using name-based virtual host (in Apache speech this ...


2

You need to set an alias. location /coolapp/ { alias /var/www/apps/coolapp/; } Read more nginx Update after comment: Unfortunately, it's not working for me. I'm getting a 404 response when trying to request www.mysite.com/coolapp/test.php when /var/www/apps/coolapp/test.php exists To understand why alias is not working, you have to take a ...


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

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

I think you're missing a slash in your proxy_pass, see http://nginx.org/r/proxy_pass. It should be proxy_pass http://backend/;, if you want to map /api locationfrom Nginx to / from upstream, otherwise, it'll be going to /api on upstream, too.


1

Wordpress solution (not the best but helps) Same problem with Biadu spider, that aggressive that my box ranked over 35 in my console using top. Obviously that even a fast computer cannot handle effectively outside requests running at 35.... I traced the number of IP's (from that University building ????) to be several hundreds, with mainly two useragents) ...


1

You can use the following directive in robots.txt to disallow the crawling of your site. # robots.txt User-agent: Baiduspider Disallow: / However, crawlers may decide to ignore the content of your robots.txt. Moreover, the file can be cached by search engines and it takes time before changes are reflected. The most effective approach is to use your ...


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

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 ...



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