Virtualmin update Apache, PHP, MySQL and BIND to latest

Apache
Apache will have to be installed in two ways due to the default settings provided with suexec may not work with our system, if you do not use suexec then you can skip the suexec installation section, suexec needs to be compiled from source so we can specify the settings to work with our system. To begin we need to download the httpd package and 2 dependencies which are apt-util and apt-util-ldap.

The 3 commands above will download the packages which I am going to be using for my system you may need to get different ones depending on your systems architecture or version you want to install or update to.

The following commands will install the packages, if you receive any missing dependency messages you will have to find the required package and install or update if required, if you receive any messages related to a specific version being needed by a package or overwriting files please read the RPM –-nodeps and –-force section at the top of this guide. Now you have updated apache it should all work after a quick restart.

If you require the suexec module for apache then you will need to do the following to check if your suexec module is setup correctly.

This will print the settings suexec is currently using mine looks like this.

The main ones you need to look at are D AP_DOC_ROOT which is the location of your users websites which if your storing your websites in the users home directory or using Virtualmin needs to be set to /home, D AP_HTTPD_USER also needs to be set to the same user your http server is running as and D AP_USERDIR_SUFFIX needs to be the directory the site is stored in.

If any of these settings need adjusting then you will have to do the following if the current settings meet the requirements for your systems suexec should work just fine, to begin we need to download the apache httpd source code (make sure it is the same version as the httpd server we just updated to or installed) which is available at http://httpd.apache.org/.

I will be downloading the httpd-2.2.17.tar.gz file to my server by using the following command.

Once the download is complete we need to untar the file using the following command.

This will now extract the contents into a folder called httpd-2.2.17 which is now where I want to navigate to.

Before compilation of the source we need to make the small adjustments to are suexec source code so that it uses the settings we need to work correctly, the file is located in a folder called support and the file is called suexec.h.

Nano is a text editor and will open the file allowing me to make the modifications, go through the file and adjust the required lines until the file meets the settings required for your system. I will be making the following changes to my file.

Once the changes have been performed we can quit and save the changes by pressing Ctr + X and entering yes when prompted, now we can begin compilation.

If you receive any errors related to not having some software or a suitable compiler you may not have the development tools installed on your system, these can be installed by typing.

It will now list a load of tools which need to be downloaded and installed on my system it says there is a total of 89MB needing downloading but this may differ on your system depending on what you have or haven’t got already installed. Now all that’s left is to copy the new suexec module and replace the old one which is done using the following commands.

Now all whats left is to change the group and owner of the new file to the same as the old file using the following commands.

Change suexec to the same owner and group as suexec.bak. A restart of httpd will finish the process and all should now work.

Leave a Reply

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Next ArticleWhats going on?