To allow UptimeMonster IP addresses (2a01:4f8:c012:9c4a::1
IPv6 and 162.55.41.109
IPv4) in Apache, you will need to modify your Apache configuration file. Here’s how you can do it:
Open your Apache configuration file using a text editor. The main configuration file is typically located at /etc/apache2/apache2.conf
or /etc/httpd/httpd.conf
. Alternatively, you might need to edit a specific virtual host configuration file under /etc/apache2/sites-available/
or /etc/httpd/conf.d/
.
sudo nano /etc/apache2/apache2.conf
Or, for a specific virtual host configuration file:
sudo nano /etc/apache2/sites-available/your-site.conf
Inside the appropriate <Directory>
, <Location>
, or <VirtualHost>
block in your Apache configuration file, add the Allow
directives for the specified IPv6 and IPv4 addresses.
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
# Allow specific IPv6 address
Allow from 2a01:4f8:c012:9c4a::1
# Allow specific IPv4 address
Allow from 162.55.41.109
</Directory>
After adding the Allow
directives for the IP addresses, save the changes and close the editor. In nano
, press CTRL + X
, then Y
to confirm, and Enter
to save.
It’s important to check the syntax of your Apache configuration files to ensure there are no errors:
sudo apachectl configtest
If the test is successful, you should see Syntax OK
.
Finally, restart Apache to apply the new configuration:
sudo systemctl restart apache2
Or, for older systems using init.d
:
sudo service apache2 restart