-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·219 lines (166 loc) · 5.89 KB
/
install.sh
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#! /bin/bash
### Start
clear
kullanici=$HOME
phpMyAdminVer="4.8.2"
txtund=$(tput sgr 0 1) # Underline
txtbld=$(tput bold) # Bold
txtred=$(tput setaf 1) # Red
txtgrn=$(tput setaf 2) # Green
txtylw=$(tput setaf 3) # Yellow
txtblu=$(tput setaf 4) # Blue
txtpur=$(tput setaf 5) # Purple
txtcyn=$(tput setaf 6) # Cyan
txtwht=$(tput setaf 7) # White
txtrst=$(tput sgr0) # Text reset
txtund=$(tput sgr 0 1) # Underline
txtbld=$(tput bold) # Bold
bldred=${txtbld}$(tput setaf 1) # red
bldblu=${txtbld}$(tput setaf 4) # blue
bldwht=${txtbld}$(tput setaf 7) # white
txtrst=$(tput sgr0) # Reset
info=${txtgrn}*${txtrst} # Feedback
pass=${bldblu}*${txtrst}
warn=${bldred}!${txtrst}
sorno=0
function chackkur(){
for p; do
dpkg -s "$p" >/dev/null 2>&1 && {
echo $txtgrn$txtbld $p $txtrst$txtgrn " is installed." $txtrst
} || {
echo $txtred$txtbld $p $txtrst$txtred " is not installed." $txtrst
echo $bldblu "Starting to install $p ....."
echo $txtpur
sudo apt-get install $p -y
echo $txtrst
}
done
}
function yazdir(){
echo $txtylw
echo ${1}
echo $txtrst
}
function dikkat(){
echo $txtylw$txtbld
echo ${1}
echo $txtrst
}
function sor(){
echo $txtcyn$txtbld ${1} $txtylw$txtbld
read ${2}
echo $txtrst
}
function sudolama(){
echo $bldblu ">> sudo ${1}"
echo $txtrst$txtpur
sudo ${1}
echo $txtrst
}
function anladinmi(){
sorno=$(($sorno+1))
sorgir="devam$sorno"
echo -e "${1}"
sor "Devam ? [y/n/e] Yes / No / Exit " sorgir
if [ "$sorgir" = 'y' ]
then
echo "vay be"
elif [ "$sorgir" = 'e' ]
then
echo "ok"
exit
else
anladinmi "${1}"
fi
}
sor "Do you want to start install? [y/n/e] Yes / No / Exit" "devam"
if [ "$devam" = 'e' ]
then
exit
else
dikkat "Attention it is started!"
fi;
if [ "$devam" = 'y' ]
then
cd $HOME
mkdir "gecici"
cd gecici
sudolama "apt-get autoremove /n"
yazdir "oncekileri sil"
sudolama "apt-get remove --purge php5-mysql -y"
sudolama "apt-get remove --purge mysql-server -y"
sudolama "apt-get remove --purge libapache2-mod-php5 -y"
sudolama "apt-get remove --purge php5 -y"
sudolama "apt-get remove --purge php* -y"
sudolama "apt-get remove --purge apache2 -y"
sudolama "apt-get update && apt-get upgrade"
chackkur "kate" "gedit" "apache2" "php php8.1-mysql php8.1-curl php8.1-json php8.1-cgi php8.1 libapache2-mod-php8.1" "libapache2-mod-php" "mysql-server" "php-mysql" "php-curl php-soap php-mcrypt php-xdebug php-zip" "sysbench" "php-pear php-dev libmysqlclient-dev" "php-curl php8-curl" "libapache2-mod-php8.1 php8.1-mbstring php-intl"
sudolama "a2enmod rewrite"
anladinmi $bldred" Open (Installer will open it for you!) the 000-default.conf file and replace following row. $bldblu \n
DocumentRoot /var/www/html $bldred \n
with following one\n
$bldblu DocumentRoot $kullanici/Public \n$bldred"
sudolama "gedit /etc/apache2/sites-enabled/000-default.conf"
anladinmi $txtylw$txtbld" did you changed it?"$txtrst
anladinmi $bldred"Open (Installer will open it for you!) the /etc/apache2/apache2.conf dfile and replace following row: $bldblu \n
<Directory /var/www/>\n AllowOverride None $bldred \n
with following one: \n
$bldblu <Directory $kullanici/Public>\n AllowOverride All \n$bldred"
sudolama "gedit /etc/apache2/apache2.conf"
anladinmi $txtylw$txtbld" did you changed it?"$txtrst
sudolama "service apache2 restart"
chackkur "curl" "libcurl3" "libcurl3-dev"
echo "Tamam $devam";
echo "Dont hurry!!!! DUR BU NE ACELE?!"
sudolama "apt-get update"
chackkur "php-pear"
sudolama "pear channel-discover pear.phpunit.de"
sudolama "pear install phpunit/PHPUnit"
sudolama "pear config-set auto_discover 1"
sudolama "pear install --force --alldeps pear.phpqatools.org/phpqatools"
sudolama "pear install phpunit/PHPUnit_SkeletonGenerator"
sudolama "pear install phpunit/ppw"
sudolama "pear install pear.apigen.org/apigen"
sudolama "pear upgrade"
anladinmi $bldred" Open (Installer will open it for you!) the pear file and exactly one row after $bldblu \n
#!/bin/sh $bldred \n
you should add following rows:\n
$bldblu export LC_ALL=\"C\"\n
export LANG=\"C\"\n$bldred
"
sudolama "gedit /usr/bin/pear"
anladinmi $txtylw$txtbld" did you changed it?"$txtrst
anladinmi $txtbld$txtpur" Open (Installer will open it for you!) the hosts file $bldred and add following rows: \n$bldblu 127.0.0.1 www.localhost.com\n 127.0.0.1 localhost.com\n $bldred "
sudolama "gedit /etc/hosts"
anladinmi $txtylw$txtbld" did you changed it?"$txtrst
sudolama "service apache2 restart"
chackkur "php8-gd"
sudo sh -c 'echo "ServerName localhost" >> /etc/apache2/conf.d/name' && sudo service apache2 restart
#sudolama 'rm -R "/var/www/html/phpMyAdmin"'
#sudolama 'rm -R "/var/www/html/phpMyAdmin"'
cd "$kullanici/Public"
##wget "http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/$phpMyAdminVer/phpMyAdmin-$phpMyAdminVer-all-languages.tar.gz"
wget "https://files.phpmyadmin.net/phpMyAdmin/$phpMyAdminVer/phpMyAdmin-$phpMyAdminVer-all-languages.tar.gz"
sudolama "tar -xzvf phpMyAdmin-$phpMyAdminVer-all-languages.tar.gz -C ./"
sudolama "mv phpMyAdmin-$phpMyAdminVer-all-languages phpmyadmin"
sudolama "cp ./phpmyadmin/config.sample.inc.php ./phpmyadmin/config.inc.php"
anladinmi $bldred"make the following change in it\n $bldblu /* Authentication type */ \n 29 \$cfg['Servers'][\$i]['auth_type'] = ‘cookie’;\n $bldred with \n $bldblu /* Authentication type */\n 29 \$cfg['Servers'][\$i]['auth_type'] = ‘http’; "
sudolama "gedit ./phpmyadmin/config.inc.php"
anladinmi $txtylw$txtbld" did you changed it?"$txtrst
dikkat "@@@@@@@@@@@@@@@@@@ All Done!!!......"
cd "/var/www"
sudolama "mv html _html"
#sudolama "ln -s ./phpmyadmin $kullanici/Public/phpmyadmin "
sudolama "ln -s $kullanici/Public html"
#'/var/www/$site'"
sudolama "chown -R $USER:$USER ~/Public"
dikkat "%%%%%%%%%%%%%%%% İşimiz bitti nihayet ......"
cd ~
rm -R gecici
else
# ls
#sudo rm -R "$kullanici/$site"
#sudo rm -R "/var/www/$site"
echo "WHAT IS IT"
fi
exit