当前位置: 首页 > news >正文

录像网站怎么做网站建设与管理主要学什么

录像网站怎么做,网站建设与管理主要学什么,ui设计师的薪资水平,永修建设局网站最近将小服务器升级了下系统,使用了 debian12 的版本,正好试试 nginx 和 php-fpm 这种方式运行 Nextcloud 这个私有云的配置。 一、基本系统及应用安装 系统:debian12 x86_64 位版本最小安装,安装后可根据自己需求安装一些工具&…

最近将小服务器升级了下系统,使用了 debian12 的版本,正好试试 nginx 和 php-fpm 这种方式运行 Nextcloud 这个私有云的配置。

一、基本系统及应用安装

系统:debian12 x86_64 位版本最小安装,安装后可根据自己需求安装一些工具,比如 neofetch 等自己喜欢的工具;

nginx:使用系统源的包进行安装,主要是为了省事儿,要不然还得找服务启动脚本等各种配置,内容里会记录 nginx 的配置文件内容;另如需要使用源码安装的话,想使用系统的服务启动,服务脚本在最后的“附件”里查看;

php:使用系统源中的包进行安装,主要是使用 php-fpm 方式,主要也是为了省事儿,看缺什么组件就直接安装就可以,当前源中的版本是 8.2.7 版本,这个不太建议使用源码安装,主要是太麻烦,不容易记录也不必要弄太麻烦;

nextcloud:使用的是当前最新的版本 28.0.4,数据库使用 sqlite 主要也是为了省事儿,也没特别大的数据,所以就不再另安装数据库系统;

二、系统配置

1、配置 debian12:

最小安装完成后(要注意安装过程中要选择安装 ssh 服务,要不然系统安装完成还得自己另安装,太麻烦),修改源到自己习惯的国内源,并更新到最新

apt update && apt upgrade -y

安装一些自己习惯使用工具,比如 neofetch、btop、net-tools 什么的

并将系统的的 IP 设置为固定即可,方式很多,我使用的是直接设置 interfaces 文件:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/*# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
allow-hotplug enp1s0
# iface enp1s0 inet dhcp
iface enp1s0 inet staticaddress X.X.X.X/24gateway X.X.X.Xdns-nameservers X.X.X.X

重新网络服务以使其生效

systemctl restart networking.service

系统已经设置完毕;

2、安装配置 Nginx

apt install nginx        # 安装nginx

编写 nginx 配置文件(注意:按配置文件内容中可以看到 nextcloud 程序的位置是在/var/www/nextcloud 下,后面直接将 nextcloud 解压到/var/www/下即可)

vim /etc/nginx/sites-available/nextcloud

# 注:这是访问方式为 http://IP:PORT/ 的配置
server {listen 80;server_name X.X.X.X;root /var/www/nextcloud;index index.html index.htm index.php;location / {try_files $uri $uri/ /index.php$is_args$args;}location ~ \.php(?:$|/) {fastcgi_split_path_info ^(.+\.php)(/.+)$;# 要注意下面这行的接口的版本,版本要与 php 的版本一样,可以去指定的地址查看一下fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;fastcgi_index index.php;include fastcgi_params;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param PATH_INFO $fastcgi_path_info;}location ~ /\.ht {deny all;}# 解决 nextcloud 中的一个安全检查的 .mjs 问题location ~* \.mjs$ {types { }default_type application/javascript;}location ^~ /.well-known {# The rules in this block are an adaptation of the rules# in `.htaccess` that concern `/.well-known`.location = /.well-known/carddav { return 301 /remote.php/dav/; }location = /.well-known/caldav  { return 301 /remote.php/dav/; }location /.well-known/acme-challenge    { try_files $uri $uri/ =404; }location /.well-known/pki-validation    { try_files $uri $uri/ =404; }# Let Nextcloud's API for `/.well-known` URIs handle all other# requests by passing them to the front-end controller.return 301 /index.php$request_uri;}# Optional: set long EXPIRES header on static assetslocation ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {expires 30d;access_log off;}
}

或是使用 url 路径的方式使用 http://IP:PORT/nextcloud/ 的配置内容(使用这种安装的会在nextcloud页面安装完成后自动转到没有 url 地址的网址,进而导致无法打开,此时手工加上 url 地址就可以)

根据自己需要二选一即可

mkdir -p /var/www/app

tar xjvf nextcloud-28.0.4.tar.bz2 -C /var/www/app/        # 解压 nextcloud 到 app 目录中

chown -R www-data:www-data /var/www/app

# 使用 url 路径的方式使用 http://IP:PORT/nextcloud/ 的配置
server {listen 80;server_name X.X.X.X;root /var/www/app;index index.html index.htm index.php;location /nextcloud {try_files $uri $uri/ /nextcloud/index.php$request_uri;}location ~ \.php(?:$|/) {fastcgi_split_path_info ^(.+\.php)(/.+)$;# 要注意下面这行的接口的版本,版本要与 php 的版本一样,可以去指定的地址查看一下fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;fastcgi_index index.php;include fastcgi_params;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param PATH_INFO $fastcgi_path_info;}location ~ /\.ht {deny all;}# 解决 nextcloud 中的一个安全检查的 .mjs 问题location ~* \.mjs$ {types { }default_type application/javascript;}location ^~ /.well-known {# The rules in this block are an adaptation of the rules# in `.htaccess` that concern `/.well-known`.location = /.well-known/carddav { return 301 /nextcloud/remote.php/dav/; }location = /.well-known/caldav  { return 301 /nextcloud/remote.php/dav/; }location = /.well-known/webfinger  { return 301 /nextcloud/index.php/.well-known/webfinger; }location = /.well-known/nodeinfo  { return 301 /nextcloud/index.php/.well-known/nodeinfo; }location /.well-known/acme-challenge    { try_files $uri $uri/ =404; }location /.well-known/pki-validation    { try_files $uri $uri/ =404; }# Let Nextcloud's API for `/.well-known` URIs handle all other# requests by passing them to the front-end controller.return 301 /nextcloud/index.php$request_uri;}# Optional: set long EXPIRES header on static assetslocation ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {expires 30d;access_log off;}
}

创建一个软链接

ln -s /etc/nginx/sites-available/nextcloud /etc/nginx/sites-enabled/

systemctl restart nginx.service        # 重启nginx服务

3、安装配置 php

直接使用系统源中的版本就可以,当前版本是 8.2.7

# 安装 php 及 php-fpm
apt install php8.2-fpm -y# 安装 nextcloud 所需要的必要 php 组件,可以在运行 nextcloud 时看提示所缺少的组件安装也可以
apt install php8.2-sqlite3 php8.2-zip php8.2-xml php8.2-mbstring php8.2-gd php8.2-curl -y# 安装 nextcloud 正常使用时建议安装的 php 组件
apt install php8.2-gmp php8.2-bcmath php8.2-intl php8.2-imagick -y# 按 nextcloud 建议修改 php-fpm 的配置
# 解决:PHP 内存限制低于建议值 512 MB
vim /etc/php/8.2/fpm/php.ini
# 搜索 memory_limit,并将原值 128M 修改为 512M 后保存
# 搜索 interned_strings_buffer,启用并将原值 8 修改为 16,因为这个有可能会被提示需进行优化vim /etc/php/8.2/fpm/pool.d/www.conf
# 搜索 PATH,找到 env[PATH],= 的内容为在系统中的 PATH 值(echo $PATH 的结果)
# 例如:env[PATH] = /usr/local/bin:/usr/bin:/bin# 重启服务使组件及配置生效
systemctl restart php8.2-fpm.service

4、安装 Nextcloud

可以直接到官网上下载就可以(这个是官方各个版本的下载地址,选一个自己喜欢的就可以)Index of /server/releases (nextcloud.com)icon-default.png?t=N7T8https://download.nextcloud.com/server/releases/我选择下载最新的版本

# 下载指定的版本包
wget https://download.nextcloud.com/server/releases/nextcloud-28.0.4.tar.bz2
# 解压到指定位置,也是按 nginx 的配置文件中所指的位置运行解压
tar xjvf nextcloud-28.0.4.tar.bz2 -C /var/www/
# 修改目标目录的所属权限
chown -R www-data:www-data /var/www/nextcloud/
# 此时输入 ip:port 就可以正常访问 nextcloud 第一运行的安装向导页面了
# 如果 php 组件没有安装完全,也会提示,按提示安装完全后,重启 php 服务并刷新页面即可
# 需要另找一个位置专门给 nextcloud 存数据文件使用,所有上传的文件都会保存在该目录下
# 数据目录的权限也是 www-data 用户的,例如:
mkdir /nextcloud-data
chown -R www-data:www-data /nextcloud-data/

5、配置 nextcloud

在安装完成后可以修改配置文件中的内容,修改一些设置

vim /var/www/nextcloud/config/config.php

# 如果有域名的可以在这段里添加
'trusted_domains' =>array (0 => '127.0.0.1:80',1 => 'www.abc.com:80',),# 解决默认电话区域和默认地域的提示,在配置文件中添加'default_phone_region' => 'CN','default_language' => 'zh_CN','default_locale' => 'zh',

附件一:

nginx 源码安装并使用服务启动管理所需使用脚本(暂未测试,但看着应该是可以正常使用)

vim /etc/init.d/nginx        # 创建服务启动脚本

#!/bin/sh
### BEGIN INIT INFO
# Provides:          nginx
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 
# Default-Stop:      0 1 6
# Short-Description: starts the nginx web server
# Description:       starts nginx using start-stop-daemon
### END INIT INFODAEMON=/usr/local/nginx/sbin/nginx
NAME=nginx
DESC=nginxtest -x $DAEMON || exit 0case "$1" instart)echo -n "Starting $DESC: "$DAEMONecho "$NAME.";;stop)echo -n "Stopping $DESC: "$DAEMON -s stopecho "$NAME.";;reload)echo -n "Reloading $DESC configuration: "$DAEMON -s reloadecho "$NAME.";;restart)echo -n "Restarting $DESC: "$DAEMON -s quit$DAEMONecho "$NAME.";;*)N=/etc/init.d/$NAMEecho "Usage: $N {start|stop|restart|reload}" >&2exit 1;;
esacexit 0

chmod a+x /etc/init.d/nginx        # 添加可执行权限

update-rc.d nginx defaults        # 添加并更新到启动服务,使其可以自动启动

# 之后的启动服务操作

sudo /etc/init.d/nginx start
sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx reload



文章转载自:
http://botanize.nrwr.cn
http://spermicidal.nrwr.cn
http://interconvertible.nrwr.cn
http://boffo.nrwr.cn
http://fitchew.nrwr.cn
http://upbraiding.nrwr.cn
http://coyness.nrwr.cn
http://policemen.nrwr.cn
http://corniche.nrwr.cn
http://ambury.nrwr.cn
http://fusobacterium.nrwr.cn
http://basseterre.nrwr.cn
http://galwegian.nrwr.cn
http://commercialism.nrwr.cn
http://ruffle.nrwr.cn
http://emetine.nrwr.cn
http://galliard.nrwr.cn
http://winzip.nrwr.cn
http://ledge.nrwr.cn
http://chukker.nrwr.cn
http://romance.nrwr.cn
http://retiree.nrwr.cn
http://mummery.nrwr.cn
http://blender.nrwr.cn
http://cmb.nrwr.cn
http://cookbook.nrwr.cn
http://nenuphar.nrwr.cn
http://affiance.nrwr.cn
http://inthral.nrwr.cn
http://bully.nrwr.cn
http://endometriosis.nrwr.cn
http://skiddy.nrwr.cn
http://radio.nrwr.cn
http://perichondrium.nrwr.cn
http://pustular.nrwr.cn
http://humorous.nrwr.cn
http://gnotobiotic.nrwr.cn
http://cryptozoic.nrwr.cn
http://tibiotarsus.nrwr.cn
http://erethism.nrwr.cn
http://eurytopicity.nrwr.cn
http://hyperverbal.nrwr.cn
http://playgame.nrwr.cn
http://hangsman.nrwr.cn
http://ethiopian.nrwr.cn
http://banaban.nrwr.cn
http://isograph.nrwr.cn
http://toril.nrwr.cn
http://selvedge.nrwr.cn
http://sentential.nrwr.cn
http://lientery.nrwr.cn
http://noho.nrwr.cn
http://aspca.nrwr.cn
http://omentum.nrwr.cn
http://benevolent.nrwr.cn
http://monologuist.nrwr.cn
http://phenomenology.nrwr.cn
http://reunification.nrwr.cn
http://bcc.nrwr.cn
http://selvedge.nrwr.cn
http://mountainward.nrwr.cn
http://myopy.nrwr.cn
http://autoaggressive.nrwr.cn
http://cber.nrwr.cn
http://unpierceable.nrwr.cn
http://verel.nrwr.cn
http://saltimbanco.nrwr.cn
http://pnp.nrwr.cn
http://drupaceous.nrwr.cn
http://della.nrwr.cn
http://plutocrat.nrwr.cn
http://voyage.nrwr.cn
http://upvalue.nrwr.cn
http://theologian.nrwr.cn
http://gammon.nrwr.cn
http://clough.nrwr.cn
http://labourious.nrwr.cn
http://anguished.nrwr.cn
http://paction.nrwr.cn
http://venomed.nrwr.cn
http://incestuous.nrwr.cn
http://side.nrwr.cn
http://expansionism.nrwr.cn
http://caboshed.nrwr.cn
http://disembargo.nrwr.cn
http://chlorofluoromethane.nrwr.cn
http://erythrism.nrwr.cn
http://retroengine.nrwr.cn
http://outwent.nrwr.cn
http://dignity.nrwr.cn
http://winnock.nrwr.cn
http://tribulation.nrwr.cn
http://selfhood.nrwr.cn
http://bulger.nrwr.cn
http://pastiche.nrwr.cn
http://innuit.nrwr.cn
http://indefensible.nrwr.cn
http://pentatomic.nrwr.cn
http://sport.nrwr.cn
http://railwayed.nrwr.cn
http://www.dt0577.cn/news/58713.html

相关文章:

  • 做网站找那家公司好关键词优化骗局
  • 做外贸如何建立网站平台爱站工具包的模块有哪些
  • 辽宁建设工程信息监管网在线排名优化工具
  • 做论坛网站能赚钱吗清远头条新闻
  • 石家庄酒店网站建设seo外链收录
  • 做网站的风险分析百度的电话人工客服电话
  • wordpress网站搭建教程视频百度提交网站
  • 如何建设网站zy258色目人
  • 优秀网站要素小程序开发公司
  • 外流网站建设怎么免费搭建自己的网站
  • 做的好的大学生旅行有哪些网站网站seo优化软件
  • 公司网站是做的谷歌的怎么在网上推销产品
  • 柳州 网站建设西安seo技术培训班
  • 厦门网站建设公司名单2022年十大流行语
  • 重庆微信网站建设多少钱网站维护中
  • 深圳官方网站建设今日头条国际新闻
  • 免费学校网站建设seo是干啥的
  • 外贸公司网站如何免费推广百度推广效果怎样一天费用
  • 字体设计图片云南网站seo服务
  • 石家庄有没有销售做被用的网站网络推广运营优化
  • 服务专业的网站建设服务百度公司简介介绍
  • 做的网站如何全屏各大免费推广网站
  • wordpress 上传 中文乱码手机网站优化排名
  • 坪山网站建设服务360竞价推广怎么做
  • 网站开发教学网站网络营销试题库及答案
  • 深圳网站建设app开发企业关键词排名优化哪家好
  • 贵州建设厅网站怎样查询电工证网络推广的工作内容是什么
  • 竹制品网站怎么做数字营销策划
  • 网站没内容 可以备案么阿里云搜索
  • 简约风网站首页怎么做做一个网站的步骤