Hot answers tagged

12

Easy. Just set something like this within your main configuration or your virtual configuration: <Directory /var/www/path/to/your/web/documents> Order Deny,Allow Deny from all Allow from 127.0.0.1 ::1 Allow from localhost Allow from 192.168 Allow from 10 Satisfy Any </Directory> The <Directory></Directory> statement ...


12

People landing in this answer, please note that this is specific for Apache 2.2. Apache 2.4 has deprecated these directives. The new way is using the module mod_authz_host and the Require directives. (link) In Apache 2.4 you should do <Directory /var/www/ncp-web/> Require host localhost Require ip 127.0.0.1 Require ip 192.168 Require ip 10 &...


10

You can't stop a site linking to you with technical measures, but you can identify requests which have come from that site/url and block these in .htaccess - RewriteEngine on RewriteCond%{HTTP_REFERER} ^http://www\.site\.com [NC] RewriteRule index.html http://www.go-away.com/goaway.html [R] The above rules will probably need some tweeking, but the idea ...


9

Just as a matter of explanation for future users. Your 000-default.conf file is a catch-all site and should be left alone. It is good for security. It can be frustrating when a site configuration does not work and the default site is served. I get it. Still, leave it alone. Many people are unaware of why the default site exists. Here is a bit of an ...


6

Based on your reference to the ImageMagick convert method and quality parameter, it appears you're working with JPEG images. If that's the case, the EXIF information for JPEG images does not have a standard compression level tag. However, ImageMagick appears to be able to obtain this information from the image's quantization tables using the identify ...


6

You are probably seeing a difference in line-endings. When transferring a file in ASCII/Text mode (as opposed to "Binary mode") then most FTP clients will convert/normalise line-endings to the OS being transferred to. On Classic Mac OS (9.x and earlier) the line-ending char is simply \r (ASCII 13), on Mac OS X this changed to \n (ASCII 10), on Linux it is \...


5

Use the Google Webmaster Tools and turn down the Google Crawl Frequency. Sign in to Webmaster Tools > Configuration > Crawl Rate


5

First of all: you are basically doing a lot of things very good at the moment. This results in good grades in PageSpeed for example. Also keep in mind that the biggest part of the waiting time is spent on the frontend, so it makes sense to optimize this before going deep into server configuration. These are some ideas: there are a lot of image requests, ...


5

It could be done with a single SSL certificate. Specifically, what you want to do is to provide 'Subject Alt Names' in the certificate. Take a look at Google's certificate for example, which has the following Subject Alt Names. In other words, they have one certificate for all of those domains. DNS Name: *.google.com DNS Name: *.android.com DNS ...


5

Add this section inside your virtual host directive: <Location /mypathurl> Order deny,allow Deny from all Allow from 192.168.1.10 </Location> Replace your IP above. This should not be used for financial level security, FYI.


5

Without the spike making 95th percentile 129 Mb, it looks like it would have been around 70 Mb - an 85% increase. That's significant, but the traffic alone isn't enough to determine the cause. You will need to bring the server back up (offline, if possible) and examine the log files to tell if it was a DDoS, as there could be other explanations depending on ...


5

Well aren't you friendly... "Hey Google, I'm having a DOS, but im making it your problem, thanks" First: There is no difference for you between serving an 301 or an 404 error page. Your server will have to do the same amount of work. The difference here is that you, with your 301->google solution, now ALSO make it Google's problem, effectively doubling ...


4

You may want to check out Apache Top. Or you can write your own script from the command line that just check the number of current connections on the port Apache is running on (usually 80), for example: netstat -plan | grep :80 Or, if you just want the number: netstat -plan | grep :80 | wc -l This could ideally be done through a cron (e.g., run every ...


4

The big CDN networks do various routing tricks to try to ensure the user communicates with their closest proxy. This is normally not visible to you, so as long as you let the CDN manage the advertised DNS addresses, and let the CDN do its job, it should be doing the best it can.


4

Seems to be related to the dompdf library. Since you seem unaware it's even on your site, it's probably being used as a library by some utility or plugin for a CMS, for example. Does your site offer a feature to download a given page as a PDF? That would be the first place to look.


4

Maybe one of these is of use for you: opauth to interface with authentication providers or uLogin for adding secure login and authentication capabilities. You would be able to develop the specifics on your own (remember me ...) but make a great use of proven basics.


4

It looks like you have a significant performance problem. Somehow I doubt that you want bots to not index your content, so I'm just not going to go there... Absolutely the first thing you should do is set up caching. W3 Total Cache is a good start. I used to use WP Super Cache, but the former has many more options for setting up caching in various different ...


4

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


4

I think closetnoc's advice is good, and your plan is sound, but in the comments there, you mentioned that you're running on a VPS on linode already. Depending on your time frame, what's preventing you from spinning up another VPS on linode, provisioning it exactly as needed and switching over to it, then shutting down/destroying the old VM? Is it just cost?...


3

The command '/usr/sbin/sendmail anystring' is interpreted as meaning 'take the following input from stdin and email it to the user known as anystring', rather than 'please restart the service known as sendmail'. Are you sure you were using the sendmail daemon (as opposed to, say, postfix)? In either case the /usr/sbin/sendmail wrapper would most likely be ...


3

Containers running on virtualised servers such as OpenVZ or Virtuosso have a shared kernel (and shared memory) with every VPS on that machine. This means that the container time will be the same as the host computer's time, and the only person who can control that is the server administrator. You should still be able to edit the timezone of the VPS, though, ...


3

You may not be hosting malware now but you have relatively recently: http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=goodtherapy.org The script could be randomly injected or perhaps your ISP is cleaning things for you in the background. In any event, your site has been and probably still is compromised and you should be doing a ...


3

You can use wget mirror mode, this way: $ wget -mk http://www.website.com/ you'll get a local mirror of the site in your disk. For archiving format, you can skip it, and it will allow the users to browse directly from the disk, instead of unpacking before, or you can use a war file, as some browsers support browsing from war files. If you are backuping ...


3

You have a shared hosting plan. That means you cannot install software. Your SSH access is primarily meant for managing files remotely. You may be able to run Java or whatnot with your account, but not as a server/service. Generally, the minimum required hosting package for installing your own software is a virtual server (also called virtual machine, ...


3

<!--?php echo "It works!"; ?--> This is what you see when you analyse the element using the browsers Object Inspector ie. the interpreted source. This is not the HTML source as sent from the server (ie. "view source"). Basically, your HTML pages are not being processed by PHP. You probably need to check with your host as to the correct directive to ...


3

You could just include a rule in your index.php to check the current time against the time you want to launch. So if you wanted to launch on 2015-12-01 at 15:00UTC, something like this should work: <?php if(time() < '1448982000'){ header("Location: https://www.example.com/",TRUE,301); exit; }?> Drop that into the very top of index.php and ...


3

If you create a page using Joomla and call it 'sitemap' it should display the content of that created page in the theme framework 'on the fly' for you. Joomla does not create a sitemap.html or sitemap.php file and put it on your server. If you created a sitemap.html file separately on your own that will not display unless you save the file to your server ...


3

Yes. Don't transfer UTF-16 files in ASCII mode; use binary mode to avoid data corruption here. FTP's transformation of \r\n to \n will corrupt the remainder of the file if it happens to contain the single character ഊ or the sequence ㄍਰ or many others of the same class. Please note that this is not an intelligent transformation, and the reverse ...


2

httpd.conf must have already DirectoryIndex for "Main" site AllowOverrride for <Directory /> container must not be None in order htaccess directives to work


2

Easiest way is to set up a cronjob that triggers a php script in php-cli. http://en.wikipedia.org/wiki/Cron http://www.pantz.org/software/cron/croninfo.html


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