跳转到帖子
  • 篇帖子

    39
  • 篇意见

    10
  • 次查看

    2094

在此博客的帖子

网易:http://hub-mirror.c.163.com 中科大镜像地址:http://mirrors.ustc.edu.cn/ 中科大github地址:https://github.com/ustclug/mirrorrequest Azure中国镜像地址:http://mirror.azure.cn/ Azure中国github地址:https://github.com/Azure/container-service-for-azure-china DockerHub镜像仓库: https://hub.docker.com/  阿里云镜像仓库: https://cr.console.aliyun.com  google镜像仓库: https://console.cloud.google.com/gcr/images/google-containers/GLOBAL (如果你本地可以翻墙的话是可以连上去的 ) coreos镜像仓库: https://quay.io/repository/  RedHat镜像仓库: https://access.redhat.com/contain
Nginx配置文件 server { listen 80; listen [::]:80; server_name www.cxcblog.com ; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/www.cxcblog.com; location ^~ / { proxy_pass http://0.0.0.0:1080; proxy_set_header Host $host; } include rewrite/none.conf; #error_page 404 /404.html; # Deny access to PHP files in specific directory
linux常用的解压和压缩命令如下: 1、.tar 解包: tar xvf FileName.tar 打包:tar cvf FileName.tar DirName (注:tar是打包,不是压缩!) 2、.gz 解压1: gunzip FileName.gz 解压2:gzip -d FileName.gz 压缩: gzip FileName 3、.tar.gz 和 .tgz 解压: tar zxvf FileName.tar.gz 压缩:tar zcvf FileName.tar.gz DirName 4、.bz2 解压1: bzip2 -d FileName.bz2 解压2: bunzip2 FileName.bz2 压缩: bzip2 -z FileName 5、.tar.bz2 解压: tar jxvf FileName.tar.bz2 压缩: tar jcvf FileName.tar.bz2 DirName
location / { proxy_pass http://0.0.0.0:10443; # 设置反向代理到目标地址 proxy_set_header Host $host; # 转发 Host 头 proxy_set_header X-Real-IP $remote_addr; # 转发客户端真实 IP proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 转发客户端 IP proxy_set_header X-Forwarded-Proto $scheme; # 转发协议 }
在 Linux 中,swappiness 是一个内核参数,用于控制系统在使用交换空间(Swap)时的倾向。其值范围为 0 到 100,值越低,系统越倾向于使用物理内存而不是交换空间。将 swappiness 设置为 10 可以减少对交换空间的依赖,适合内存充足的服务器或桌面环境。 调整步骤 1. 临时调整(重启后失效) 执行以下命令临时设置 swappiness 为 10: sudo sysctl vm.swappiness=10 验证设置是否生效: cat /proc/sys/vm/swappiness 2. 永久调整(重启后生效) 编辑系统配置文件: sudo nano /etc/sysctl.conf添加或修改以下行: vm.swappiness=10 保存并退出编辑器,然后使更改生效: sudo sysctl -p 3. 验证修改 再次检查当前的 swappiness 值: cat /proc/sys/vm/swappiness 现在,swappiness 应该被成功设置为 10。
E: Malformed entry 60 in list file /etc/apt/sources.list (Component) E: The list of sources could not be read. 在阿里云上添加了Docker官方的下载源后,升级包(apt-get update)报出如上的错误. 没办法只好注释掉了其中的一个源路径: deb [arch=amd64] https://download.docker.com/linux/ubuntu stable 只留下了: deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable 再次更新源不再报错.
在 Discourse 中,如果你想进入容器内并手动修改某个用户的用户名,你可以通过以下步骤实现。这个操作可以通过使用 rails 控制台在容器内直接修改用户信息。 步骤 1: 进入 Discourse 容器 使用 SSH 登录到你的服务器。 进入 Discourse 的安装目录: cd /var/discourse进入 Discourse 容器: ./launcher enter app这将会把你带入到运行中的 Discourse 容器环境。 步骤 2: 启动 Rails 控制台 在容器内,你需要启动 Rails 控制台来修改用户的用户名: rails c这将启动 Discourse 的 Rails 控制台,你可以在这个环境中直接操作数据库。 步骤 3: 查找并修改用户名 使用以下命令查找要修改的用户: u = User.find_by(username: '旧用户名')将 '旧用户名' 替换为你想修改的用户的当前用户名。如果你想根据用户的电子邮件地址查找用户,可以使用以下命令: u = User.find_by(email: '用户的邮箱')接下来,修改用户的用户名: u.u
sudo -i (切换root用户) sudo passwd root(修改root密码) vim /etc/ssh/sshd_config(编辑配置文件) PermitRootLogin yes(修改为YES) PasswordAuthentication yes(修改为YES) cd /etc/ssh/sshd_config.d(进入目录) vim 60-cloudimg-settings.conf(编辑配置文件) PasswordAuthentication yes(修改为YES) sudo service ssh restart 或 sudo systemctl restart ssh (重启SSH)
#乾坤堂主站 location / { include enable-php-72.conf; index app.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app.php/$1 last; } #乾坤堂论坛 location /bbs { include enable-php-82.conf; try_files $uri $uri/ /bbs/index.php; } location ~^(/bbs/page/).*(.php)$ { include enable-php-82.conf; try_files $uri $uri/ /bbs/index.php; } # location /bbs/api/ { # include enable-php-82.conf; # if (!-e $request_filename){ # rewrite ^/bbs/api/
1. 前期准备 服务器/域名/SMTP邮箱/ 登录到系统: ssh discourse@192.168.0.175 sudo apt update sudo apt upgrade -y 2. 准备部署文件 sudo -s mkdir /var/discourse # 创建/var/discourse目录,所有与Discourse相关的文件都在此目录下。 git clone https://github.com/discourse/discourse_docker.git /var/discourse #将官方Discourse Docker Image复制到/var/discourse cd /var/discourse ls 3. 配置和引导Discourse 从这里,您可以启动安装脚本。 cd /var/discourse ./discourse-setup 您将被问到以下问题: Discourse的主机名? 输入您要用于Discourse的主机名,例如,discourse.test.com,其中discourse.test.com可以用您的域名替换。您需要使用一个域名,因为发送