Skip to main content

Mirror the GetPageSpeed Repository

GetPageSpeed Ultra includes one internal mirror, anchored to your subscription's public IP, feeding up to 10 servers owned by your organization. This guide sets it up with reposync on RHEL, Rocky, AlmaLinux, CentOS 7 and Amazon Linux.

Do you need a mirror?

Usually not. If your servers can reach the internet, the simplest setup is direct installs plus one license file: generate your token once and save the same /etc/getpagespeed/license.jwt on each server, as described in the license token guide. Servers in different regions or data centres work the same way.

A mirror is the right choice when your servers have no direct internet access, when all package traffic must leave through one egress IP, or when you want to stage updates on your side before they reach production.

1. Prepare the mirror host

The mirror host downloads from extras.getpagespeed.com through the public IP registered on your Ultra subscription. Repository metadata is per operating system release, so run the mirror on the same OS family and major version as the servers it feeds (one mirror host per release if you run several, all behind that IP).

RHEL / Rocky / AlmaLinux 8, 9, 10 and Amazon Linux 2023

sudo dnf -y install https://extras.getpagespeed.com/release-latest.rpm dnf-plugins-core createrepo_c

CentOS 7 / RHEL 7 / Amazon Linux 2

sudo yum -y install https://extras.getpagespeed.com/release-latest.rpm yum-utils createrepo

2. Sync the repositories

Pick the repository IDs your servers use. getpagespeed-extras and getpagespeed-extras-noarch are the base; add channels such as getpagespeed-extras-nginx-mod, getpagespeed-extras-mainline or a PHP channel only if you use them. reposync syncs a channel even when it is disabled on the mirror host.

dnf (EL8+, Amazon Linux 2023)

sudo dnf reposync \
  --repoid=getpagespeed-extras \
  --repoid=getpagespeed-extras-noarch \
  --repoid=getpagespeed-extras-nginx-mod \
  --newest-only --delete \
  -p /srv/mirror/getpagespeed

for repo in /srv/mirror/getpagespeed/*/; do
  sudo createrepo_c --update "$repo"
done

yum (CentOS 7, RHEL 7, Amazon Linux 2)

sudo reposync \
  --repoid=getpagespeed-extras \
  --repoid=getpagespeed-extras-noarch \
  --newest-only --delete \
  -p /srv/mirror/getpagespeed

for repo in /srv/mirror/getpagespeed/*/; do
  sudo createrepo "$repo"
done
Why the createrepo step: --newest-only downloads only the latest build of each package, so the metadata is regenerated to describe exactly the files you mirrored. Drop --newest-only if you want to keep older builds for rollback; the mirror grows accordingly.

Re-run the sync nightly, for example from /etc/cron.d/getpagespeed-mirror:

30 3 * * * root /usr/local/sbin/getpagespeed-mirror-sync >/var/log/getpagespeed-mirror.log 2>&1

where /usr/local/sbin/getpagespeed-mirror-sync holds the two commands above. Security fixes reach your servers only as fast as this job runs.

3. Serve the mirror

Any web server works. Publish the signing keys next to the packages so clients can verify every RPM:

sudo cp /etc/pki/rpm-gpg/RPM-GPG-KEY-GETPAGESPEED* /srv/mirror/getpagespeed/

A minimal NGINX server block:

server {
    listen 80;
    server_name mirror.internal;
    root /srv/mirror;
    autoindex on;
}

Keep the mirror on your internal network only. Your Ultra subscription covers your own organization's servers; a mirror reachable from the internet would redistribute the packages.

4. Point your servers at the mirror

On each internal server, skip the public release package and create /etc/yum.repos.d/getpagespeed-extras.repo. Keeping the original repository IDs means every install guide on this site (including dnf config-manager --enable … steps) works unchanged.

[getpagespeed-extras]
name=GetPageSpeed packages (internal mirror)
baseurl=http://mirror.internal/getpagespeed/getpagespeed-extras/
enabled=1
gpgcheck=1
gpgkey=http://mirror.internal/getpagespeed/RPM-GPG-KEY-GETPAGESPEED
module_hotfixes=1
priority=9

[getpagespeed-extras-noarch]
name=GetPageSpeed noarch packages (internal mirror)
baseurl=http://mirror.internal/getpagespeed/getpagespeed-extras-noarch/
enabled=1
gpgcheck=1
gpgkey=http://mirror.internal/getpagespeed/RPM-GPG-KEY-GETPAGESPEED
module_hotfixes=1
priority=9

[getpagespeed-extras-nginx-mod]
name=GetPageSpeed NGINX-MOD (internal mirror)
baseurl=http://mirror.internal/getpagespeed/getpagespeed-extras-nginx-mod/
enabled=1
gpgcheck=1
gpgkey=http://mirror.internal/getpagespeed/RPM-GPG-KEY-GETPAGESPEED
module_hotfixes=1
priority=8

Then refresh metadata and install as usual:

sudo dnf clean all && sudo dnf makecache
sudo dnf install nginx

5. License the servers behind the mirror

Save the same license file to /etc/getpagespeed/license.jwt on every server that runs GetPageSpeed NGINX or Everpatch PHP, exactly as in the license token guide. Allow those servers outbound HTTPS to www.getpagespeed.com (directly or through your proxy) so the license stays confirmed and you receive our security-update notices.

Fully air-gapped network, or more than 10 servers behind the mirror? Contact us and we will set up the right license for it.