activated php-fpm for default nginx conf
This commit is contained in:
parent
ba3a8af7c3
commit
10738b8897
@ -41,7 +41,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 index.html index.htm index.nginx-debian.html index.php;
|
||||||
|
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
@ -52,22 +52,30 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# pass PHP scripts to FastCGI server
|
# pass PHP scripts to FastCGI server
|
||||||
#
|
location ~ \.php$ {
|
||||||
#location ~ \.php$ {
|
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
|
||||||
# include snippets/fastcgi-php.conf;
|
fastcgi_index index.php;
|
||||||
#
|
include fastcgi_params;
|
||||||
# # With php-fpm (or other unix sockets):
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
|
}
|
||||||
# # With php-cgi (or other tcp sockets):
|
|
||||||
# fastcgi_pass 127.0.0.1:9000;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# deny access to .htaccess files, if Apache's document root
|
# deny access to .htaccess files, if Apache's document root
|
||||||
# concurs with nginx's one
|
# concurs with nginx's one
|
||||||
#
|
location ~ /\.ht {
|
||||||
#location ~ /\.ht {
|
deny all;
|
||||||
# deny all;
|
}
|
||||||
#}
|
|
||||||
|
## Images and static content is treated different
|
||||||
|
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
|
||||||
|
access_log off;
|
||||||
|
expires max;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /(libraries|setup/frames|setup/libs) {
|
||||||
|
deny all;
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -9,7 +9,7 @@ server {
|
|||||||
## Images and static content is treated different
|
## Images and static content is treated different
|
||||||
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
|
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
|
||||||
access_log off;
|
access_log off;
|
||||||
expires 30d;
|
expires max;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ /\.ht {
|
location ~ /\.ht {
|
||||||
|
@ -296,23 +296,6 @@ if [ "$lemp" = "y" ]; then
|
|||||||
systemctl restart mariadb.service
|
systemctl restart mariadb.service
|
||||||
echo "\033[92;1mmysql installed\033[Om"
|
echo "\033[92;1mmysql installed\033[Om"
|
||||||
|
|
||||||
echo '\033[35m
|
|
||||||
_ __ _
|
|
||||||
/ | / /___ _(_)___ _ __
|
|
||||||
/ |/ / __ `/ / __ \| |/_/
|
|
||||||
/ /| / /_/ / / / / /> <
|
|
||||||
/_/ |_/\__, /_/_/ /_/_/|_|
|
|
||||||
/____/
|
|
||||||
\033[0m'
|
|
||||||
echo "\033[35;1mInstalling Nginx \033[0m"
|
|
||||||
sleep 3
|
|
||||||
apt-get --yes --force-yes install nginx
|
|
||||||
cp "$_cwd"/assets/nginx.conf /etc/nginx/conf.d/
|
|
||||||
|
|
||||||
systemctl enable nginx
|
|
||||||
systemctl restart nginx
|
|
||||||
echo "\033[92;1mNginx installed\033[Om"
|
|
||||||
|
|
||||||
echo '\033[35m
|
echo '\033[35m
|
||||||
____ __ ______
|
____ __ ______
|
||||||
/ __ \/ / / / __ \
|
/ __ \/ / / / __ \
|
||||||
@ -345,6 +328,24 @@ if [ "$lemp" = "y" ]; then
|
|||||||
|
|
||||||
echo "\033[92;1mphp installed\033[Om"
|
echo "\033[92;1mphp installed\033[Om"
|
||||||
|
|
||||||
|
echo '\033[35m
|
||||||
|
_ __ _
|
||||||
|
/ | / /___ _(_)___ _ __
|
||||||
|
/ |/ / __ `/ / __ \| |/_/
|
||||||
|
/ /| / /_/ / / / / /> <
|
||||||
|
/_/ |_/\__, /_/_/ /_/_/|_|
|
||||||
|
/____/
|
||||||
|
\033[0m'
|
||||||
|
echo "\033[35;1mInstalling Nginx \033[0m"
|
||||||
|
sleep 3
|
||||||
|
apt-get --yes --force-yes install nginx
|
||||||
|
mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.ori
|
||||||
|
cp "$_cwd"/assets/default.nginxconf /etc/nginx/sites-available/default
|
||||||
|
|
||||||
|
systemctl enable nginx
|
||||||
|
systemctl restart nginx
|
||||||
|
echo "\033[92;1mNginx installed\033[Om"
|
||||||
|
|
||||||
echo '\033[35m
|
echo '\033[35m
|
||||||
__ __ ___ ___ __ _
|
__ __ ___ ___ __ _
|
||||||
____ / /_ ____ / |/ /_ __/ | ____/ /___ ___ (_)___
|
____ / /_ ____ / |/ /_ __/ | ____/ /___ ___ (_)___
|
||||||
@ -355,10 +356,11 @@ if [ "$lemp" = "y" ]; then
|
|||||||
\033[0m'
|
\033[0m'
|
||||||
echo "\033[35;1mInstalling phpMyAdmin \033[0m"
|
echo "\033[35;1mInstalling phpMyAdmin \033[0m"
|
||||||
apt-get --yes --force-yes install phpmyadmin
|
apt-get --yes --force-yes install phpmyadmin
|
||||||
cp "$_cwd"/assets/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf
|
ln -s /usr/share/phpmyadmin /var/www/html/
|
||||||
ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf
|
# cp "$_cwd"/assets/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf
|
||||||
|
# ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf
|
||||||
|
|
||||||
echo "\033[35;1msecuring phpMyAdmin \033[0m"
|
# echo "\033[35;1msecuring phpMyAdmin \033[0m"
|
||||||
# sed -i "s/DirectoryIndex index.php/DirectoryIndex index.php\nAllowOverride all/"
|
# sed -i "s/DirectoryIndex index.php/DirectoryIndex index.php\nAllowOverride all/"
|
||||||
# cp "$_cwd"/assets/phpmyadmin_htaccess > /usr/share/phpmyadmin/.htaccess
|
# cp "$_cwd"/assets/phpmyadmin_htaccess > /usr/share/phpmyadmin/.htaccess
|
||||||
# echo -n "define a user name for phpmyadmin : "
|
# echo -n "define a user name for phpmyadmin : "
|
||||||
@ -443,8 +445,9 @@ if [ "$lemp" = "y" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
# TODO ask for simple php conf or drupal conf
|
||||||
|
|
||||||
cp "$_cwd"/assets/nginx.conf /etc/nginx/sites-available/"$_host_name".conf
|
cp "$_cwd"/assets/simple-phpfpm.nginxconf /etc/nginx/sites-available/"$_host_name".conf
|
||||||
sed -ir "s/yourdomain\.ltd/$_host_name/g" /etc/nginx/sites-available/"$_host_name".conf
|
sed -ir "s/yourdomain\.ltd/$_host_name/g" /etc/nginx/sites-available/"$_host_name".conf
|
||||||
|
|
||||||
mkdir -p /var/www/"$_host_name"/public_html
|
mkdir -p /var/www/"$_host_name"/public_html
|
||||||
|
Loading…
x
Reference in New Issue
Block a user