Recently we migrated a couple of old servers to a new one. We used to have many old ones for requirements of customers. Since the have switched to new software, we we able to finally upgrade to new hardware. This introduced a new version of Plesk.
Plesk is an easy way of hosting websites without having to do much manually. I know this is something that „real“ admins will hate me for but hey, it’s easy and it works. As I don’t like changes too much, I didn’t like the new Plesk at all. I got used to it by now.
Accidentally I noticed some new header in the server responses which I didn’t like. On each request Plesk automatically added a new header to the response.
This is quite annoying in my opinion. I had to find out how to remove it.
Now, as this server is running an apache, I needed to check the config file first. This is usually located at /etc/httpd/conf/httpd.conf. Checking this file you will notice that Apache and Plesk uses a whole directory for storing configuration. In my case this is /etc/httpd/conf.d. All of the files in there will be processed in alphabetical order!
You might think about just editing the standard Plesk config files. This isn’t a good idea. There is a big chance of breaking your installation of Plesk or Apache if you’re not sure what you’re doing. The other problem is Plesk overwriting and generating the conf files automatically. So you need to stay out of reach of Plesk. The easiest way is to remember how Apache processes the config files. Just add one at the end of the list. Have it start with something like „zzzzz“. This will make it be the last file to be processed. In my case I added a new conf file like this
[limited@server4 conf.d]# ls -la drwxr-xr-x 2 root root 4096 Nov 18 22:30 . drwxr-xr-x 4 root root 4096 Aug 22 08:56 .. -rw-r--r-- 1 root root 660 Nov 18 21:31 fcgid.conf -rw-r--r-- 1 root mailman 688 Mar 30 2011 mailman.conf -rw-r--r-- 1 root root 1796 Apr 22 2005 perl.conf -rw-r--r-- 1 root root 93 Nov 1 09:28 php_cgi.conf -rw-r--r-- 1 root root 674 Mar 30 2011 php.conf -rw-r--r-- 1 root root 566 Sep 21 10:14 proxy_ajp.conf -rw-r--r-- 1 root root 1671 Jan 6 2007 python.conf -rw-r--r-- 1 root root 392 Sep 21 10:14 README -rw-r--r-- 1 root root 9677 Nov 18 21:36 ssl.conf -rw-r--r-- 1 root root 352 Jan 9 2007 webalizer.conf -rw-r--r-- 1 root root 299 Sep 21 10:14 welcome.conf -rw-r----- 1 root apache 372 Nov 18 21:40 zz010_psa_httpd.conf -rw-r--r-- 1 root root 109 Nov 18 22:30 zzzzzDia24.conf
This way we can do whatever we want and leave Plesk alone. The best thing about it is to have Plesk leave us alone as well. We can now unset the header entry. Also we can add our own header if we like. This is what I did for displaying my own header. The following lines are the content of my zzzzzDia24.conf
<IfModule mod_headers.c> Header unset X-Powered-By Header add X-Powered-By "www.dia24.de" </IfModule>
As this is the last config file to be processed, this will override everything that Plesk thinks is the „right thing“. This is what it looks like afterwards:
Now me and Plesk are happy 😉