合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
# 创建 lnmp 目录脚本 ```sh #!/bin/bash func_create(){ mkdir $1 } func_chown_nginx(){ chown nginx $1 } func_chown_phpfpm(){ chown phpfpm $1 } server_array=( "/server" "/server/www" "/server/default" "/server/sites" "/server/nginx" "/server/php" "/server/php/8.1" "/server/php/8.0" "/server/redis" "/server/sqlite3" "/server/ImageMagick" "/server/run" "/server/run/nginx" "/server/run/mariadb" "/server/run/php" "/server/run/redis" "/server/logs" "/server/logs/nginx" "/server/logs/mariadb" "/server/logs/php" ) package_array=( "/package" "/package/lnmp" "/package/lnmp/default" "/package/lnmp/ext_static" "/package/lnmp/ext_dynamic" ) chown_nginx_array=( "/server/run/nginx" "/server/logs/nginx" ); chown_phpfpm_array=( "/server/run/php" "/server/logs/php" ); echo "-----开始创建server目录-----" for((i=0;i<${#server_array[*]};i++)); do echo ${server_array[i]} func_create ${server_array[i]} done echo "-----server目录创建结束 -----" echo "-----开始创建package目录-----" for((i=0;i<${#package_array[*]};i++)); do echo ${package_array[i]} func_create ${package_array[i]} done echo "-----package目录创建结束-----" echo "-----开始设置nginx用户权限目录-----" for((i=0;i<${#chown_nginx_array[*]};i++)); do echo ${chown_nginx_array[i]} func_chown_nginx ${chown_nginx_array[i]} done echo "-----nginx用户权限目录设置结束-----" echo "-----开始设置 phpfpm 用户权限目录-----" for((i=0;i<${#chown_phpfpm_array[*]};i++)); do echo ${chown_phpfpm_array[i]} func_chown_phpfpm ${chown_phpfpm_array[i]} done echo "-----phpfpm 用户权限目录设置结束-----" ```