搭一個(gè)自己的視頻網(wǎng)站宏蛉,從此看電影再也不用開(kāi)會(huì)員啦
0. 說(shuō)明
只做記錄
系統(tǒng)centos7.6
網(wǎng)上都是用寶塔自動(dòng)建站,自己有現(xiàn)成的lnmp架構(gòu)和服務(wù)器袭艺,就直接在nginx里添加一個(gè)新站點(diǎn)的server配置好即可滑绒,域名自行在阿里云或者騰訊云購(gòu)買(mǎi)備案,域名備案之后還需要配置解析記錄镀梭,如果要配置SSL加密證書(shū),可以去騰訊云免費(fèi)申請(qǐng)一年的證書(shū)來(lái)進(jìn)行配置踱启。
1. php报账、mysql研底、nginx下載
#主機(jī)使用的阿里云的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
#安裝數(shù)據(jù)庫(kù),這里直接用的mariadb
yum install mariadb-server -y
#下載nginx
yum install nginx -y
#啟動(dòng)nginx、mariadb
systemctl restart nginx && systemctl enable nginx
systemctl start mariadb.service && systemctl enable mariadb.service
#為數(shù)據(jù)庫(kù)設(shè)置密碼
mysqladmin -uroot -p password 123456
2. 修改LNMP環(huán)境配置
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
#啟動(dòng)php-fpm服務(wù)并檢測(cè)端口
systemctl restart php-fpm.service && systemctl enable php-fpm.service
ss -lntup|grep 9000
ps -ef |grep php
#切換到nginx默認(rèn)站點(diǎn)目錄下添加php測(cè)試文件
cd /usr/share/nginx/html
vim info.php
<?php
phpinfo();
?>
EOF
瀏覽器查看網(wǎng)頁(yè)http://ip地址/info.php
出現(xiàn)此頁(yè)面則連接成功
2.2 php與mysql的連接
#切換到nginx默認(rèn)站點(diǎn)目錄下創(chuàng)建mysqli.php測(cè)試文件
cd /usr/share/nginx/html
vim mysql.php
<?php
$servername = "localhost";
$username = "root";
$password = "password";
// 創(chuàng)建連接
$conn = mysqli_connect($servername, $username, $password);
// 檢測(cè)連接
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "php連接MySQL數(shù)據(jù)庫(kù)成功";
?>
瀏覽器查看網(wǎng)頁(yè)http://ip地址/mysql.php
出現(xiàn)此頁(yè)面則連接成功
3. 解壓cms代碼包到站點(diǎn)目錄下
官網(wǎng)最新地址
https://www.maccms.pro/resource
#下載cms代碼包到站點(diǎn)目錄下解壓
wget http://www.maccmsv10.com/static/maccms10.zip
mkdir -p /usr/share/nginx/html/maccms/
unzip -d /usr/share/nginx/html/maccms/ maccms10.zip
#修改站點(diǎn)目錄權(quán)限(如果后臺(tái)設(shè)置有報(bào)錯(cuò)則需要將maccms站點(diǎn)下全部添加讀寫(xiě)權(quán)限)
cd /usr/share/nginx/html/maccms/
chmod -R 777 ./runtime/
chmod -R 777 ./application/
chmod -R 777 ./upload/
4. 創(chuàng)建數(shù)據(jù)庫(kù)和用戶
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文件
#注釋默認(rèn)配置文件的server模塊并打開(kāi)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; #站點(diǎn)目錄
#偽靜態(tài)規(guī)則
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檢測(cè)文件正常后重啟服務(wù)
[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站點(diǎn)的配置修改
關(guān)閉驗(yàn)證碼登錄
#登錄后臺(tái)時(shí)輸入驗(yàn)證碼會(huì)一直提示輸入錯(cuò)誤透罢,所以關(guān)閉即可
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.安裝后登錄后臺(tái)進(jìn)行采集視頻
推薦采集資源網(wǎng)站: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資源采集網(wǎng) http://131zy.vip/
16-豆瓣資源采集站 http://www.doubanzy.com
17-高清資源采集站 http://gaoqingzy.com
18-172資源采集站 http://www.172zy.net
19-速播資源采集站 https://www.subo8988.com
20-樂(lè)多資源采集站 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 百萬(wàn)云資源采集站 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資源采集網(wǎng) http://haoa00.com/
所有舊域名即將停用發(fā)送郵件獲取最新地址發(fā)送任意內(nèi)容郵件給:800zycom@gmail.com 即可獲取最新域名地址
40 超級(jí)資源采集網(wǎng) http://chaojizy.com/
41 最新資源采集網(wǎng) http://www.zuixinzy.cc/
MaccmsV10的采集配置說(shuō)明:http://www.zuidazy3.net/help/#MacCms10
后臺(tái)默認(rèn)登錄地址(建議修改以防被攻擊): http://ip/admin.php
8. 站點(diǎn)目錄說(shuō)明
│─application //應(yīng)用目錄
│ │─admin //后臺(tái)模塊
│ │─api //api模塊
│ │─common //公共模塊
│ │─extra //配置文件
│ │─index //前臺(tái)模塊
│ │─install //安裝模塊
│─extend //擴(kuò)展目錄
│─runtime //緩存目錄
│─static //靜態(tài)文件目錄
│─template //前臺(tái)模板目錄
│─thinkphp //tp目錄
│─upload //附件目錄
│─vendor //第三發(fā)庫(kù)目錄
└─index.php //入口文件