-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathinstall-phpmyadmin.sh
More file actions
57 lines (40 loc) · 1.58 KB
/
install-phpmyadmin.sh
File metadata and controls
57 lines (40 loc) · 1.58 KB
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
#!/bin/bash
cd /var/www/html/
timestamp=$(date +%s)
sudo git clone --single-branch https://github.com/phpmyadmin/phpmyadmin.git phpmyadmin$timestamp
cd ./phpmyadmin$timestamp
composer install --no-dev
cat > /etc/nginx/conf.d/phpmyadmin.conf<<EOF
server {
listen 80;
listen [::]:80;
server_name _; # You need replace this with your IP or mysqlphp specific IP
root /var/www/html;
index index.php index.html;
location / {
index index.php;
#try_files \$uri \$uri/ /index.php;
}
location ~ \.php$ {
fastcgi_pass fastcgi_backend;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
include fastcgi_params;
#include snippets/fastcgi-php.conf;
}
location ~ \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|html|json)$ {
add_header Cache-Control "public";
add_header X-Frame-Options "SAMEORIGIN";
expires +1y;
}
}
EOF
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash
sudo yum install nodejs -y
sudo yum install yarn -y
yarn install
cp config.sample.inc.php config.inc.php
service nginx restart
## if host is different from localhost you need to edit config
## if Login without a password is forbidden by configuration (see AllowNoPassword)
## $cfg['Servers'][$i]['AllowNoPassword'] = true; in config.sample.inc.php to use without password