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

Tristan's questions

Martin Hope
Tristan
Asked: 2020-09-18 00:41:56 +0800 CST

使用 MariaDB 在哪里存储 my.cnf 配置的最佳实践

  • 0

在 Ansible playbook 从MariaDB 10.5.4to运行小更新后MariaDB 10.5.5,自定义配置文件被默认配置静默覆盖,导致服务器拒绝连接,因为不再存在有效的自定义配置。

我们的自定义配置文件存储在/etc/mysql/my.cnf

我的问题是:存储自定义配置的最佳做法是什么,以便在更新出现时它永远不会再被默认配置替换

是/etc/mysql/conf.d/吗?

发行版:Debian 10 与官方存储库一起安装:https://downloads.mariadb.com/MariaDB/mariadb-10.5/repo/debian

mysql mariadb
  • 2 个回答
  • 660 Views
Martin Hope
Tristan
Asked: 2019-07-06 03:05:29 +0800 CST

nginx尝试文件,如果找不到,回退到重写不起作用(重定向循环)

  • 0

我有两种情况:

  • /media/cache/test.jpg或stylesheet/theme/xxxx.css由应用程序生成。它不是文件系统上存在的静态文件。

  • /assets/test.jpg是存在于主机上的静态文件

我希望它们都被添加expires 6M标头的浏览器缓存。

所以我做了:

location / {
    try_files $uri @rewriteapp;
}

location @rewriteapp {
     rewrite ^(.*)$ /index.php/$1 last;
}

location ~ ^/(index)\.php(/|$) {
    fastcgi_pass unix...;
    internal;
}

location ~ \.php$ {
    return 404;
}

# assets, media
location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif)$ {
    expires 6M;
    access_log off;

    # try accessing the file directly, and if not found 
    # it means the application has to generate it, 
    # so reroute to the @rewriteapp rule.
    try_files $uri @rewriteapp;
}

问题是 nginx 检测到一个循环:

*194369 rewrite or internal redirection cycle while redirect to named location "@rewriteapp", client: 127.0.0.1, server: , request: "GET /stylesheet/theme/3441-1484735061.css

请问我错过了什么?

nginx
  • 1 个回答
  • 906 Views
Martin Hope
Tristan
Asked: 2018-03-24 01:28:24 +0800 CST

通配符 www 到非 www 重定向 nginx

  • 1

我想重定向所有流量

www.*.*.<gTLD> 至 *.*.<gTLD>

如果可能的话,我想在为应用程序提供服务的块之外执行此操作。此块不使用 a server_name,因为它在同一个应用程序上侦听 5,000 多个主机名。

您对如何实现这一点有任何想法吗?我找到的所有示例仅适用于命名主机....

谢谢

nginx
  • 2 个回答
  • 1144 Views
Martin Hope
Tristan
Asked: 2017-07-12 07:50:29 +0800 CST

后端生成的nginx缓存图片

  • 0

我的应用程序生成动态内容,我尝试使用浏览器缓存来缓存它们。因此,如果我尝试将以下内容添加到我的服务器块:

location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
    expires 365d;
}

Nginx 不再将请求传递给后端以生成资产,它以 http 结束status code 404

相反,添加以下两个条件可以解决我的问题(取自这个问题):

location / {
    if ($upstream_http_content_type ~ "(image/jpeg)|(image/png)|(image/gif)|(image/svg+xml)|(text/css)|(text/javascript)|(application/javascript)") {
      expires 90d;
    }

    if ($sent_http_content_type ~ "(image/jpeg)|(image/png)|(image/gif)|(image/svg+xml)|(text/css)|(text/javascript)|(application/javascript)") {
      expires 90d;
    }
    try_files $uri @rewriteapp;
}

location @rewriteapp {
    rewrite ^(.*)$ /site.php/$1 last;
}

location ~ ^/(site|site_dev|admin|admin_dev)\.php(/|$) {
    # it's PHP that generates some of my assets
    fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTPS on;
}

问题是我在 http 响应标头中看不到任何表明它正在工作的日期,并且图像将从浏览器缓存中提供 90 天。

我错过了什么?

nginx
  • 1 个回答
  • 2575 Views
Martin Hope
Tristan
Asked: 2016-09-22 00:11:20 +0800 CST

Debian“7”的版本号错误,而不是 8 信息

  • 3

我最近升级到 Jessie,当lsb_release -a它报告版本是 7(而不是 8)和代号 Jessie。

在此处输入图像描述

update && upgrade && dist-upgrade当所有来源都指向 jessie 但没有可用更新时,我做了一个。

我最近升级的另一台服务器报告了第 8 版和代号 Jessie。

如何修复发布号内报告的错误信息?谢谢

debian debian-jessie
  • 1 个回答
  • 435 Views
Martin Hope
Tristan
Asked: 2014-08-14 01:58:23 +0800 CST

在 Debian Wheezy 上从 Debian sid 安装一个软件包?

  • 0

我需要python-statsd仅在Debian (sid)中的。

请问下安装这个包的步骤是什么Debian Wheezy?

debian
  • 1 个回答
  • 293 Views
Martin Hope
Tristan
Asked: 2014-08-11 01:50:43 +0800 CST

varnish 80,nginx 8080,jenkins 放在哪个端口?

  • 3

在我的登台服务器上,我有Varnish+ Nginx。他们在港口80和8080。

鉴于我必须安装jenkins,我必须在哪个端口上绑定它?(通常是 8080 但已经被占用了)

nginx
  • 4 个回答
  • 1267 Views
Martin Hope
Tristan
Asked: 2014-03-10 11:00:21 +0800 CST

虚拟主机似乎不起作用

  • 0

似乎最基本的虚拟主机在 apache 2.2 下不起作用:

# httpd.conf
Listen 80
....
Include /private/etc/apache2/extra/httpd-vhosts.conf

httpd-vhosts:

# httpd-vhosts.conf
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName project.dev
    ServerAlias lol.project.dev
    ServerAlias shootmania.project.dev

    DirectoryIndex "app.php"
    DocumentRoot "/Users/tb/workspace/project/web"
    <Directory "/Users/tb/workspace/project/web">
        AllowOverride All
        Order allow,deny
        Allow from All
    </Directory>

    ErrorLog /var/log/apache2/project_error.log
    CustomLog /var/log/apache2/project_access.log combined
</VirtualHost>

这是 apachectl 的输出:

apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
         default server project.dev (/private/etc/apache2/extra/httpd-vhosts.conf:21)
         port 80 namevhost project.dev (/private/etc/apache2/extra/httpd-vhosts.conf:21)
         port 80 namevhost pow (/private/etc/apache2/other/zzz_pow.conf:1)
Syntax OK

在我的战俘配置中:

<VirtualHost *:80> 
  ServerName pow 
  ServerAlias *.dev 
  ServerAlias *.xip.io 
  ProxyPass / http://localhost:20559/ 
  ProxyPassReverse / http://localhost:20559/ 
  ProxyPreserveHost On 
</VirtualHost>

访问localhost项目网站上的默认值,但访问会http://project.dev 给出 404 Not found

谢谢你的帮助

apache-2.2
  • 2 个回答
  • 153 Views
Martin Hope
Tristan
Asked: 2013-01-12 07:32:57 +0800 CST

防止用户在使用 Varnish(在端口 80 上)时使用端口 8080(apache)访问网站

  • 1

我的配置非常简单:

为了避免重复内容,我想通过直接点击 apache(在端口 8080 上运行)来阻止用户访问我的网站。

我已经设置了一个侦听端口 80 的 Varnish 服务器,所以我只想使用它来避免机器人在不同端口索引同一个网站,这可能会导致重复内容问题。

我在 Debian 6 上使用专用服务器。

我的虚拟主机看起来像:

<VirtualHost *:8080>
    ServerAdmin webmaster@localhost
    ServerName www.seek-team.com

    DocumentRoot ...
    DirectoryIndex app.php

    <Directory "/var/www/seek-team.com/current/web">
        Options -Indexes FollowSymLinks SymLinksifOwnerMatch
        AllowOverride All
        Allow from All
    </Directory>
</VirtualHost>

如何防止用户直接使用8080端口访问网站?(但我仍然需要清漆才能正确命中 apache)。

谢谢。

apache-2.2
  • 3 个回答
  • 6913 Views
Martin Hope
Tristan
Asked: 2012-09-08 04:06:38 +0800 CST

使用 dotdeb 将 mysql-5.1 升级到 5.5 使我的服务器崩溃:/usr/bin/dpkg 返回错误代码 (1)

  • 0

在我的 debian 上,我最近添加了 dotdeb 以使我的 PHP 保持最新

deb ftp://ftp.debian.ikoula.com/debian squeeze main contrib non-free
deb-src ftp://ftp.debian.ikoula.com/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free
deb http://repo.varnish-cache.org/debian/ squeeze varnish-3.0
deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all

我在 15 分钟前做了一个

apt-get dist-upgrademysql从更新5.1到5.5现在我所有的生产 mysql 服务器都崩溃了(无法重新启动):

然后我尝试了 apt-get upgrade 和 apt-get update -f 返回:

    The following packages were automatically installed and are no longer required:
  libhtml-template-perl mysql-server-core-5.1 libgd2-xpm
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  mysql-client-5.5 mysql-client-core-5.5
Suggested packages:
  libterm-readkey-perl
The following packages will be REMOVED:
  mysql-client-5.1
The following NEW packages will be installed:
  mysql-client-5.5 mysql-client-core-5.5
0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/10.4 MB of archives.
After this operation, 11.3 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
(Reading database ... 40695 files and directories currently installed.)
Unpacking mysql-client-core-5.5 (from .../mysql-client-core-5.5_5.5.27-1~dotdeb.0_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/mysql-client-core-5.5_5.5.27-1~dotdeb.0_amd64.deb (--unpack):

 trying to overwrite '/usr/bin/mysql', which is also in package mysql-client-5.1 5.1.63-0+squeeze1
configured to not write apport reports

    dpkg-deb: subprocess paste killed by signal (Broken pipe)

Errors were encountered while processing:
 /var/cache/apt/archives/mysql-client-core-5.5_5.5.27-1~dotdeb.0_amd64.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

为什么这会发生在我身上?谢谢你的帮助。

mysql
  • 1 个回答
  • 1925 Views
Martin Hope
Tristan
Asked: 2012-08-06 02:31:42 +0800 CST

允许访问 iptable 中的 :8080 端口

  • 1

我需要通过端口访问我的网站:8080 但出于某种原因,我不能:

这就是我的iptable -L https://gist.github.com/28e7a48d91e933c6f377

在 serverfault 上搜索之后,我刚刚添加了:

iptables -I INPUT 1 -i lo -p tcp --dport 8080 -j ACCEPT 

没有效果(即使在 iptable 重启之后)

如何允许访问port 8080(本地和外部,因为我要为清漆/apache2 设置的设置)?

编辑似乎在重新启动 iptable 后,允许端口 8080 的规则已经消失:

重启后。

谢谢。

iptables
  • 2 个回答
  • 4535 Views
Martin Hope
Tristan
Asked: 2012-06-12 00:00:02 +0800 CST

spdy 是否要求所有站点都打开 SSL?

  • 2

我有兴趣为 apache2 安装 SPDY mod,以提高我网站的速度/延迟。

我的主要问题是:我的专用服务器上的所有网站都必须切换到 SSL,还是只为启用 SSL 的网站启用 SPDY?

我希望它不会弄乱我所有的生产网站。

apache-2.2 ssl spdy
  • 1 个回答
  • 341 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