完善脚本
This commit is contained in:
10
lemp.sh
10
lemp.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Install script for LEMP Web Server on CentOS 6 by xiaosong
|
||||
|
||||
cd `pwd`
|
||||
# Checking
|
||||
echo "Checking..."
|
||||
if [ -n "`grep 'Aliyun Linux release' /etc/issue`" -o -e /etc/redhat-release ];then
|
||||
@@ -63,6 +63,9 @@ sudo mv composer.phar /usr/bin/composer
|
||||
# Configure Nginx for PHP
|
||||
echo "Configuring Nginx for PHP..."
|
||||
sudo sed -i 's/index index.html index.htm;/index index.php index.html index.htm;/g' /etc/nginx/conf.d/default.conf
|
||||
sudo sed -i 's/fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;/fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;/g' /etc/nginx/conf.d/default.conf
|
||||
sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
|
||||
sudo cp ./nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Configure PHP
|
||||
echo "Configuring PHP..."
|
||||
@@ -75,6 +78,11 @@ sudo sed -i 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php.ini
|
||||
sudo sed -i 's/user = apache/user = nginx/g' /etc/php-fpm.d/www.conf
|
||||
sudo sed -i 's/group = apache/group = nginx/g' /etc/php-fpm.d/www.conf
|
||||
|
||||
# Configure MariaDB
|
||||
echo "Configuring MariaDB..."
|
||||
sudo cp ./my.cnf /etc/my.cnf
|
||||
sudo cp ./server.cnf /etc/my.cnf.d/server.cnf
|
||||
|
||||
# Restarting Services
|
||||
echo "Restarting Services..."
|
||||
sudo service mysql restart
|
||||
|
||||
Reference in New Issue
Block a user