phpmyadmin is working
This commit is contained in:
@@ -21,7 +21,7 @@ server {
|
|||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
|
|
||||||
# Add index.php to the list if you are using PHP
|
# Add index.php to the list if you are using PHP
|
||||||
index index.html index.htm index.nginx-debian.html index.php;
|
index index.html index.htm index.php;
|
||||||
|
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
@@ -31,6 +31,47 @@ server {
|
|||||||
try_files $uri $uri/ =404;
|
try_files $uri $uri/ =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /phpmyadmin {
|
||||||
|
root /usr/share/webapps/;
|
||||||
|
|
||||||
|
# Deny static files
|
||||||
|
location ~ ^/phpMyAdmin/(README|LICENSE|ChangeLog|DCO)$ {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Deny .md files
|
||||||
|
location ~ ^/phpMyAdmin/(.+\.md)$ {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Deny setup directories
|
||||||
|
location ~ ^/phpMyAdmin/(doc|sql|setup)/ {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/phpmyadmin/(.+\.php)$ {
|
||||||
|
fastcgi_pass 127.0.0.1:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi.conf;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
try_files $uri $document_root$fastcgi_script_name =404;
|
||||||
|
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
|
||||||
|
fastcgi_param HTTP_PROXY "";
|
||||||
|
fastcgi_param HTTPS on;
|
||||||
|
fastcgi_request_buffering off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/phpmyadmin/(.*\.(eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|xls|tar|bmp))$ {
|
||||||
|
root /usr/share/webapps/;
|
||||||
|
expires 30d;
|
||||||
|
log_not_found off;
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# pass PHP scripts to FastCGI server
|
# pass PHP scripts to FastCGI server
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
fastcgi_pass 127.0.0.1:9000;
|
fastcgi_pass 127.0.0.1:9000;
|
||||||
|
|||||||
+44
-39
@@ -91,51 +91,31 @@ service php-fpm7 start
|
|||||||
echo -e "php installed"
|
echo -e "php installed"
|
||||||
|
|
||||||
echo -e '
|
echo -e '
|
||||||
_
|
_ __ __ _ _ _
|
||||||
_ _ __ _(_)_ _ __ __
|
_ __| |_ _ __| \/ |_ _ /_\ __| |_ __ (_)_ _
|
||||||
| ` \/ _` | | ` \\ \ /
|
| `_ \ ` \| `_ \ |\/| | || |/ _ \/ _` | ` \| | ` \
|
||||||
|_||_\__, |_|_||_/_\_\
|
| .__/_||_| .__/_| |_|\_, /_/ \_\__,_|_|_|_|_|_||_|
|
||||||
|___/
|
|_| |_| |__/
|
||||||
'
|
'
|
||||||
echo -e "Installing Nginx"
|
echo -e "Installing phpMyAdmin"
|
||||||
sleep 3
|
apk add phpmyadmin php7-mysqli
|
||||||
apk add nginx
|
service php-fpm7 restart
|
||||||
|
|
||||||
adduser -D -g 'www' www
|
chmod +r /etc/phpmyadmin/config.inc.php
|
||||||
mkdir -p /var/www/html
|
|
||||||
chown -R www:www /var/lib/nginx
|
|
||||||
chown -R www:www /var/www/html
|
|
||||||
|
|
||||||
mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.ori
|
|
||||||
cp "$_assets"/lemp/default.nginxconf /etc/nginx/conf.d/default.conf
|
|
||||||
cp "$_assets"/lemp/index.php /var/www/html/
|
|
||||||
|
|
||||||
rc-update add nginx
|
|
||||||
service nginx start
|
|
||||||
echo -e "Nginx installed"
|
|
||||||
|
|
||||||
# echo -e '
|
|
||||||
# _ __ __ _ _ _
|
|
||||||
# _ __| |_ _ __| \/ |_ _ /_\ __| |_ __ (_)_ _
|
|
||||||
# | `_ \ ` \| `_ \ |\/| | || |/ _ \/ _` | ` \| | ` \
|
|
||||||
# | .__/_||_| .__/_| |_|\_, /_/ \_\__,_|_|_|_|_|_||_|
|
|
||||||
# |_| |_| |__/
|
|
||||||
# '
|
|
||||||
# echo -e "Installing phpMyAdmin"
|
|
||||||
# apk add phpmyadmin
|
|
||||||
# ln -s /usr/share/phpmyadmin /var/www/html/
|
# ln -s /usr/share/phpmyadmin /var/www/html/
|
||||||
# cp "$_assets"/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf
|
# cp "$_assets"/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf
|
||||||
# ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf
|
# ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf
|
||||||
#
|
|
||||||
# # echo -e "securing phpMyAdmin"
|
# echo -e "securing phpMyAdmin"
|
||||||
# # sed -i "s/DirectoryIndex index.php/DirectoryIndex index.php\nAllowOverride all/"
|
# sed -i "s/DirectoryIndex index.php/DirectoryIndex index.php\nAllowOverride all/"
|
||||||
# # cp "$_assets"/phpmyadmin_htaccess > /usr/share/phpmyadmin/.htaccess
|
# cp "$_assets"/phpmyadmin_htaccess > /usr/share/phpmyadmin/.htaccess
|
||||||
# # echo -n "define a user name for phpmyadmin : "
|
# echo -n "define a user name for phpmyadmin : "
|
||||||
# # read un
|
# read un
|
||||||
# # htpasswd -c /etc/phpmyadmin/.htpasswd $un
|
# htpasswd -c /etc/phpmyadmin/.htpasswd $un
|
||||||
# # service apache2 restart
|
# service apache2 restart
|
||||||
# echo -e "phpMyAdmin installed"
|
echo -e "phpMyAdmin installed"
|
||||||
# echo -e "You can access it at yourip/phpmyadmin"
|
echo -e "You can access it at yourip/phpmyadmin"
|
||||||
|
|
||||||
echo -e '
|
echo -e '
|
||||||
_ _
|
_ _
|
||||||
@@ -184,3 +164,28 @@ chmod +x /usr/local/bin/drupal
|
|||||||
curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar -L -o /usr/local/bin/drush
|
curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar -L -o /usr/local/bin/drush
|
||||||
chmod +x /usr/local/bin/drush
|
chmod +x /usr/local/bin/drush
|
||||||
echo -e "Drush and DrupalConsoleinstalled"
|
echo -e "Drush and DrupalConsoleinstalled"
|
||||||
|
|
||||||
|
|
||||||
|
echo -e '
|
||||||
|
_
|
||||||
|
_ _ __ _(_)_ _ __ __
|
||||||
|
| ` \/ _` | | ` \\ \ /
|
||||||
|
|_||_\__, |_|_||_/_\_\
|
||||||
|
|___/
|
||||||
|
'
|
||||||
|
echo -e "Installing Nginx"
|
||||||
|
sleep 3
|
||||||
|
apk add nginx
|
||||||
|
|
||||||
|
adduser -D -g 'www' www
|
||||||
|
mkdir -p /var/www/html
|
||||||
|
chown -R www:www /var/lib/nginx
|
||||||
|
chown -R www:www /var/www/html
|
||||||
|
|
||||||
|
mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.ori
|
||||||
|
cp "$_assets"/lemp/default.nginxconf /etc/nginx/conf.d/default.conf
|
||||||
|
cp "$_assets"/lemp/index.php /var/www/html/
|
||||||
|
|
||||||
|
rc-update add nginx
|
||||||
|
service nginx start
|
||||||
|
echo -e "Nginx installed"
|
||||||
|
|||||||
Reference in New Issue
Block a user