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
    • 最新
    • 标签
主页 / server / 问题

问题[windows-subsystem-for-linux](server)

Martin Hope
drzounds
Asked: 2022-02-05 08:47:07 +0800 CST

一段时间后nginx抛出502 Bad Gateway

  • 0

我们在 Windows 2019 服务器上运行的 Ubuntu (WSL) 上的 Nginx 实例存在问题。我们将它用作负载均衡器。

它工作正常,但一段时间后 Nginx 开始抛出 502 bad gateway。重新启动服务器可以解决这个问题,但我们如何防止它呢?

ubuntu nginx windows-server-2019 windows-subsystem-for-linux
  • 1 个回答
  • 119 Views
Martin Hope
Peter van Arkel
Asked: 2021-08-28 00:00:36 +0800 CST

在 rsync 中使用 link-dest 时出现意外的远程参数

  • 0

我的 WSL Ubuntu 上有一个备份脚本,我手动使用它来将我的 linux 系统备份到 USB 驱动器(安装在 WSL 上的 NTFS 卷)。

我遇到了 --link-dest 的问题,这是我以前在其他备份脚本中没有遇到过的;但是我已经有一段时间没有用 bash 写过任何东西了。

rsync --progress -rlDvuRH --modify-window=1 link-dest=$LAST/ -e "ssh -i /home/username/.ssh/id_rsa" --exclude='*home/.ecryptfs*' --exclude='*files_trashbin*' --exclude='*files_version*' root@hostname:{/var/www/,/root/,/home/,/etc/,/mnt/nfs/,/mnt/backupstore/} /home/username/rsync-backup/$DATE/

$LAST 是最后一个成功的备份目标目录,当我将它回显到控制台时,这个变量可以正常工作。

这给了我错误:Unexpected remote arg: root@hostname:/var/www/

如果我使用确切的一些 rsync 命令,但没有 --link-dest 参数;完全没有问题,它会进行完整备份。我在看什么?是不是我使用的 {} 符号与 --l 有一些奇怪的交互

windows ubuntu rsync windows-subsystem-for-linux
  • 1 个回答
  • 323 Views
Martin Hope
Ken Tsoi
Asked: 2021-07-29 06:18:03 +0800 CST

cURL 可以连接到 localhost 但浏览器不能

  • 2

我的系统是带有 WSL2 的 Win10,我运行了一个 dockergogs容器(来自 WSL 中的 ubuntu):

    83b2a8833235   gogs/gogs                    "/app/gogs/docker/st…"   17 minutes ago   Up 17 minutes   0.0.0.0:10022->22/tcp, :::10022->22/tcp, 0.0.0.0:10080->3000/tcp, :::10080->3000/tcp       gogs

我发现我可以cURL它,但不能使用浏览器访问它:

    >curl -vvv http://localhost:10080
    * Rebuilt URL to: http://localhost:10080/
    *   Trying ::1...
    * TCP_NODELAY set
    * Connected to localhost (::1) port 10080 (#0)
    > GET / HTTP/1.1
    > Host: localhost:10080
    > User-Agent: curl/7.55.1
    > Accept: */*
    >
    < HTTP/1.1 302 Found
    < Content-Type: text/html; charset=utf-8
    < Location: /install
    < Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647
    < Set-Cookie: i_like_gogs=64602dcbf733a9e0; Path=/; HttpOnly
    < Set-Cookie: _csrf=CEoPJD9KItxBKOThbeQExNAjnDo6MTYyNzQ4MDI3Njg1MDY2NTEwMA; Path=/; Domain=localhost; Expires=Thu, 29 Jul 2021 13:51:16 GMT; HttpOnly
    < X-Content-Type-Options: nosniff
    < X-Frame-Options: DENY
    < Date: Wed, 28 Jul 2021 13:51:16 GMT
    < Content-Length: 31
    <
    <a href="/install">Found</a>.
    
    * Connection #0 to host localhost left intact

使用netstat -a -o我可以在 Active Connections 中看到地址:

TCP    0.0.0.0:10080          xxxxxxx:0          LISTENING       13152

但我无法使用浏览器访问: 无法使用浏览器访问

有人有任何提示吗?

netstat curl windows-10 windows-subsystem-for-linux
  • 1 个回答
  • 2432 Views
Martin Hope
yossi
Asked: 2021-04-01 01:24:54 +0800 CST

Windows上的Wsl ubuntu虚拟主机和主机文件

  • 3

我尝试通过我的 Windows 浏览器访问它并失败。我的错误是什么?

我在 Windows 10 和 ubuntu 20 上使用 WSL2。
我有一个 apache 服务器和一个 laravel 应用程序,我安装/var/www/law
在我的 Windows 主机文件中,我添加了这个:

127.0.0.1   law.dev
::1 law.dev

这是位于的law.conf文件/etc/apache2/sites-available。

<VirtualHost *:80>
    ServerName law.dev


    DocumentRoot /var/www/law/public

    <Directory /var/www/law>
    Options Indexes MultiViews
    AllowOverride None
    Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
ubuntu virtualhost windows-subsystem-for-linux hosts-file
  • 1 个回答
  • 5788 Views
Martin Hope
loki
Asked: 2021-03-11 09:03:13 +0800 CST

如何在 Windows 子系统 Linux 中使用 AWS-CLI 连接 AWS?

  • -2

对于我试图awscli通过调用以下代码来使用的 AWS,我是全新的:

root@DESKTOP-QK5VI8R:~# aws s3 ls

在此处输入图像描述

我为此应用了很多解决方案:

  1. 我将端口 8888 添加到 Windows 防火墙的入站/出站规则集中。
  2. hosts我在 Windows的文件中添加了以下代码。
# End of section
192.168.184.241 localhost 8888
  1. 我也设置了;

在此处输入图像描述

但结果是一样的。

Failed to connect to proxy URL: "http://127.0.0.1:8888"

我的电脑中的代理设置:(@Tim)

在此处输入图像描述 我检查了我的计算机的代理设置。没有代理。但我在 MobaXterm 中使用 Windows 子系统 Ubuntu Linux。

我该如何解决这个问题?

linux ubuntu amazon-web-services aws-cli windows-subsystem-for-linux
  • 1 个回答
  • 1534 Views
Martin Hope
amateur barista
Asked: 2021-03-10 04:16:22 +0800 CST

Git、WSL2、SSH:读取边带数据包时意外断开连接

  • 4

尝试使用 SSH 克隆远程 Git 存储库时,出现以下错误:

git clone user@remote-repo:project.git .
remote: Counting objects: 187444, done.
remote: Compressing objects: 100% (73430/73430), done.
client_loop: send disconnect: Broken pipe.06 MiB | 4.04 MiB/s
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: index-pack failed

我的环境具有以下规格:

  • WSL2(Windows 子系统 4 Linux)
  • git --version git version 2.30.1

git 包可以在这里找到https://pkgs.alpinelinux.org/package/edge/main/x86_64/git

uname -a
Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 Linux

2021-03-09-07:11AM wsl@Alpine:~$ more /etc/issue
Welcome to Alpine Linux 3.10
Kernel \r on an \m (\l)

我不知道为什么会这样。是 Alpine 上的突发问题还是内核配置问题?WSL?我怀疑它是远程主机。远程主机适用于 SSH,也适用于每个非 WSL 用户的克隆。

linux ssh git alpine windows-subsystem-for-linux
  • 4 个回答
  • 14722 Views
Martin Hope
Ñhosko
Asked: 2021-02-09 04:11:12 +0800 CST

SSH 连接错误:buffer_put_cstring:s == NULL [preauth]

  • 0

我正在尝试通过 SSH 从 Windows 10 计算机连接到远程 SUSE Linux Enterprise Server 11。

使用 Putty 0,73 时,它可以正常工作。但是使用 WSL2/Debian 我总是被拒绝。

在 Linux 机器上,当我打开/var/log/messages文件时,每次尝试使用 WSL2 访问时都会看到以下行:

2 月 8 日 12:46:31 远程计算机名 sshd [13536]:致命:buffer_put_cstring:s == NULL [preauth]

在 WSL 上,我只是收到一个连接关闭错误:

$ ssh root@ip-of-remote-linux
Connection closed by ip-of-remote-linux port 22

任何想法两台计算机之间的问题是什么?

ssh sles windows-subsystem-for-linux
  • 2 个回答
  • 86 Views
Martin Hope
이형욱
Asked: 2020-12-28 13:18:10 +0800 CST

iptables-legacy 无法加载 NFQUEUE 目标并且 --queue-num 和 --queue-bypass 选项是未知选项

  • 1

我正在尝试在 ubuntu 20.04.1 上从https://github.com/farukuzun/notsodeep运行以下 iptables 命令。

iptables -A INPUT -p tcp --tcp-flags SYN,ACK SYN,ACK --sport 443 -j NFQUEUE --queue-num 200 --queue-bypass

但执行结果如下:

# iptables -A INPUT -p tcp --tcp-flags SYN,ACK SYN,ACK --sport 443 -j NFQUEUE --queue-num 200 --queue-bypass
iptables v1.8.4 (legacy): unknown option "--queue-num"
Try `iptables -h' or 'iptables --help' for more information.

下面的执行结果使它看起来像我的机器上根本不存在 NFQUEUE 目标:

# iptables -A INPUT -j NFQUEUE
iptables v1.8.4 (legacy): Couldn't load target `NFQUEUE':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.

我很尴尬,因为这是我以前从未见过的情况。正如我所料,所有命令都应该可以正常工作。

这都是因为我使用的 Ubuntu 系统是基于 WSL ( https://docs.microsoft.com/windows/wsl/install-win10 ) 的吗?

ubuntu iptables windows-subsystem-for-linux
  • 2 个回答
  • 1520 Views
Martin Hope
Botond Balázs
Asked: 2020-11-11 02:58:28 +0800 CST

如何从 WSL2 内部连接到 Windows 主机上运行的 Postgres?

  • 8

我的 Windows 机器上运行了 Postgres,我需要从 WSL2 内部连接到它。

  • postgres windows 服务正在运行
  • 我可以使用从 Windows 命令行连接到它psql
  • WSL2 vm 的 IP 是172.31.210.120, 网络掩码255.255.240.0(使用 确定ipfconfig)。
  • vm内部的windows主机的IP是172.31.208.1(使用确定cat /etc/resolv.conf)
  • 我可以使用curl http://172.31.208.1:8080. 如果我记录传入请求的 IP,我会得到172.31.210.120这样的信息,这会验证两个 IP 是否正确。
  • 我将以下行添加到pg_hba.conf:host all all 172.31.210.120/20 scram-sha-256
  • 我重新启动了 postgres windows 服务

如果我尝试使用以下命令从 WSL 连接到它:

$ psql --host=172.31.208.1 --port=5432 --user=postgres

我收到此错误:

psql: error: could not connect to server: could not connect to server: Connection timed out
        Is the server running on host "172.31.208.1" and accepting
        TCP/IP connections on port 5432?

注意:我也尝试使用测试连接,telnet但它也失败了。

下面的日志c:\Program Files\PostgreSQL\13\data\log\没有显示任何错误或任何迹象表明存在连接尝试。

我在这里想念什么?

windows linux postgresql windows-subsystem-for-linux
  • 2 个回答
  • 7152 Views
Martin Hope
Paul Fan
Asked: 2020-10-29 21:41:21 +0800 CST

我的 Magento 只能加载第一个首页,所有页面都是 404。 Nginx 服务器配置问题

  • 0

我正在尝试在 WSL、ubuntu Nginx 网络服务器、localhost 上运行 Magento 2 我只能加载我的网站第一个首页,但其余页面找不到 404。我只修改 /etc/nginx/sites-available/default 文件。因为我使用的是 localhost 并且只有 1 个站点。我想我不需要创建另一个。谁能帮我看看我的配置文件有什么问题?/etc/nginx/sites-available/默认。我对 Nginx 不熟悉,我确实尝试了 google 很多天,仍然找不到任何解决方案。

如果有人可以提供帮助,我将不胜感激。

  # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/html/Magento2_PAUL;

        # Add index.php to the list if you are using PHP
        index index.php;

        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
                # proxy_pass http://localhost:8080;
                # proxy_http_version 1.1;
                # proxy_set_header Upgrade $http_upgrade;
                # proxy_set_header Connection 'upgrade';
                # proxy_set_header Host $host;
                # proxy_cache_bypass $http_upgrade;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
         include snippets/fastcgi-php.conf;
        #
        #       # With php7.0-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php7.0-fpm:
               fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        }

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


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#       listen 80;
#       listen [::]:80;
#
#       server_name example.com;
#
#       root /var/www/example.com;
#       index index.html;
#
#       location / {
#              try_files $uri $uri/ =404;
#       }
#
magento nginx http-status-code-404 windows-subsystem-for-linux
  • 1 个回答
  • 97 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