Note:
The error configure: error: pcre(2)-config for libpcre not found. PCRE is required and available from http://pcre.org/ indicates that the PCRE (Perl Compatible Regular Expressions) library is missing on your system. This library is required to compile the Apache HTTP Server.
Steps to Resolve:
Install the PCRE development package:
- On Ubuntu/Debian, run:
sudo apt update sudo apt install libpcre3-dev
- On Ubuntu/Debian, run:
Optional Dependencies:
- If you also want HTTP/2 and SSL support, install additional dependencies:
sudo apt install build-essential libpcre3-dev libssl-dev zlib1g-dev
- If you also want HTTP/2 and SSL support, install additional dependencies:
Reconfigure and Compile:
- After installing the required dependencies, rerun the
./configurecommand with the desired flags. For example:./configure --enable-proxy --enable-proxy-http --enable-ssl --enable-rewrite
- After installing the required dependencies, rerun the
This should resolve the issue and allow you to proceed with the compilation of Apache HTTP Server.
Resolving the ServerName Warning in Apache
The warning AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message occurs when Apache cannot determine the server's fully qualified domain name (FQDN) and defaults to 127.0.1.1.
Steps to Resolve:
- Edit Apache's Configuration File:
- Open the Apache configuration file. Depending on your setup, it could be:
/etc/apache2/apache2.conf(Ubuntu/Debian)/local/apache2/conf/httpd.conf(custom installations)
- Use a text editor to open the file. For example:
sudo nano /etc/apache2/apache2.conf
- Add the
ServerNameDirective:
- At the end of the configuration file, add the following line:
ServerName localhost - If you have a specific domain name, replace
localhostwith your FQDN (Fully Qualified Domain Name).
- Save and Exit:
- Press
Ctrl + X, thenY, and finallyEnterto save and exit the editor.
- Restart Apache:
- Apply the changes by restarting Apache:
sudo systemctl restart apache2 - If you're using a custom installation, restart Apache with:
./apachectl -k restart
This should resolve the warning and ensure Apache uses the specified ServerName.
Written by A.M. Rinas