• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Fresh install: mod_remoteip not working

manipogo

New Pleskian
Server operating system version
RockyLinux 8
Plesk version and microupdate number
18.0.50 Update #2
According to the docs, the remoteip module is shipped with plesk, but I cannot find it in the module list under Apache Web Server Settings.

When I try to use the CLI to enable it (plesk sbin httpd_modules_ctl –enable remoteip) it seems to work, but still does not show on the list and is not working. Any ideas on this? My old server uses mod_cloudflare and I never had issues.

Thanks
 
Please verify that the module is loaded by
as root apachectl -M | grep remoteip
It should return
remoteip_module (shared)

Plesk loads this module by default and hides it from the settings section. I guess this was done, because everyone needs it in the proxy mode constellation, but I did not find an official reason why it was done that way.
 
Yes, the module is loaded. But the logs are all Cloudflare ips. Does remoteip need to be seperately configured?
 
Thanks for the info on this one guys, particularly useful for servers running forum software...Such a fresh thread date too, I got in early :cool:

@danami Do we know if the CentOS/RHEL packages are available for mod_cloudflare?

Edit: They are !

RHEL Generic​

# Add cloudflared.repo to /etc/yum.repos.d/
curl -fsSl https://pkg.cloudflare.com/cloudflared-ascii.repo | sudo tee /etc/yum.repos.d/cloudflared.repo

#update repo
sudo yum update

# install cloudflared
sudo yum install cloudflared

Centos 7​

# This requires yum config-manager
sudo yum install yum-utils

# Add cloudflared.repo to config-manager
sudo yum-config-manager --add-repo https://pkg.cloudflare.com/cloudflared-ascii.repo

# install cloudflared
yum install cloudflared

Centos 8​

# This requires dnf config-manager
# Add cloudflared.repo to config-manager
sudo dnf config-manager --add-repo https://pkg.cloudflare.com/cloudflared-ascii.repo

# install cloudflared
sudo dnf install cloudflared

Centos Stream​

# This requires dnf config-manager
# Add cloudflared.repo to config-manager
sudo dnf config-manager --add-repo https://pkg.cloudflare.com/cloudflared-ascii.repo

# install cloudflared
sudo dnf install cloudflared
 
Just wanted to drop in, and post a "same boat" for being spoiled with mod_cloudflare.

Thanks Peter and others.
 
Aaand I'm back, because I ran into a few things, and this may be helpful for others.

My original issue was twofold, this came to light when I enabled the FULL (strict) SSL implementation from Cloudflare, with "Authenticated Origin Pulls". When I added that SSL cert and hit my Plesk panel by name, the login prompt started reporting:

"Access for administrator from address '162.158.155.70' is restricted in accordance with IP Access restriction policy currently applied."​

I'd started manually adding those IP's in, as I knew they were from Cloudflare, and figured my connection was being proxied. I realized that's a bad way to do it, something else must be wrong (I had it working on an older Plesk build from a year ago without them), that's what lead me here.
  1. The reason Plesk probably no longer includes Cloudflare, is because "Cloudflare no longer updates and supports mod_cloudflare." - Reference Link
    1. They recommend moving to mod_remoteip
  2. I tried the Plesk guide from Peter, however, on the step "Server-wide solution with Nginx enabled", I ran the /root/cf.sh, and received: "/root/cf.sh: line 1: syntax error near unexpected token `newline' . /root/cf.sh: line 1: `<!DOCTYPE html>'"
    1. I don't know if this bash scripting needs some extra "" or what, but I moved on again.
  3. I did "yum install mod_cloudflare" on my new AlmaLinux 8, (as mentioned above, thanks danami), and that did resolve it for now.
I'm still experiencing an issue with 401 Unauthorized "strict-origin-when-cross-origin" on a WooCommerce AJAX plugin (maybe unrelated).
 
Back
Top