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-1655

Brian Lyttle's questions

Martin Hope
Brian Lyttle
Asked: 2013-08-19 20:02:17 +0800 CST

为什么 nginx 在 vagrant 下不服务我的 404 页面?

  • 0

我在 /404/index.html 有一个带有 404 页面的静态 HTML 站点。Vagrant 正在将端口 80 映射到 9000,因此我可以在http://localhost:9000. 该站点是可浏览的,但如果我尝试强制执行 404 错误,我会看到 /index.html。我试过遵循一堆教程,但它总是最终显示索引页面。

如果我这样做了,vagrant ssh我也有同样的经历。唯一的区别是我可以curl http://localhost/404/看到 404 页面的内容。Ansible{{ }}在配置期间扩展模板项的值。

默认(网站模板)

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root {{ web_root }};
    index index.html index.htm;

    # Make site accessible from `http://localhost/`
    server_name localhost;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ /index.html;
        # Uncomment to enable naxsi on this location
        # include /etc/nginx/naxsi.rules
    }

    location /doc/ {
        alias /usr/share/doc/;
        autoindex on;
        allow 127.0.0.1;
        allow ::1;
        deny all;
    }

    # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
    #location /RequestDenied {
    #   proxy_pass http://127.0.0.1:8080;
    #}

    error_page 400 404 /404/index.html;
    location = /404/index.html {
        root {{ web_root }};
    }



    # redirect server error pages to the static page /50x.html
    #
    #error_page 500 502 503 504 /50x.html;
    #location = /50x.html {
    #   root /usr/share/nginx/html;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #   fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #   # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    #
    #   # With php5-cgi alone:
    #   fastcgi_pass 127.0.0.1:9000;
    #   # With php5-fpm:
    #   fastcgi_pass unix:/var/run/php5-fpm.sock;
    #   fastcgi_index index.php;
    #   include fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #   deny all;
    #}
}

nginx.conf

user www-data;
worker_processes {{ ansible_processor_count }};

pid /var/run/nginx.pid;

events {
    worker_connections {{ connections }} ;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # If HTTPS, then set a variable so it can be passed along.
    ##

    map $scheme $server_https {
        default off;
        https on;
    }

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
nginx
  • 1 个回答
  • 1623 Views
Martin Hope
Brian Lyttle
Asked: 2013-08-19 18:18:40 +0800 CST

如何启用 Ansible 和 Vagrant 的额外调试输出?

  • 44

我正在调查 Ansible 的服务器和应用程序配置。我的应用程序当前在 Vagrant 中配置了 shell 脚本。我没有重写我的脚本,而是取了一个样本并尝试部署它。

它似乎部署得很好,但是在一系列成功的步骤之后,我看到了一条失败消息:

» vagrant provision                                       ~/vm/blvagrant 1 ↵
[default] Running provisioner: ansible...

PLAY [web-servers] ************************************************************

GATHERING FACTS ***************************************************************
ok: [192.168.9.149]

TASK: [install python-software-properties] ************************************
ok: [192.168.9.149] => {"changed": false, "item": ""}

TASK: [add nginx ppa if it ubuntu 10.04 and up] *******************************
ok: [192.168.9.149] => {"changed": false, "item": "", "repo": "ppa:nginx/stable", "state": "present"}

TASK: [update apt repo] *******************************************************
ok: [192.168.9.149] => {"changed": false, "item": ""}

TASK: [install nginx] *********************************************************
ok: [192.168.9.149] => {"changed": false, "item": ""}

TASK: [copy fixed init for nginx] *********************************************
ok: [192.168.9.149] => {"changed": false, "gid": 0, "group": "root", "item": "", "mode": "0755", "owner": "root", "path": "/etc/init.d/nginx", "size": 2321, "state": "file", "uid": 0}

TASK: [service nginx] *********************************************************
ok: [192.168.9.149] => {"changed": false, "item": "", "name": "nginx", "state": "started"}

TASK: [write nginx.conf] ******************************************************
ok: [192.168.9.149] => {"changed": false, "gid": 0, "group": "root", "item": "", "mode": "0644", "owner": "root", "path": "/etc/nginx/nginx.conf", "size": 1067, "state": "file", "uid": 0}

PLAY RECAP ********************************************************************
192.168.9.149              : ok=8    changed=0    unreachable=0    failed=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

如何获取额外的调试信息?我已经添加ansible.verbose = true到我的 vagrant 配置中,这导致字典显示在上面的输出中。

configuration-management
  • 2 个回答
  • 52251 Views
Martin Hope
Brian Lyttle
Asked: 2009-06-16 17:50:19 +0800 CST

为什么我必须用 visudo 编辑 /etc/sudoers?

  • 53

我注意到 sudoers 文件和 cron 配置文件与 Linux 上的其他配置文件相比以一种特殊的方式运行。它们需要使用特殊的包装器而不是任何文本编辑器进行编辑。为什么是这样?

linux unix security sudo configuration
  • 2 个回答
  • 9599 Views
Martin Hope
Brian Lyttle
Asked: 2009-05-15 09:16:11 +0800 CST

MySQL 连接安全

  • 3

我有 2 台 Windows 2003 服务器。一种是使用 Microsoft 的 FastCGI 扩展和 PHP 运行 IIS。另一台服务器正在运行 MySQL 5.1。我想在 IIS 服务器上设置一些 PHP 应用程序,并让它们在第二台服务器上使用数据库。

  • 我需要做什么来加密 MySQL 级别的服务器之间的网络通道/协议?
  • 这是 MySQL 免费版的内置功能,还是我需要付费版本?
  • 如果我从运行 MySQL 的 Windows 服务器迁移到 Linux 服务器,配置是否相同?

我知道我可以在网络堆栈的较低级别使用其他类型的加密和措施,但想知道 MySQL 提供什么。

mysql networking security
  • 3 个回答
  • 233 Views
Martin Hope
Brian Lyttle
Asked: 2009-05-06 18:44:25 +0800 CST

我可以使用 RSync 将 Vista 计算机可靠地备份到 Linux 服务器吗?

  • 1

我有一台使用标准用户帐户运行 Vista x64 的计算机,但我可以提升为管理员来安装服务或 RSync 软件。我想通过数据驱动器 (d:) 备份到运行 Ubuntu 的服务器。如何使用 RSync 可靠地做到这一点?

backup linux ubuntu windows-vista rsync
  • 3 个回答
  • 594 Views
Martin Hope
Brian Lyttle
Asked: 2009-05-06 18:38:27 +0800 CST

装有 OS X 10.5 (Leopard) 的 Mac 能否通过 Windows 2008 域进行身份验证?

  • 7

我想让我的 MacBook Pro 针对在 Windows 2008 上运行的 Active Directory 进行身份验证。几年前,我尝试在 OS X 10.4 和 Windows 2003 之间进行设置,但没有成功。详细的分步指南和有关域安全策略的陷阱列表会很棒。

mac-osx active-directory authentication apple
  • 2 个回答
  • 1451 Views
Martin Hope
Brian Lyttle
Asked: 2009-05-05 19:23:29 +0800 CST

有没有一种工具可以让最终用户管理 Active Directory 中的属性?

  • 7
锁定。这个问题及其答案被锁定,因为这个问题离题但具有历史意义。它目前不接受新的答案或交互。

Active Directory 中的某些属性(例如经理和电话号码)会很快过时。是否有可以帮助管理这些领域的开源或廉价工具?我正在寻找非技术人员可以使用的东西,所以它必须是安全的。

active-directory user-management attributes
  • 5 个回答
  • 517 Views
Martin Hope
Brian Lyttle
Asked: 2009-05-05 19:20:25 +0800 CST

如何将 Windows 2008 域控制器迁移到另一台计算机?

  • 4

我有单个服务器充当域控制器。它运行的是 Windows 2008 标准版。将此域迁移到另一台运行 Windows 2008 的计算机需要哪些步骤?我想要一份详细列表,列出所有必需的步骤和任何问题。

windows-server-2008 domain-controller active-directory
  • 2 个回答
  • 5242 Views
Martin Hope
Brian Lyttle
Asked: 2009-05-04 10:51:23 +0800 CST

如何在不同的操作系统上设置 HOSTS 文件?

  • 7

请提供如何在各种操作系统的客户端和服务器版本上进行设置的示例。

domain-name-system networking hosts multi-platform
  • 2 个回答
  • 463 Views
Martin Hope
Brian Lyttle
Asked: 2009-05-03 10:08:29 +0800 CST

将 Ubuntu 8.10 服务器升级到最新版本是否安全?

  • 6

服务器正在运行 Apache、Subversion 和 Atlassian Confluence。这可以安全升级吗?如果可以,命令行是什么?我想继续使用该平台的更新版本,但尽可能少给自己带来问题。

ubuntu
  • 7 个回答
  • 424 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