Skip to content

Commit eea6b78

Browse files
authored
Fix php-Imagick install error
Fix certbot at version 3.0 (https://community.letsencrypt.org/t/certbot-3-0-0-release/228294)
1 parent cad215c commit eea6b78

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

AmazonLinux-2-LAMP-server.yaml

+14-16
Original file line numberDiff line numberDiff line change
@@ -1213,15 +1213,6 @@ Resources:
12131213
mode: "000755"
12141214
owner: "ec2-user"
12151215
group: "ec2-user"
1216-
"/home/ec2-user/update-certbot":
1217-
content: |
1218-
#!/bin/bash
1219-
sudo /opt/certbot/bin/pip install --upgrade pip
1220-
sudo /opt/certbot/bin/pip install --upgrade certbot
1221-
sudo /opt/certbot/bin/pip install --upgrade certbot-dns-route53
1222-
mode: "000755"
1223-
owner: "ec2-user"
1224-
group: "ec2-user"
12251216
"/usr/lib/systemd/system/certbot-renew.timer":
12261217
content: |
12271218
[Unit]
@@ -1557,10 +1548,19 @@ Resources:
15571548
15581549
# php-imagick: https://github.com/Imagick/imagick/blob/master/package.xml
15591550
yum install -q -y ImageMagick ImageMagick-devel
1560-
yes 'no' | pecl install -f --configureoptions 'with-imagick="autodetect"' imagick
1551+
# yes 'no' | pecl install -f --configureoptions 'with-imagick="autodetect"' imagick
1552+
pecl download Imagick
1553+
tar -xf imagick*.tgz
1554+
rm -f imagick*.tgz
1555+
cd imagick*
1556+
phpize
1557+
./configure
1558+
make
1559+
make install
15611560
if [ $? -eq 0 ]; then
15621561
echo 'extension=imagick.so' > /etc/php.d/25-imagick.ini
15631562
fi
1563+
cd /tmp/cfn
15641564
15651565
# php-redis: https://github.com/phpredis/phpredis/blob/develop/package.xml
15661566
yum install -q -y redis-devel lz4-devel
@@ -1658,8 +1658,8 @@ Resources:
16581658
amazon-linux-extras install -y python3.8
16591659
/usr/bin/python3.8 -m venv /opt/certbot/
16601660
/opt/certbot/bin/pip install --upgrade pip
1661-
/opt/certbot/bin/pip install certbot
1662-
/opt/certbot/bin/pip install certbot-dns-route53
1661+
/opt/certbot/bin/pip install certbot==3.0.1
1662+
/opt/certbot/bin/pip install certbot-dns-route53==3.0.1
16631663
ln -s /opt/certbot/bin/certbot /usr/bin/certbot
16641664
16651665
# Certbot update script
@@ -1672,8 +1672,7 @@ Resources:
16721672
export WEB="${webOption}"
16731673
case $WEB in
16741674
Apache)
1675-
/opt/certbot/bin/pip install certbot-apache
1676-
echo "sudo /opt/certbot/bin/pip install --upgrade certbot-apache" >> /home/ec2-user/update-certbot
1675+
/opt/certbot/bin/pip install certbot-apache==3.0.1
16771676
yum install -q -y httpd mod_ssl mod_fcgid
16781677
systemctl enable httpd
16791678
cp /etc/httpd/conf.modules.d/00-mpm.conf /etc/httpd/conf.modules.d/00-mpm.conf."`date +"%Y-%m-%d"`"
@@ -1709,8 +1708,7 @@ Resources:
17091708
systemctl restart httpd
17101709
;;
17111710
Nginx)
1712-
/opt/certbot/bin/pip install certbot-nginx
1713-
echo "sudo /opt/certbot/bin/pip install --upgrade certbot-nginx" >> /home/ec2-user/update-certbot
1711+
/opt/certbot/bin/pip install certbot-nginx==3.0.1
17141712
amazon-linux-extras install -y nginx1
17151713
systemctl enable nginx
17161714

0 commit comments

Comments
 (0)