forked from littlebizzy/slickstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ss-install-prestashop-core.txt
110 lines (84 loc) · 5.11 KB
/
ss-install-prestashop-core.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
####################################################################################################
#### author: SlickStack ############################################################################
#### link: https://slickstack.io ###################################################################
#### mirror: http://mirrors.slickstack.io/ss-install-prestashop-core.txt ###########################
#### path: /var/www/ss-install-prestashop-core #####################################################
#### destination: n/a (not a boilerplate) ##########################################################
#### purpose: Reinstalls the entire PrestaShop module for SlickStack servers (idempotent) ##########
#### module version: Ubuntu 20.04 LTS + PrestaShop x.x.x ###########################################
####################################################################################################
## SS-CONFIG MUST BE PROPERLY CONFIGURED (AND CURRENT BUILD) BEFORE RUNNING SS-INSTALL ##
## ENSURE SS-CONFIG OPTIONS REMAIN CURRENT BY RUNNING SS-UPDATE OCCASIONALLY ##
## include SlickStack configuration ##
source /var/www/ss-config
## include SlickStack functions ##
source /var/www/ss-functions
####################################################################################################
#### SS-Install-WordPress-Core: Install Latest Stable (Minor) PrestaShop Version ###################
####################################################################################################
## cleanup files ##
rm /tmp/prestashop.zip*
rm /var/www/html/prestashop*
rm /var/www/html/staging/prestashop*
## make dirs ##
mkdir /var/www/html
mkdir /var/www/html/staging
## brief permissions reset ##
chown -R $SFTP_USER:slickstack /var/www/html
chown -R $SFTP_USER:slickstack /var/www/html/staging
chmod 6775 /var/www/html
chmod 6775 /var/www/html/staging
## download latest (patched) WordPress version ##
wget -O /tmp/prestashop.zip http://mirrors.slickstack.io/prestashop/prestashop.zip
## install WordPress to web directory ##
cp /tmp/prestashop.zip /var/www/html
unzip /var/www/html/prestashop.zip -d /var/www/html
chown -R www-data:slickstack /var/www/html/prestashop
chmod 775 /var/www/html/prestashop
rsync /var/www/html/prestashop/* /var/www/html
## install WordPress to staging subdirectory ##
cp /tmp/prestashop.zip /var/www/html/staging
unzip /var/www/html/staging/prestashop.zip -d /var/www/html/staging
chown -R www-data:slickstack /var/www/html/staging/prestashop
chmod 775 /var/www/html/staging/prestashop
rsync /var/www/html/staging/prestashop/* /var/www/html/staging
## cleanup files ##
rm /tmp/prestashop.zip* &> /dev/null
rm /var/www/html/prestashop* &> /dev/null
rm /var/www/html/staging/prestashop* &> /dev/null
# rm /var/www/html/wp-content/plugins/hello.php &> /dev/null
# rm /var/www/html/staging/wp-content/plugins/hello.php &> /dev/null
####################################################################################################
#### SS-Install-WordPress-Core: Modify Database Options For WordPress ##############################
####################################################################################################
## here we manually fix certain fields in the MySQL database to ensure proper settings ##
## ensure home + siteurl options are correct in the wp_options table ##
# mysql --execute="UPDATE ${DB_PREFIX}options SET option_value='https://$SITE_DOMAIN' WHERE option_name='home'";
# mysql --execute="UPDATE ${DB_PREFIX}options SET option_value='https://$SITE_DOMAIN' WHERE option_name='siteurl'";
####################################################################################################
#### SS-Install-WordPress-Core: Configure WP-Config File (Production + Staging) ####################
####################################################################################################
## this wp-config setup script is distinct so that it can be run separately if needed ##
## it will also be called whenever the ss-sync (staging sync) script is run ##
## run ss-install-wpconfig ##
# source /var/www/ss-install-wpconfig
####################################################################################################
#### SS-Install-WordPress: Reset Permissions, Etc ##################################################
####################################################################################################
## create directories if doesn't exist (will not overwrite) ##
# mkdir /var/www/html/wp-content/temp
# mkdir /var/www/html/wp-content/uploads
# mkdir /var/www/html/wp-content/upgrade
## for fresh (virgin) WP installs delete some of the WP Core junk plugins and themes ##
if [ ! -f "/var/www/meta/.cherry" ]; then
# rm /var/www/html/wp-content/plugins/akismet*
# rm /var/www/html/wp-content/themes/twenty*
fi
## run ss-perms ##
source /var/www/ss-perms
####################################################################################################
#### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ###############
####################################################################################################
## Ref:
## SS_EOF