Redirect, Change URLs or Redirect HTTP to HTTPS in Apache – Everything You Ever Wanted to Know About mod_rewrite Rules but Were Afraid to Ask

mod_rewrite syntax order mod_rewrite has some specific ordering rules that affect processing. Before anything gets done, the RewriteEngine On directive needs to be given as this turns on mod_rewrite processing. This should be before any other rewrite directives. RewriteCond preceding RewriteRule makes that ONE rule subject to the conditional. Any following RewriteRules will be processed … Read more

How to set environment variable in systemd service?

Times change and so do best practices. The current best way to do this is to run systemctl edit myservice, which will create an override file for you or let you edit an existing one. In normal installations this will create a directory /etc/systemd/system/myservice.service.d, and inside that directory create a file whose name ends in … Read more

100% uptime for a web application

Here is Wikipedia‘s handy chart of the pursuit of nines: Interestingly, only 3 of the top 20 websites were able to achieve the mythical 5 nines or 99.999% uptime in 2007. They were Yahoo, AOL, and Comcast. In the first 4 months of 2008, some of the most popular social networks, didn’t even come close … Read more

How do I deal with a compromised server?

It’s hard to give specific advice from what you’ve posted here but I do have some generic advice based on a post I wrote ages ago back when I could still be bothered to blog. Don’t Panic First things first, there are no “quick fixes” other than restoring your system from a backup taken prior … Read more

Ping a Specific Port

You can’t ping ports, as Ping is using ICMP which is an internet layer protocol that doesn’t have ports. Ports belong to the transport layer protocols like TCP and UDP. However, you could use nmap to see whether ports are open or not nmap -p 80 example.com Edit: As flokra mentioned, nmap is more than … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)