Tag Info

Hot answers tagged

17

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


7

You need to drop the 'http:' prefix from all image (and any other) links on your site. When you do so, your browser will default to whatever protocol the page loads with. For example this is best: <a href="//www.example.com/"> And this is not: <a href="http://www.example.com/"> The top example is perfectly valid markup and you will load all ...


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

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

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

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

In your robots.txt add #Baiduspider User-agent: Baiduspider Disallow: / #Yandex User-agent: Yandex Disallow: /


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


4

The main reason is: HTTP requests include the domain name. You could have stackoverflow.com and askubuntu.com all served off the same front end machine. When the server gets a request it needs to know what content it has to send. That's the main reason server configuration speaks about host name at all. Why do you have to set it if you're only serving one ...


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

Wordpress MU might be overkill for just three blogs, but it will let you run everything against just one database and just one Wordpress install.


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


3

Apache can be a bit heavy, and can fall over when under heavy load. There are lighter weight servers available, including nginx, lighttpd, and cherokee. These lightweight options can be set up to serve static files quickly, and delegate dynamic server-side work to Apache.


3

Those are the backend servers that will handle the incoming request. So your domain's DNS should point to this nginx server, which will then use your upstream configuration to pass the request to one of the specified servers. Your config should look something like this (inside http {} block)... upstream backend { server backend1.example.com; server ...


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

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

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


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

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


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

A content delivery network works as a proxy server. You would have to have a canonical source for your media. The CDN servers would then contact the central canonical source for the file the first time that it is requested. After that, they would serve the cached copy that they had retrieved the first time. Different CDNs use different schemes for the ...


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


2

This should do the trick: rewrite ^/$ http://www.mydomain.com/page permanent; If this was what you were using and it looped then there must be a redirect rule in place for /page.


2

No, php-fpm user does NOT need execute permissions on PHP files. It only needs read permission, as PHP files are parsed by PHP preprocessor and not executed directly.



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