Tag Archives: apache2.4

PHP7 and APACHE 2.4 Upgrade

A (very) sort guide.

PHP7 upgrade

  1. Download PHP for windows – use the “windows download” link on the official PHP downloads page. (https://www.php.net/downloads.php)
  2. Select version to download.
    We will download the version for APACHE server. It comments that for APACHE web server you need to download the ThreadSafe (TS) version of PHP.
  3. Select which TS version you like to download.
    These are the x32 and x64.
  4. Select which VC version you like to download.
    VC15 or VC16 ? (Visual Studio 2017 or 2019 compiler respectively)
    – The VC15 and VS16 builds require to have the Visual C++ Redistributable for Visual Studio 2015-2019 x64 or x86 installed.
  5. Rename the folder of the existing php installation (e.g. from PHP7 to PHP7_old). Keep this folder until the new installation works properly.
  6. Extract the downloaded zip file and rename the folder to the existing php folderinstallation. (e.g. PHP7).
  7. Use the compare plugin of notepad++ to compare the old and the new php.ini files. Make the appropriate changes on the new ini file. Do not forget to create all needed folders.
  8. Delete the PHP7_old folder if everything works properly.

APACHE2.4 upgrade

  1. Download APACHE for windows – use the “files for windows” link on the official APACHE downloads page. (https://httpd.apache.org/download.cgi )
  2. Use the Apache Lounge link.
  3. Download the appropriate zip file for your system e.g. Apache 2.4.xx Win64.
  4. You should have VC16 already installed. If not, there are links on this page above the binaries. It comments “Be sure you installed latest…”.
  5. Rename the folder of the existing apache installation (e.g. from APACHE24 to APACHE24_old). Keep this folder until the new installation works properly.
  6. Extract the zip file and rename the folder e.g. APACHE24.
  7. Use the compare plugin of notepad++ to compare the old and the new httpd.conf files. Make the appropriate changes on the new conf file. Do not forget to create all needed folders.
  8. Delete the APACHE24_old folder if everything works properly.

Best regards
Pavlos

Create SSL Certificate for website in Apache 2.4 and Windows Server

You should follow the steps below to create an ssl certificate of Apache2.4 in Windows Server environment.

Creating the OpenSSL command
The easiest way is to use the website of digicert to get the openssl command that generates the CSR file.

Digicert OpenSSL CSR Wizard: https://www.digicert.com/easy-csr/openssl.htm

An example of the wizard can be seen below.

Digicert OpenSSL CSR Wizard

The command text of the example is the following.
openssl req -new -newkey rsa:2048 -nodes -out www_test_gr.csr -keyout www_test_gr.key -subj “/C=GR/ST=Macedonia/L=Thessaloniki/O=Test GR/OU=Sub Test/CN=www.test.gr”
You may modify the above command to get the OpenSSL command without the use of the wizard.

Get the CSR and KEY files
Open a command line and navigate to the bin folder of the Apache installation. It is where the openssl.exe file resides.

You should copy the above command (“openssl”) and paste it into the command line window. You should get two files, the CSR and the KEY files.

Get the Certificate
Use the CSR content to create the CER or CRT file from your Certificate provider.

Add the Certificate into the httpd.conf file of Apache
Open the httpd.conf file and add the following virtualhost

VirtualHost SSL

ServerName www.test.gr
ServerAlias test.gr
SSLEngine on
SSLCertificateFile “C:/Apache24/FolderOfSSLfile/test_gr_cert.cer”
SSLCertificateKeyFile “C:/Apache24/FolderOfSSLfile/test_gr.key”
SSLCertificateChainFile “C:/Apache24/FolderOfSSLfile/test_gr.csr”

Do not forget to redirect the insecure site to the secure one.

VirtualHost – Redirection

ServerName www.test.gr
ServerAlias test.gr *.test.gr
Redirect “/” “https://www.test.gr/”

(the virtual host redirection should be above the virstual host SSL)

Best regards
Pavlos