Skip to content

Commit 79c2622

Browse files
authored
Merge pull request #5 from Anand-GitH/main
Updating stack for latest php and some code fixes
2 parents 589472d + 39934c7 commit 79c2622

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

main.tf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -555,12 +555,12 @@ resource "null_resource" "drupal_provisioner_without_bastion" {
555555
inline = [
556556
"chmod +x ${local.php_script}",
557557
"sudo ${local.php_script}",
558+
"chmod +x ${local.install_drupal}",
559+
"sudo ${local.install_drupal}",
558560
"chmod +x ${local.security_script}",
559561
"sudo ${local.security_script}",
560562
"chmod +x ${local.create_drupal_db}",
561-
"sudo ${local.create_drupal_db}",
562-
"chmod +x ${local.install_drupal}",
563-
"sudo ${local.install_drupal}"
563+
"sudo ${local.create_drupal_db}"
564564
]
565565

566566
}
@@ -701,12 +701,12 @@ resource "null_resource" "drupal_provisioner_with_bastion" {
701701
inline = [
702702
"chmod +x ${local.php_script}",
703703
"sudo ${local.php_script}",
704+
"chmod +x ${local.install_drupal}",
705+
"sudo ${local.install_drupal}",
704706
"chmod +x ${local.security_script}",
705707
"sudo ${local.security_script}",
706708
"chmod +x ${local.create_drupal_db}",
707-
"sudo ${local.create_drupal_db}",
708-
"chmod +x ${local.install_drupal}",
709-
"sudo ${local.install_drupal}"
709+
"sudo ${local.create_drupal_db}"
710710
]
711711

712712
}
@@ -847,12 +847,12 @@ resource "null_resource" "drupal_provisioner_with_injected_bastion_server_public
847847
inline = [
848848
"chmod +x ${local.php_script}",
849849
"sudo ${local.php_script}",
850+
"chmod +x ${local.install_drupal}",
851+
"sudo ${local.install_drupal}",
850852
"chmod +x ${local.security_script}",
851853
"sudo ${local.security_script}",
852854
"chmod +x ${local.create_drupal_db}",
853-
"sudo ${local.create_drupal_db}",
854-
"chmod +x ${local.install_drupal}",
855-
"sudo ${local.install_drupal}"
855+
"sudo ${local.create_drupal_db}"
856856
]
857857

858858
}

scripts/install_drupal.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if [[ $use_shared_storage == "true" ]]; then
1515
cd ${drupal_shared_working_dir}
1616
else
1717
echo "No mount NFS share. Moving to /var/www/html"
18-
cd /var/www/html
18+
cd /var/www/
1919
fi
2020

2121
wget https://www.drupal.org/download-latest/tar.gz
@@ -26,10 +26,11 @@ if [[ $use_shared_storage == "true" ]]; then
2626
rm -rf ${drupal_shared_working_dir}/drupal-*
2727
cp ${drupal_shared_working_dir}/sites/default/default.settings.php sites/default/settings.php
2828
else
29-
tar zxvf tar.gz --directory /var/www/html
30-
cp -r /var/www/html/drupal-*/* /var/www/html
31-
rm -rf /var/www/html/drupal-*
32-
cp /var/www/html/sites/default/default.settings.php sites/default/settings.php
29+
tar zxvf tar.gz
30+
rm -rf html/ tar.gz
31+
mv drupal-* html
32+
cd html
33+
cp sites/default/default.settings.php sites/default/settings.php
3334
fi
3435

3536
if [[ $use_shared_storage == "true" ]]; then
@@ -44,7 +45,8 @@ if [[ $use_shared_storage == "true" ]]; then
4445
rm /home/opc/index.html
4546
chown apache:apache ${drupal_shared_working_dir}/index.html
4647
else
47-
chown apache:apache -R /var/www/html
48+
cd -
49+
chown apache. -R html
4850
sed -i '/AllowOverride None/c\AllowOverride All' /etc/httpd/conf/httpd.conf
4951
fi
5052

scripts/install_php74.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ echo "MySQL Shell successfully installed !"
1818

1919
if [[ $(uname -r | sed 's/^.*\(el[0-9]\+\).*$/\1/') == "el8" ]]
2020
then
21-
dnf -y module enable php:remi-7.4
21+
dnf -y module enable php:remi-8.2
2222
dnf -y install php php-cli php-mysqlnd php-zip php-gd php-mcrypt php-mbstring php-xml php-json php-opcache
2323
else
24-
yum-config-manager --enable remi-php74
24+
yum-config-manager --enable remi-php82
2525
yum -y install php php-cli php-mysqlnd php-zip php-gd php-mcrypt php-mbstring php-xml php-json php-opcache
2626
fi
2727

0 commit comments

Comments
 (0)