AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-81774

jdog's questions

Martin Hope
jdog
Asked: 2021-01-11 13:53:10 +0800 CST

Ansible 在一组服务器上运行某些任务,在另一组服务器上运行其他任务

  • 2

我正在将一组网站从一个基础架构迁移到另一个基础架构,包括相当慢的 rsync 操作。迁移过程包括对源系统和目标系统的更改。

由于该过程的一部分 rsync 操作相当慢,我正在循环一个包含每个网站详细信息的 var 文件,然后运行一次移动一个网站所需的任务。

我无法找到一种方法来针对源系统中的一些任务和目标系统中的一些任务。我已经尝试通过添加主机来做到这一点:每个任务:(所有任务都在一个角色中)

我的剧本:

---
- hosts:
    - tag_aws_autoscaling_groupName_thename
    - tag_Name_server_name
  vars_files:
    - group_vars/all

  roles:
   - unmigratesite

取消迁移站点角色:

---

- include_tasks: "unmigrateonesite.yml"
  loop: "{{ wordpress_websites }}"

unmigrateonesite.yml:

- name: rsync site
  hosts: tag_aws_autoscaling_groupName_thename
  shell: rsync -avz /efs/www/{{new_folder}}/htdocs/ 172.31.18.217:/www/{{item.folder}}
  run_once: true
  register: rsync_out

- name: setup proxy host file
  template: src=proxy-host.j2 dest=/efs/nginx/sites-available/{{item.name}} owner=root group=root mode=0644
  hosts: tag_aws_autoscaling_groupName_thename
  notify:
    - restart nginx
  tags:
    - site
    - nginx-host-conf
    - nginx-temp-proxy

- name: setup wp-config.php WP_CONTENT_DIR on old server
  lineinfile: name=/www/{{ folder }}/{{ configuration_file }} regexp=WP_CONTENT_DIR line="define('WP_CONTENT_DIR', '/www/{{folder}}/app');"
  hosts: tag_Name_server_name
  ignore_errors: yes
  tags:
    - wp-config.php
    - wordpress
    - site
    - WP_CONTENT_DIR

但是我收到一个错误:

    fatal: [54.219.216.237]: FAILED! => {"reason": "conflicting action statements: shell, hosts\n\nThe error appears to be in '/Users/jd/projects/bizinconline/ansible/roles/unmigratesite/tasks/unmigrateonesite.yml': line 22, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: rsync site\n  ^ here\n"}
    fatal: [54.193.100.223]: FAILED! => {"reason": "conflicting action statements: shell, hosts\n\nThe error appears to be in '/Users/jd/projects/bizinconline/ansible/roles/unmigratesite/tasks/unmigrateonesite.yml': line 22, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: rsync site\n  ^ here\n"}
    fatal: [13.57.52.221]: FAILED! => {"reason": "conflicting action statements: shell, hosts\n\nThe error appears to be in '/Users/jd/projects/bizinconline/ansible/roles/unmigratesite/tasks/unmigrateonesite.yml': line 22, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: rsync site\n  ^ here\n"}

正好 3 次 - 与主机数量一样多。

如何对一组服务器运行一些任务,而对另一组服务器运行一些任务?

ansible ansible-playbook
  • 2 个回答
  • 2131 Views
Martin Hope
jdog
Asked: 2019-07-18 14:13:01 +0800 CST

php-fpm 未以池中指定的用户身份运行

  • 1

我有一个安装了 nginx 和 php-fpm (7.2) 的 Ubuntu18.04 Web 服务器。

有 6 个池,每个池都有自己的用户和组:

/etc/php/7.2/fpm# grep -r ^user * 
php.ini:user_dir =
pool.d/dev3.website.com.conf:user = dev3_app
pool.d/dev1.website.com.conf:user = dev1_app
pool.d/dev4.website.com.conf:user = dev4_app
pool.d/dev6.website.com.conf:user = dev6_app
pool.d/dev5.website.com.conf:user = dev5_app
pool.d/dev2.website.com.conf:user = dev2_app

/etc/php/7.2/fpm# grep -r ^group * 
pool.d/dev3.website.com.conf:group = dev3_app
pool.d/dev1.website.com.conf:group = dev1_app
pool.d/dev4.website.com.conf:group = dev4_app
pool.d/dev6.website.com.conf:group = dev6_app
pool.d/dev5.website.com.conf:group = dev5_app
pool.d/dev2.website.com.conf:group = dev2_app

每个站点都运行一个 laravel 应用程序,存储目录使组可写:

/var/www/dev3.website.com# ls -la
total 2236
drwxr-xr-x  20 root dev3_app    4096 Jul 17 21:39 .
drwxr-xr-x   9 root root        4096 Jul 17 21:33 ..
...
drwxrwxr-x   7 root dev3_app    4096 Jul 17 21:29 storage

nginx 通过 TCP 端口连接:

server {
    listen         80;
    server_name    dev3.website.com;

    root /var/www/dev3.website.com/public;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }

        fastcgi_pass 127.0.0.1:9001;
        fastcgi_index index.php;

        # include the fastcgi_param setting
        include fastcgi_params;

        # SCRIPT_FILENAME parameter is used for PHP FPM determining
        #  the script name. If it is not set in fastcgi_params file,
        # i.e. /etc/nginx/fastcgi_params or in the parent contexts,
        # please comment off following line:
        fastcgi_param  SCRIPT_FILENAME   
        $document_root$fastcgi_script_name;
    }
}

有了这个配置,我得到

The stream or file "/var/www/dev3.website.com/storage/logs/laravel-2019-07-17.log" could not be opened: failed to open stream: Permission denied

当我在存储目录上运行 chmod a+w 时,它可以工作。

我还运行了 ps -ef |grep php:

root      2468     1  0 00:53 ?        00:00:05 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf)
root     11897 10961  0 22:12 pts/0    00:00:00 grep --color=auto php 
ubuntu
  • 1 个回答
  • 1779 Views
Martin Hope
jdog
Asked: 2019-04-10 13:58:33 +0800 CST

通过 NFS 同步用户

  • 1

我正在实现一个 Web 服务器,其中配置和用户文件通过 NFS (Amazon EFS) 共享,如下所述: https ://serverfault.com/a/933566/81774

作为我的 Apache 配置的一部分,我使用 mod_mpm_itk 以不同的用户名运行网站。如何在服务器之间同步用户名,而无需将新用户名烘焙到 Web 服务器 AMI。

我假设我不能只是将 /etc/passwd 移动到 NFS,因为如果没有安装 NFS,服务器将无法启动?

根据评论更新:

似乎没有办法使用 nsswitch.conf 加载其他文件,只能根据此答案查询其他服务:https ://unix.stackexchange.com/a/210587

附加服务的缺点是引入了额外的故障点。

当服务器启动时从 NFS 复制 /etc/passwd 并使用 pwck 重新读取它是否是一个可行的选项,如此处所述https://unix.stackexchange.com/a/102336?

nfs
  • 2 个回答
  • 575 Views
Martin Hope
jdog
Asked: 2019-03-28 00:40:38 +0800 CST

多台服务器的 AWS 自动缩放堆栈

  • 0

我有 2 个 AWS 实例堆栈,在一个链中运行 3 个服务器:

  • (服务器 1)Apache2 和 PHP-FPM
  • (服务器 2)Varnish + Nginx 用于 SSL 终止

这些服务器是分开的,因为我希望 Apache 服务器受 CPU 限制,而另一台服务器受内存限制。

我现在想利用 Auto Scaling 来实现冗余和成本效率。共享的 EFS 文件系统将保存网站文件以及此处建议的配置https://serverfault.com/a/933566/81774服务器配置已使用 Ansible 进行管理。

目前,我倾向于使用网络负载均衡器来消除将 25 个 SSL 证书分别映射到负载均衡器的需要。

我找不到记录在案的方式来启动多个服务器作为自动扩展的一部分,以便在扩展或失败时重新创建我的 2 台服务器堆栈。

如果没有这样的方法,我是否会更好:

a) 将 2 个实例合并为一个,存在内存被 Varnish 和 PHP 竞争的风险

或者

b) 创建固定数量的 SSL/Varnish 服务器,这些服务器不自动缩放,仅缩放 Apache 服务器。

amazon-web-services
  • 1 个回答
  • 277 Views
Martin Hope
jdog
Asked: 2019-01-30 13:20:44 +0800 CST

nginx 代理到 apache - 未记录远程 IP

  • 2

我有 nginx 终止网站并使用 PHP-FPM 将它们代理到 Apache。我正在尝试在 apache 日志中记录客户端 IP,但似乎无法使其正常工作。

nginx配置

server {
  listen         80;
  server_name    www.website.com;

  location ^~ /.well-known/acme-challenge/ {
      alias /var/www/dehydrated/;
  }

  location / {
      return         301 https://$server_name$request_uri;
  }
}

server {
  listen 443 ssl http2;
  server_name www.website.com;

  location / {
      proxy_pass http://1.2.3.4:80;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_read_timeout 600;
      proxy_buffer_size   128k;
      proxy_buffers   4 256k;
      proxy_busy_buffers_size   256k;
      client_max_body_size 100M;
  }

  location ~ /\.ht {
      deny all;
  }

  ssl_certificate_key /etc/nginx/ssl/www.website.com/privkey.pem;
  ssl_certificate /etc/nginx/ssl/www.website.com/fullchain.pem;
  ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
  ssl_prefer_server_ciphers on;
  ssl_dhparam /etc/nginx/ssl/dhparams.pem;
}

阿帕奇配置

  <VirtualHost *:80>

    ServerName www.website.com
    ServerAlias origin.www.website.com

    ServerAdmin [email protected]

    DocumentRoot /var/www/www.website.com/trunk

    <IfModule mpm_itk_module>
          AssignUserId www_arenz www_arenz
    </IfModule>
    CustomLog /var/www/www.website.com/apachelogs/www.website.com-access.log combined
    ErrorLog /var/www/www.website.com/apachelogs/www.website.com-error.log

      <FilesMatch "\.php$">
          CGIPassAuth on
          SetHandler "proxy:fcgi://127.0.0.1:9115/
      </FilesMatch>

      RemoteIPHeader X-Real-IP
      RemoteIPTrustedProxy 2.3.4.5/32


  </VirtualHost>

Apache日志总是显示2.3.4.5作为客户端的IP地址,也就是nginx的公网IP地址

nginx
  • 2 个回答
  • 3142 Views
Martin Hope
jdog
Asked: 2018-10-02 19:53:16 +0800 CST

AWS 自动扩展共享 Wordpress Web 服务器 - AMI 与用户脚本

  • 1

我有一个共享的 Wordpress 托管服务器,上面有大约 50 个站点,它是通过 Ansible 完全配置的。

我试图在两者之间找到一个好的界限

a) 每次添加站点或更改配置时更新 AMI,例如这会影响虚拟主机和 PHP 池文件

b) 使用自定义启动脚本运行其中一些配置更改,并在实例接收来自负载均衡器的流量之前在启动时给予更多时间

目前只有一个实例,可能暂时不需要自动伸缩来应对流量的巨大变化。相反,如果实例在数小时内失败,则需要使用 Auto Scaling 来自动替换实例。

根据我目前良好成本管理的规模,我最好在晚上运行一个 c5.large,并在白天安排 2 个 c5.large 的自动缩放,这将使我以相同的成本获得多可用区可靠性的额外好处单个 c5.xlarge

我计划使用 EFS 共享所有 Wordpress 文件,并可能使用 Redis 进行共享会话管理,但这不是这个问题的主题。

我对解决方案 a) 的担忧是,每次添加新站点、创建临时站点或需要任何其他配置更改时,我都需要创建一个新实例、进行更改、创建一个 AMI 并将 AMI 轮换到我的自动缩放中团体。即使完全自动化,我预计这需要很长时间才能达到可接受的周转速度。

相反,我可以在少数实例上进行这些更改并以编程方式更新 AMI。然后它只会被使用 - 在失败场景中或 - 当正在完成恢复测试时或 - 当在测试堆栈上测试开发时

这是管理共享主机环境的好方法吗?

amazon-web-services
  • 1 个回答
  • 217 Views
Martin Hope
jdog
Asked: 2018-08-01 20:14:30 +0800 CST

然后用 Apache for Cloudfront 重写 Basic Auth

  • 1

我有一个网站,所有页面都通过 AWS Cloudfront(现在 TTL 为 0)。

站点域是 www.example.com,它是云端分发的 CNAME。然后,Cloudfront 使用 origin.www.example.com 从我的 Web 服务器请求该站点,并为身份验证添加自定义标头。

但是现在我还需要将基本身份验证添加到站点,直到它启动。我已经通过在 RewriteCond 中使用 LA-U:REMOTE_USER 进行了尝试

此配置有效,但没有 Auth:

<VirtualHost *:80>

    ServerName www.example.com
    ServerAlias www.example.com

    ServerAdmin [email protected]

    DocumentRoot /var/www/www.example.com/trunk

    <IfModule mpm_itk_module>
        AssignUserId www_site www_site
    </IfModule>

    <LocationMatch "^(.*\.php)$">
        ProxyPass fcgi://127.0.0.1:9154/var/www/www.example.com/trunk
    </LocationMatch>

    Alias "/robots.txt" "/var/www/norobots.txt"

    <Directory /var/www/www.example.com>
        RewriteEngine on
        RewriteCond  %{HTTP:X-PSK-Auth}  !^mypassword$
        RewriteRule  .* - [F]
    </Directory>

    CustomLog /var/www/www.example.com/apachelogs/www.example.com-access.log combined
    ErrorLog /var/www/www.example.com/apachelogs/www.example.com-error.log

</VirtualHost>
curl http://cxcglobal.demonow.website/

返回站点 HTML。还

curl --header "X-PSK-Auth:mypassword" "http://cxcglobal.demonow.website/

返回站点源代码。

但是,当我将配置修改为

<VirtualHost *:80>

    ServerName www.example.com
    ServerAlias origin.www.example.com

    ServerAdmin [email protected]

    DocumentRoot /var/www/www.example.com/trunk

    <IfModule mpm_itk_module>
        AssignUserId www_site www_site
    </IfModule>

    <LocationMatch "^(.*\.php)$">
        ProxyPass fcgi://127.0.0.1:9154/var/www/www.example.com/trunk
    </LocationMatch>

    Alias "/robots.txt" "/var/www/norobots.txt"

    <Directory /var/www/www.example.com>
        RewriteEngine on
        RewriteCond  %{HTTP:X-PSK-Auth}  !^mypassword$
        RewriteRule  .* - [F]

        RewriteCond %{LA-U:WxLaRwvCQ2yAf5KJREMOTE_USER} !^$
        RewriteRule ^/(.*) http://origin.www.example.com/$1   [P,L]

        AuthUserFile /etc/apache2/staging.passwd
        AuthType Basic
        AuthName "Review security udpates"
        Require valid-user

        LogLevel alert rewrite:trace3

    </Directory>

    CustomLog /var/www/www.example.com/apachelogs/www.example.com-access.log combined
    ErrorLog /var/www/www.example.com/apachelogs/www.example.com-error.log

</VirtualHost>

我收到一个错误:

curl http://www.example.com/
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at origin.www.example.com Port 80</address>
</body></html>

对于两个 curl 请求。我在特定于站点的错误日志中没有错误,在全局 apache 错误日志中也没有错误。我也找不到重写日志的任何条目。

rewrite
  • 1 个回答
  • 690 Views
Martin Hope
jdog
Asked: 2016-12-30 00:50:26 +0800 CST

链式网络问题/ MTU 大小

  • 2

我有一个连接到 Internet 的设备链:

  1. 金属棚中的 Draytek 2120n-plus 光纤路由器 - 互联网连接
  2. TP-Link AV500 电力线适配器
  3. Draytek 2760 VDSL 路由器,用作无线集线器
  4. Linksys SPA2102 VOIP 路由器

这些设备在没有我记得的任何特殊设置的情况下链接在一起。VOIP 路由器是根据我的 VOIP 提供商指南配置的:http: //blog.2talk.co.nz/spa2102.html

通常,当计算机通过 Wifi 连接到 1. 或 3. 时,它们工作得很好。但是在 3. 我发现浏览、Skype、SSH 会话和任何其他应用程序经常“停止”。大约 30-90 秒内似乎没有数据流动,之后一切恢复正常。这种情况每 10 分钟左右发生一次。

为了解决这个问题,我将 3. 的 MTU 降低到 1300。这似乎解决了停滞问题,但是我现在不能再使用 VOIP 设备,我没有拨号音,也没有任何振铃。

Internet 搜索表明 SPA 2102 路由器中没有 MTU 设置。

我也找不到电力线以太网的任何 MTU 大小,所以我假设它在 1500 的 MTU 上运行?

我将如何确定合适的 MTU 是什么,我想应该是 1492,但显然我也想消除停顿

有关其他网络设备的一些信息:

    1. 有一个简单的开关,连接着 1-2 台电脑和一台打印机,但开关不在 1. 和 2 之间。
    1. 通常有 2 部手机通过 Wifi 连接,有时还有 2 台电脑。
mtu
  • 2 个回答
  • 793 Views
Martin Hope
jdog
Asked: 2016-09-01 00:24:50 +0800 CST

scp 9.2GB 文件始终锁定 AWS EC2 t2.small 实例

  • 1

我有一个 9.2GB 的文件,我想将它传输到我的 AWS t2.small 实例中以进行备份。当我启动 scp 时,它以大约每秒 3.4MB 的速度复制文件,这导致大约 45 分钟的预期传输时间。

一段时间后,实例总是锁定。我不能再在终端窗口中输入任何内容,网站停止(它是一个网络服务器)并且我无法连接到它。重启实例即可解决问题。

我调查了 EBS 限制:我连接了 2 个 RAID10 200GB gp2 磁盘。从这个文档中我看不到我超过了磁盘的 IOPS 或吞吐量。我还检查了bandwidth,但在其中看不到有关 t2 实例的任何信息。最后我查看了CPU credits,但大概它不应该完全停止?

这是一次性转移,所以我想知道我必须减慢转移多少才能使其安全发生。同时,我想了解管理此 Web 服务器的限制。

amazon-ec2 amazon-web-services amazon-ebs
  • 2 个回答
  • 316 Views
Martin Hope
jdog
Asked: 2012-12-28 21:25:18 +0800 CST

crontab 只运行第二行

  • 1

我有 /etc/cron.d/remote-server-backup 如下:

***starts***
MAILTO="[email protected]"
23 1,7,13,19 * * * root /usr/local/bin/backup-server nzs1.automatem.co
43 2,8,14,20 * * * root /usr/local/bin/backup-server nzs2.automatem.co

***ends***

该脚本是自定义编写的,并使用 rsync 执行增量备份。

我发现 nzs2.automatem.co 脚本每 6 小时运行一次,nzs1.automatem.co 脚本从不运行。我在 [email protected] 上没有收到任何电子邮件。当我从命令行 nzs1.automatem.co 运行时,它会正确执行备份。

我的环境是 Ubuntu 12.04 LTS。

如何让第一行自动运行?

cron
  • 1 个回答
  • 179 Views
Martin Hope
jdog
Asked: 2012-12-04 10:55:22 +0800 CST

ec2 实例没有启动

  • 1

我有一个 EBS 支持的 EC2 实例,它无法启动系统日志显示:

    [    0.881605] Write protecting the kernel read-only data: 1196k

    Loading, please wait...

        %GCouldn't get a file descriptor referring to the console
    Couldn't get a file descriptor referring to the console
    Couldn't get a file descriptor referring to the console
    Couldn't get a file descriptor referring to the console
    Couldn't get a file descriptor referring to the console
    Couldn't get a file descriptor referring to the console
    Couldn't get a file descriptor referring to the console
    Begin: Loading essential drivers... ...
    [    1.006136] fuse init (API version 7.12)

    Done.
    Begin: Running /scripts/init-premount ...
    Done.
    Begin: Mounting root file system... ...
    Begin: Running /scripts/local-top ...
    Done.
    Begin: Waiting for root file system... ...
    Done.
    Begin: Running /scripts/local-premount ...
    Done.
    [    1.320965] kjournald starting.  Commit interval 5 seconds

    [    1.320984] EXT3-fs: mounted filesystem with writeback data mode.

    Begin: Running /scripts/local-bottom ...
    Done.
    Done.
    Begin: Running /scripts/init-bottom ...
    Begin: Starting AppArmor profiles ...
    chroot: cannot execute /etc/apparmor/initramfs: No such file or directory
    Failure: AppArmor profiles failed to load
    Done.
    [    3.741464] EXT3-fs warning: checktime reached, running e2fsck is recommended

    [    3.742696] EXT3 FS on sda1, internal journal

    init: console-setup main process (2139) terminated with status 1


        %Ginit: plymouth main process (341) killed by SEGV signal

    init: plymouth-splash main process (2431) terminated with status 2

    init: squid main process (2493) killed by ABRT signal

    cloud-init running: Sun, 02 Dec 2012 20:36:06 +0000. up 5.77 seconds
    init: ureadahead-other main process (2511) terminated with status 4

    swapon: /dev/sda3: swapon failed: Device or resource busy
    mountall: swapon /dev/sda3 [2513] terminated with status 255
    mountall: Problem activating swap: /dev/sda3
    init: ureadahead-other main process (2522) terminated with status 4

    mountall: Disconnected from Plymouth
    Close

这是否意味着我的 sda1 磁盘有问题?我有一个快照,我可以用它来代替。

amazon-ec2
  • 1 个回答
  • 450 Views
Martin Hope
jdog
Asked: 2012-08-16 12:25:05 +0800 CST

xfs 增量备份不适合新磁盘

  • 1

我在 Amazon EBS 上有一个 1TB 的 xfs 卷,其中包含 246GB 的增量备份,使用 rsync 和硬链接创建。我想把它复制到一个新的、更小的磁盘上。

问题是它似乎放不下 300GB 的磁盘。有没有我可以调查的块大小?我最近删除了 700GB 的备份,是否需要清除某些内容?我正在使用 cp -R 在已安装的卷之间进行复制

copy
  • 1 个回答
  • 87 Views
Martin Hope
jdog
Asked: 2012-07-18 20:04:18 +0800 CST

PHP5 会话文件清理永远不会完成

  • 1

我的 Ubuntu 12.04 服务器带有这个 cron 作业,它必须用于清理 PHP 会话文件

find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +24 ! -execdir fuser -s {} ; -delete

在我的文件夹中,目前有大约 1110000 个这样的文件,服务器性能下降,因为清理过程从未完成。服务器在 Xen 平台上是虚拟的。

有没有更高效的方法可用?

ubuntu php apache-2.2 session
  • 1 个回答
  • 1146 Views
Martin Hope
jdog
Asked: 2012-06-03 23:19:50 +0800 CST

Amazon 上的 Ubuntu 12.04 云版 - Apache2 - /etc

  • 1

我在亚马逊上设置了一个带有 3 个虚拟主机的 Web 服务器。出于某种原因,我无法访问任何网站,它们都显示 404 错误。/var/log/apache2/error.log 显示“文件不存在:/etc/apache2/htdocs”

我检查过:

  • a2ensite 我所有的虚拟主机
  • 实际上检查了启用站点的软链接
  • /var/www 中的访问权限为 777,以防用户不是 www-data
  • grep -r htdocs /etc/apache2(不返回任何内容)
  • ports.conf 具有与虚拟主机完全匹配的 NameVirtualHost 指令

这还能是什么?

ports.conf 

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

NameVirtualHost 107.20.169.163:80
Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>


sites-available/www.seleconlight.com


<VirtualHost 107.20.169.163:80>

ServerName www.seleconlight.com
DocumentRoot /var/www/www.seleconlight.com

CustomLog /var/log/apache2/www.seleconlight.com-access.log combined
ErrorLog /var/log/apache2/www.seleconlight.com-error.log

</VirtualHost>
apache-2.2 virtualhost
  • 2 个回答
  • 474 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve