Pagespeed isn’t enabled by default, that requires additional setup which isn’t a part of the script just yet (mainly as not all options work equally for everyone).
The module is active if you wish to configure Pagespeed, but without those specific settings, it does nothing.
As for the error, it may be permissions related or it could be that the GD or Imagick PHP package is not installed. When working with PHP-FPM, all directories and files need to be owned by the user + group defined in the pool configuration file.
For example, if you’re running PHP 7.1, that should be here:
If you’ve setup a custom pool file, then you’d need to check that specific file. By default, the above is setup to use
www-data as the user and group, so that’s the user and group that needs to own the files and directories you’ve serving content from.
Since you’re using the default directory in the examples, that means you need to
chown all files and directories from:
… down, to
www-data or the user in your pool configuration. We can do that by:
chown -R www-data:www-data /home/nginx/htdocs/public
Any file or directory created by your PHP script should
chown to that user and group automatically, but if you add any files or create directories from the CLI, you’ll need to make sure they are owned by that user and group, otherwise PHP/PHP-FPM can’t read/write since they would effectively be owned by
root or another user.
That being said, the
/home/nginx directory is actually meant for the default configuration and the host as it’s setup to be owned by the
nginx user, not for sites you create, so if you’re going to use that directory, I would:
1). Set ownership of
/home/nginx back to
root as it should be using:
chown root:root /home/nginx
2). Set ownership of
chown -R www-data:www-data /home/nginx/htdocs
The auto-installer is meant as a starting point. Ideally, you should create individual directories for each site, such as:
Each site would have it’s own pool file and user, so you’d copy:
to something such as:
And modify each of those to use a non-root, non-sudo user.
For example, if I wanted to create a new user, I’d do something like this:
mkdir -p /home/mynewuser/htdocs/public
useradd -d /home/mynewuser mynewuser
cp /etc/php/7.1/fpm/pool.d/www.conf /etc/php/7.1/fpm/pool.d/mynewuser.conf
[mynewuser] and then replace
mynewuser. I would then change the
listen directive to create a new socket or use TCP and a port. Once the changes are made, restart PHP-FPM.
chown -R mynewuser:mynewuser /home/mynewuser/*
I would then change the socket in my NGINX server block to match the one I just set in the pool configuration file. This way each user has a socket.
My goal is to add some additional features and ways to do this to the script in the future, though for the time being, much of it still needs to be done by hand.