搭一个自己的视频网站,从此看电影再也不用开会员啦
0. 说明
只做记录
系统centos7.6
网上都是用宝塔自动建站,自己有现成的lnmp架构和服务器,就直接在nginx里添加一个新站点的server配置好即可,域名自行在阿里云或者腾讯云购买备案,域名备案之后还需要配置解析记录,如果要配置SSL加密证书,可以去腾讯云免费申请一年的证书来进行配置。
1. php、mysql、nginx下载
#主机使用的阿里云的yum源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
#下载php的源
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum clean all && yum makecache
#安装php
yum install php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-gd php71w-mcrypt php71w-mbstring php71w-pdo php71w-xml php71w-fpm php71w-mysqlnd php71w-opcache php71w-pecl-memcached php71w-pecl-redis php71w-pecl-mongodb -y
#安装数据库,这里直接用的mariadb
yum install mariadb-server -y
#下载nginx
yum install nginx -y
#启动nginx、mariadb
systemctl restart nginx && systemctl enable nginx
systemctl start mariadb.service && systemctl enable mariadb.service
#为数据库设置密码
mysqladmin -uroot -p password 123456
2. 修改LNMP环境配置
2.1 Nginx与php的连接
#修改/etc/php-fpm.d/www.conf中的user与group为nginx
[root@lcx01 ~]# egrep -n '^user|^group' /etc/php-fpm.d/www.conf
8:user = nginx
10:group = nginx
#启动php-fpm服务并检测端口
systemctl restart php-fpm.service && systemctl enable php-fpm.service
ss -lntup|grep 9000
ps -ef |grep php
#切换到nginx默认站点目录下添加php测试文件
cd /usr/share/nginx/html
vim info.php
<?php
phpinfo();
?>
EOF
浏览器查看网页http://ip地址/info.php
出现此页面则连接成功
2.2 php与mysql的连接
#切换到nginx默认站点目录下创建mysqli.php测试文件
cd /usr/share/nginx/html
vim mysql.php
<?php
$servername = "localhost";
$username = "root";
$password = "password";
// 创建连接
$conn = mysqli_connect($servername, $username, $password);
// 检测连接
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "php连接MySQL数据库成功";
?>
浏览器查看网页http://ip地址/mysql.php
出现此页面则连接成功
3. 解压cms代码包到站点目录下
官网最新地址
https://www.maccms.pro/resource
#下载cms代码包到站点目录下解压
wget http://www.maccmsv10.com/static/maccms10.zip
mkdir -p /usr/share/nginx/html/maccms/
unzip -d /usr/share/nginx/html/maccms/ maccms10.zip
#修改站点目录权限(如果后台设置有报错则需要将maccms站点下全部添加读写权限)
cd /usr/share/nginx/html/maccms/
chmod -R 777 ./runtime/
chmod -R 777 ./application/
chmod -R 777 ./upload/
4. 创建数据库和用户
mysql -uroot -p
create database maccms;
grant all on maccms.* to 'maccms'@'%' identified by 'password';
grant all on maccms.* to 'maccms'@'localhost' identified by 'password';
5. 配置nginx文件
#注释默认配置文件的server模块并打开include指向文件功能
[root@lcx01 ~]# cat /etc/nginx/nginx.conf |egrep -v '^$|#'
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf; #解除注释
}
#添加maccms.conf文件
[root@lcx01 ~]# cd /etc/nginx/conf.d/
[root@lcx01 conf.d]# cat maccms.conf
[root@centos ~]# cat /etc/nginx/conf.d/maccms.conf
server {
listen 80;
server_name www.域名.cn; #域名或ip
access_log /var/log/nginx/access_blog.log main;
root /usr/share/nginx/html/maccms10; #站点目录
#伪静态规则
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^/admin.php(.*)$ /admin.php?s=$1 last;
rewrite ^/api.php(.*)$ /api.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
location / {
index index.php index.html index.htm;
}
location ~* \.(php|php5)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
#nginx检测文件正常后重启服务
[root@lcx01 conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
#平滑重启nginx
systemctl reload nginx
6. cms站点的配置修改
关闭验证码登录
#登录后台时输入验证码会一直提示输入错误,所以关闭即可
sed -i "s#'admin_login_verify' => '1',#'admin_login_verify' => '0',#g" application/extra/maccms.php
上传下载文件大小限制
#需要重启php-fpm
[root@centos maccms10]# egrep 'upload_max_filesize|post_max_size' /etc/php.ini
post_max_size = 10M
upload_max_filesize = 10M
systemctl restart php-fpm.service
7.安装后登录后台进行采集视频
推荐采集资源网站:http://www.zuidazy4.com/
http://www.jisudhw.com/
1-卧龙资源采集站- http://wolongzy.net
2-156资源采集站 http://www.156zy.cc
http://www.33uudy.com/
3-酷云资源采集站 http://kuyunzy.cc
4-八戒资源采集站 http://zy.bajieziyuan.com
5-ok资源采集站 http://www.haozy.cc
6-605资源采集站 http://www.765zy.com
7-酷酷资源采集站http://www.kukuzy.com/
8-筋斗云资源采集站 http://www.jdyzy.cc
9-大地资源采集站 http://dadizy2.com
备用域名:dadizy1.com dadizy2.com dadizy3.com dadizy4.com dadizy5.com dadizy6.com dadizy7.com dadizy8.com dadizy9.com dadizy10.com
10-小黄瓜资源采集站 http://www.xhgtv.com
11-超碰资源采集站 https://www.cpzy.tv
https://tiantangzy.com/
12-135资源采集站 http://135zy.cc/
13-1977资源采集站 http://www.1977zy.com
14-最快资源采集站 http://zuikzy.cc
15-131资源采集网 http://131zy.vip/
16-豆瓣资源采集站 http://www.doubanzy.com
17-高清资源采集站 http://gaoqingzy.com
18-172资源采集站 http://www.172zy.net
19-速播资源采集站 https://www.subo8988.com
20-乐多资源采集站 http://www.leduozy.com
21-永久资源采集站 http://yongjiuzy.cc
22-麻花资源采集站 http://www.mahuazy.com/
23-值资资源采集站 http://www.ziyuanpian.net
24-1769资源采集站 https://www.69aab.com/
http://www.1769bbsz.com/
25-6u资源采集站 http://zy.ataoju.com
26-高清mp4吧资源采集站 http://www.mp4ba.com
27-1717资源采集站 http://zy.itono.cn
28-极速云资源采集站 http://www.caijizy.com
29-哈酷资源采集站 http://www.666zy.com
30 百万云资源采集站 http://www.baiwanzy.com
31-高清资源采集站 http://www.wuxiou.com
32最大资源采集站 http://zuidazy.net
33-步步高资源采集站 http://www.bbkdj.com
34 猫眼资源采集站 http://maoyan123.com/
35-398资源采集站 https://www.398zy.com/
36 c值云采集资源站 http://www.czhiyun.com
备用http://www.czhiziyuan.com
37 ix资源采集站 http://ixxzyA.com
备用域名:ixxzyA.com ixxzyB.com ixxzyC.com
ixxzyD.com ixxzyE.com ixxzyF.com
38酷播资源 http://kubozy.net/
39 800资源采集网 http://haoa00.com/
所有旧域名即将停用发送邮件获取最新地址发送任意内容邮件给:800zycom@gmail.com 即可获取最新域名地址
40 超级资源采集网 http://chaojizy.com/
41 最新资源采集网 http://www.zuixinzy.cc/
MaccmsV10的采集配置说明:http://www.zuidazy3.net/help/#MacCms10
后台默认登录地址(建议修改以防被攻击): http://ip/admin.php
8. 站点目录说明
│─application //应用目录
│ │─admin //后台模块
│ │─api //api模块
│ │─common //公共模块
│ │─extra //配置文件
│ │─index //前台模块
│ │─install //安装模块
│─extend //扩展目录
│─runtime //缓存目录
│─static //静态文件目录
│─template //前台模板目录
│─thinkphp //tp目录
│─upload //附件目录
│─vendor //第三发库目录
└─index.php //入口文件