Apache Archives

How to host multiple websites with Apache

The Apache web server has a convenient feature called Name-based Virtual Hosting. This function allows us to have a single LAMP Stack server configured on one IP address, but serve a different set of files depending on which domain is being requested.

This sounds more complicated than it is. Say we had example1.com and example2.com, both of which are to be separate websites, but both domains point to the same IP address. Apache’s Name-based Virtual hosting makes this possible. In fact, this feature forms the basis of 90% of this planet’s shared hosting business.

Let’s see how to do this in CentOS 6 and 7.

Read more

How to check which web server is running on a domain

Sometimes we must know what web server is running on a particular domain. Usually web hosts should be able to tell a client this, but if the client is afraid to ask, there is a way to ask the web server directly for this information.

Just to clarify: the web server is the process that serves files (HTML, PHP, ASP, images, etc) from a remote machine to your local web browser. The most likely choices in this day and age (2017) are Apache, NGINX or IIS. The latter is used by Windows servers, and the two former are used by Linux servers. There are other web servers too, such as lighttpd, but they’re used less commonly.

By asking the web server for this information, we can tell exactly who’s serving those files.

How to ask the Web Server

Let’s open a Terminal or Command Line Prompt window and utilise the good old fashioned Telnet protocol. Replace yourserver.com with the actual domain in question:

Read more

How to block Spam Trackbacks in WordPress

Trackbacks are a great way for other blogs to notify your blog about a link back to you. Many blogging platforms support this feature, including WordPress. But sometimes it’s very obvious that those trackbacks aren’t coming from a legitimate source, especially when you get several dozen of them every day from the same source. No … Read more

How to install Apache mod_pagespeed on CentOS with Plesk

Apache-LogoI bumped into Kristian Markroft from Simplyroot in New Orleans last week, and he told me about an interesting speed-up module for the Apache Webserver.

mod_pagespeed is an open source project which speeds up page loads without having to change the code of the actual page. mod_pagespeed does this by adding filters before pages are served. For example it will resize images and minify CSS/JS files, which can speed up page load considerably. The project is hosted on Google Code:

Let’s see how we can install it on CentOS, test to see if it works and how to manage it in Plesk.

Read more

FIXED: The Problem with running PHP as FastCGI Application (WordPress and Plesk)

We’re currently on our way to Kissimmee, FL to join Parallels Summmit, an annual conference from the people who make Plesk. We’re also taking exams in Plesk 10.4.4 so we’re studying it in-depth – I’ve been using the software for over two years now but never had formal training in it. Well here goes!

In preparation for the exam tomorrow I’ve come across something the instructor mentioned: namely the benefits of running PHP as a FastCGI application instead of an Apache module. Sadly I’ve also come across some drawbacks when using this option in regards to WordPress. I thought I’d mention those here, alongside how to avoid those.

UPDATE: Thanks to Boldock this problem can be fixed 😉

Read more