在Centos7 中,使用的是PHP7 和NGINX 1.10的组合。请修改代码中的域名部分,并另存为xxx.sh,然后在主机中执行。
Centos7下的代码:
clear echo ' ************************************************************ ***** ***** ***** 本脚本只在Centos7 x64上通过测试 ***** ***** ***** ************************************************************ -Powered by HMP博客-小表弟 ' ##设置域名 read -p '请输入离线下载地址(例如 dl.xxx.com): ' dl; read -p '请输入网盘下载地址(例如 pan.xxx.com): ' pan; [ -z "$dl" ] && echo "你是猪吗,让你填域名 已经给你设置为www.baidu.com,自己改" && dl="www.baidu.com" [ -z "$pan" ] && echo "你是猪吗,让你填域名 已经给你设置为www.baidu.com,自己改" && pan="www.baidu.com" ##设置完毕 #更新php7 nginx1.10 ffmpeg源 yum update -y yum install wget unzip -y yum install epel-release -y yum update -y rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm #php源 rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm #nginx源 rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm #ffmpeg源 yum update -y #安装PHP NGINX yum install nginx -y yum install php70-php-fpm php70-php php70-php-gd -y yum install ffmpeg -y #启动PHP NGINX systemctl start nginx systemctl start php70-php-fpm systemctl enable nginx systemctl enable php70-php-fpm mkdir -p /home/wwwroot/${dl} mkdir -p /home/wwwroot/${pan} cd /etc/nginx/ rm -rf fastcgi_params echo ' fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param REDIRECT_STATUS 200; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param HTTPS $https if_not_empty; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; ' >> fastcgi_params cd conf.d echo " server { listen 80; server_name ${dl}; root /home/wwwroot/${dl}; location / { index index.html index.php; } location ~* \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/wwwroot/${dl}$fastcgi_script_name; fastcgi_split_path_info ^(.+\.php)(.*)$; include fastcgi_params; } } " >> ${dl}.conf echo " server { listen 80; server_name ${pan}; root /home/wwwroot/${pan}; location / { index index.html index.php /_h5ai/public/index.php; } location ~* \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/wwwroot/${dl}$fastcgi_script_name; fastcgi_split_path_info ^(.+\.php)(.*)$; include fastcgi_params; } } " >> ${pan}.conf ##开始配置程序 echo '开始安装程序' cd yum install aria2 screen -y mkdir .aria2 echo " ## '#'开头为注释内容, 选项都有相应的注释说明, 根据需要修改 ## ## 被注释的选项填写的是默认值, 建议在需要修改时再取消注释 ## ## 文件保存相关 ## # 文件的保存路径(可使用绝对路径或相对路径), 默认: 当前启动位置 dir=/home/wwwroot/${pan} # 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M #disk-cache=32M # 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc # 预分配所需时间: none > /root/.aria2/aria2.conf screen -dmS aria2 aria2c --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all -c echo '' > /root/aria2.session cd /home/wwwroot/${dl} wget --no-check-certificate https://raw.githubusercontent.com/godzlalala/onlineplayer/master/yaaw.zip unzip yaaw.zip cd /home/wwwroot/${pan} wget --no-check-certificate https://raw.githubusercontent.com/godzlalala/onlineplayer/master/_h5ai.zip unzip _h5ai.zip chmod 777 /home/wwwroot/${pan}/_h5ai/public/cache chmod 777 /home/wwwroot/${pan}/_h5ai/private/cache #启动程序 echo '配置完毕,启动程序' systemctl restart nginx echo " ************************************************************ * * * 程序安装完毕 * * 离线下载域名${dl} * * 在线观看域名${pan} * * 感谢使用 * ************************************************************ -Powered by HMP博客-小表弟 "Debian8下的代码:
#!/bin/sh clear echo ' ************************************************************ ***** ***** ***** 本脚本只在debian8 x64上通过测试 ***** ***** ***** ************************************************************ -Powered by HMP博客-小表弟 ' ##设置域名 read -p '请输入离线下载地址(例如 dl.xxx.com): ' dl; read -p '请输入网盘下载地址(例如 pan.xxx.com): ' pan; [ -z "$dl" ] && echo "你是猪吗,让你填域名 已经给你设置为www.baidu.com,自己改" && dl="www.baidu.com" [ -z "$pan" ] && echo "你是猪吗,让你填域名 已经给你设置为www.baidu.com,自己改" && pan="www.baidu.com" ##设置完毕 ##开始配置环境 echo '开始配置环境' echo "deb ftp://ftp.deb-multimedia.org jessie main" >>/etc/apt/sources.list apt-get update -y >/dev/null 2>&1 apt-get install -y --force-yes deb-multimedia-keyring >/dev/null 2>&1 apt-get update -y >/dev/null 2>&1 apt-get install -y -t jessie nginx php5 php5-fpm php5-gd ffmpeg unzip >/dev/null 2>&1 mkdir -p /home/wwwroot/${dl} mkdir -p /home/wwwroot/${pan} cd /etc/nginx/ rm -rf fastcgi_params echo ' fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param REDIRECT_STATUS 200; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param HTTPS $https if_not_empty; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; ' >> fastcgi_params cd conf.d echo " server { listen 80; server_name ${dl}; root /home/wwwroot/${dl}; location / { index index.html index.php; } location ~* \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; include fastcgi_params; } } " >> ${dl}.conf echo " server { listen 80; server_name ${pan}; root /home/wwwroot/${pan}; location / { index index.html index.php /_h5ai/public/index.php; } location ~* \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; include fastcgi_params; } } " >> ${pan}.conf ##开始配置程序 echo '开始安装程序' cd apt-get install aria2 screen -y >/dev/null 2>&1 mkdir .aria2 echo " ## '#'开头为注释内容, 选项都有相应的注释说明, 根据需要修改 ## ## 被注释的选项填写的是默认值, 建议在需要修改时再取消注释 ## ## 文件保存相关 ## # 文件的保存路径(可使用绝对路径或相对路径), 默认: 当前启动位置 dir=/home/wwwroot/${pan} # 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M #disk-cache=32M # 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc # 预分配所需时间: none > /root/.aria2/aria2.conf screen -dmS aria2 aria2c --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all -c >/dev/null 2>&1 echo '' > /root/aria2.session cd /home/wwwroot/${dl} wget --no-check-certificate https://raw.githubusercontent.com/godzlalala/onlineplayer/master/yaaw.zip >/dev/null 2>&1 unzip yaaw.zip >/dev/null 2>&1 cd /home/wwwroot/${pan} wget --no-check-certificate https://raw.githubusercontent.com/godzlalala/onlineplayer/master/_h5ai.zip >/dev/null 2>&1 unzip _h5ai.zip >/dev/null 2>&1 chmod 777 /home/wwwroot/${pan}/_h5ai/public/cache chmod 777 /home/wwwroot/${pan}/_h5ai/private/cache #启动程序 echo '配置完毕,启动程序' service nginx restart >/dev/null 2>&1 service php5-fpm restart >/dev/null 2>&1 echo " ************************************************************ * * * 程序安装完毕 * * 离线下载域名${dl} * * 在线观看域名${pan} * * 感谢使用 * ************************************************************ -Powered by HMP博客-小表弟 "via:https://www.hmp.wiki/php/428.html
推荐站内搜索:虚拟主机评测网、国外十大免费服务器、查询域名、过期备案域名查询、工信部icp备案号、美国php主机、备案查询、好域名注册、icp备案网站、云主机租用、