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 / 问题

问题[url](server)

Martin Hope
manoll0
Asked: 2021-10-07 03:49:22 +0800 CST

Fritz!Box 和 Ubuntu:使用 Apache Httpd 和 Bind 在 LAN 中公开 URL

  • 0

我希望有人可以帮助我完成这个 - 我想 - 简单的任务。

情况:

在我的私有 LAN 上,我运行一个 Internet 路由器(“Fritz!Box”)和一个带有 Ubuntu 20.04 LTS 的 Raspberry Pi。我为私人目的开发了一个小型 Spring Boot Web-App,我只想在我的 LAN 中使用它(或者可能通过 VPN 从外部访问)。Web-App 的本机 URL 是“http://ubuntu:8080”,因为我的 Raspberry 被称为“ubuntu”并且应用程序在 Tomcat-Server 上运行。现在我想在局域网内公开一个 URL,例如“http://thats-my.app”,并将其用作应用程序的基本 URL。目前,ubuntu 上的 curl 可以访问它,我的其他 PC 不能。

更好的是 FQDN“http://wow.thats-my.app”(带有子域),这样我就可以对所有应用程序使用相同的域和顶级域,并且只改变子域,例如“http ://super.thats-my.app" 等等.. 免责声明:由于我通过 SSH 工作,所有配置都是仅在终端完成的。请考虑我不使用 Ubuntu 的桌面表面。

提前感谢您的时间,并希望您的帮助!

这是我对 ubuntu 系统所做的设置。此处未显示的内容被注释掉!:

ufw

Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 9090/tcp                   ALLOW IN    Anywhere                   # UBUNTU-COCKPIT
[ 2] 3306/tcp                   ALLOW IN    Anywhere                   # MYSQL
[ 3] Apache Full                ALLOW IN    Anywhere                   # :80,:443
[ 4] Bind9                      ALLOW IN    Anywhere                   # :53
[ 5] OpenSSH                    ALLOW IN    Anywhere                   # :22
[ 6] 8080:8090/tcp              ALLOW IN    Anywhere                   # TOMCAT
[ 7] 9090/tcp (v6)              ALLOW IN    Anywhere (v6)              # UBUNTU-COCKPIT
[ 8] 3306/tcp (v6)              ALLOW IN    Anywhere (v6)              # MYSQL
[ 9] Apache Full (v6)           ALLOW IN    Anywhere (v6)              # :80,:443
[10] Bind9 (v6)                 ALLOW IN    Anywhere (v6)              # :53
[11] OpenSSH (v6)               ALLOW IN    Anywhere (v6)              # :22
[12] 8080:8090/tcp (v6)         ALLOW IN    Anywhere (v6)              # TOMCAT

/etc/hosts

127.0.0.1 localhost.localdomain localhost
127.0.1.1 ubuntu
127.0.1.1 thats-my.app

(--> 没有 IPv6 条目)

/etc/apache2/sites-available/thats-my.conf

<VirtualHost *:80>
        ServerName thats-my.app
        ServerAlias thats-my
        ProxyRequests Off
        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>
        ProxyPreserveHost On
        ProxyPass               / http://localhost:8080/
        ProxyPassReverse        / http://localhost:8080/
</VirtualHost>

--> 指向启用站点的目录的符号链接

/etc/bind/named.conf.local

zone "thats-my.app" IN {
        type master;
        file "/etc/bind/forward.thats-my.app.db";
        allow-update { none; };
};

zone "178.168.192.in-addr.arpa" IN {
        type master;
        file "/etc/bind/reverse.thats-my.app.db";
        allow-update { none; };
};

/etc/bind/named.conf.options

options {
        directory "/var/cache/bind";
        forwarders {
        1.1.1.1;
        1.0.0.1;
        8.8.8.8;
        8.8.4.4;
        };
        dnssec-validation auto;
        listen-on-v6 { any; };
        allow-query { any; };
};

/etc/bind/forward.thats-my.app.db

$TTL    604800
@       IN      SOA     ns1.thats-my.app. admin.ns1.thats-my.app. (
                              5         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns1.thats-my.app.
ns1     IN      A       192.168.178.23

/etc/bind/reverse.thats-my.app.db

$TTL    604800
@       IN      SOA     thats-my.app. admin.thats-my.app. (
                              4         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns1.thats-my.app.
ns1     IN      A       192.168.178.23
23      IN      PTR     ns1.thats-my.app.

--> 终端输入:

sudo systemctl restart named
sudo systemctl restart apache2
sudo systemctl restart bind9

--> 路由器中的 DNS 配置

将 DNS IPv4 IP 设置为 192.168.178.23(主要和次要)

将DNS IPv6 IP设置为ubuntu机器的IPv6地址(主要和次要)

这是我得到的:

在本地 Ubuntu-Server 上

$ curl thats-my.app -> OK
$ dig thats-my.app -> status: NOERROR   *but*  SERVER 1.1.1.1#53 ???
$ dig thats-my.app @127.0.1.1 -> "connection timed out!"
$ dig thats-my.app @192.198.178.23 -> "connections timed out!"

在 LAN 上 Windows-PC PowerShell

curl thats-my.app -> cannot be resolved

局域网上 Windows-PC Chrome 浏览器

http://thats-my.app -> 网站无法访问/DNS_PROBE_FINISHED_NXDOMAIN

如果您查看“挖掘”结果,我会发现 Bind9 在这里不起作用。你怎么看?

谢谢!

url bind local-area-network apache-2.4 ubuntu-20.04
  • 1 个回答
  • 160 Views
Martin Hope
amir shariflou
Asked: 2021-07-13 13:06:12 +0800 CST

使用冒号作为 url htaccess http://localhost/1:1

  • 2

我对 url 中使用的冒号有疑问

这是我的网址

http://localhost/1:1

这是我的 htaccess

RewriteEngine On
RewriteRule ^/(.*):(.*) index.php/$1:$2

此错误显示 Forbidden 您无权访问此服务器上的 /1:1。

# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride all
        Order Allow,Deny
        Allow from all
  </Directory>
</VirtualHost>
php url .htaccess redirect localhost
  • 1 个回答
  • 196 Views
Martin Hope
twominds
Asked: 2021-06-04 20:56:40 +0800 CST

URL 具有 3 个或更多公共后缀标签在技术上/可行吗?(例如 test.co.io.example)

  • 0

我知道在 publix 后缀中至少可以有 2 个标签(例如。test.co.example),但是是否可以有 3 个或更多(例如。test.co.jp.example)?我不是在问是否可以有多个域名,而只是在 URL 中的后缀(例如。.com)。

如果不可能,为什么?

domain-name-system url domain
  • 1 个回答
  • 110 Views
Martin Hope
Imre Csősz
Asked: 2021-05-12 22:37:23 +0800 CST

IIS URL 重写不适用于复杂的 URL

  • 0

我有 2 个 URL 重定向规则:

    <rewrite>
        <rules>
            <clear />
            <rule name="al - helyek/al (kieg)" enabled="true" stopProcessing="true">
                <match url="^test1/al/(.*)RootFolder=%2Ftest1(.*)" />
                <action type="Redirect" url="helyek/al/{R:1}RootFolder=%2Fhelyek{R:2}" />
            </rule>
            <rule name="al - helyek/al" enabled="true" stopProcessing="true">
                <match url="^test1/al/(.*)" />
                <action type="Redirect" url="helyek/al/{R:1}" />
            </rule>
        </rules>
    </rewrite>

但是第一个不起作用,只有第二个。

Test URL: http://test:29001/test1/al/Megosztott%20dokumentumok/Forms/AllItems.aspx?RootFolder=%2Ftest1%2Fal%2FMegosztott%20dokumentumok%2FTeszt&FolderCTID=0x01200077BA4D1F1CDCF3498096871FD748FB37&View=%7B70C95A37%2D4FE1%2D4A60%2DA100%2D61E529A1DB56 %7D

这是一个 SharePoint 网站集。

可能是什么问题呢?

预先感谢您的帮助。

url sharepoint iis rewrite
  • 1 个回答
  • 98 Views
Martin Hope
Deeh
Asked: 2020-12-31 10:16:14 +0800 CST

RewriteRule 冲突和斜杠

  • 0

我们正在将网站迁移到我们的 cPanel 基础架构。客户使用 Nginx 在自己的基础架构上托管网站。他将他的 Nginx 配置文件发送给我们,我们将它们转换为 Apache Rewrite 规则。最终结果(仅显示相关行)如下所示:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ouvidoria/$ /ouvidoria/index.php
RewriteRule ^([^/\.]+)/?$ index.php?id=$1 [L]
RewriteRule ^news\/(.*)/?$ noticias.php?id=$1 [L]

一切都按预期工作,除了一页,即/ouvidoria. 此特定页面在 public_html 上有一个同名目录,因此 RewriteRule 指向该ouvidoria/index.php文件。问题是,由于某种原因,当我们访问/ouvidoria我们被重定向到的 URL时/ouvidoria/?id=ouvidoria,这似乎属于倒数第二条规则。所以这是第一个要解决的问题。

第二个是我们可以使用尾部斜杠 ( /ouvidoria/) 访问 URL,它不会附加?id=ouvidoria,但是,该网站的开发方式是根据 URL 加载侧边菜单。它只会在没有斜杠的情况下加载。即使我们从第一个问题中删除有问题的规则(这不是解决方案,因为在其他页面中需要它),它也会重定向/ouvidoria到/ouvidoria/,因此无法加载菜单。

任何有关如何使这些规则起作用的帮助将不胜感激。

编辑:

剩下的唯一问题是从/ouvidoriato重定向/ouvidoria/。网络标签截图:

网络选项卡

重定向细节:

重定向详细信息

url nginx mod-rewrite apache2
  • 2 个回答
  • 251 Views
Martin Hope
VaNa
Asked: 2020-11-25 07:19:27 +0800 CST

Nginx 使用 # 重定向到 URL

  • 0

我希望例如https://example.com/to/redirect被 nginx 重定向到https://example.com/some/url/with/#my-beautiful-id. 但是,在 nginx 配置文件#中用于注释

可能吗?我应该向 nginx 配置写入什么内容才能正常工作?

不工作

server {
    ...
    location /to/redirect {
        ...
        return https://example.com/some/url/with/%23my-beautiful-id;
    }
}
url nginx
  • 1 个回答
  • 509 Views
Martin Hope
DimitrisPrasakis
Asked: 2020-10-04 12:11:34 +0800 CST

哪种 DNS 记录类型指向网站所在的目录?

  • -3

一台服务器可以托管多个网站。

例如让服务器的 IP 为111.222.333.444

然后一个网站可以驻留在目录中11.222.333.444/example1,另一个网站可以驻留在11.222.333.444/example2目录中

如果您挖掘这两个的 DNS 记录,您将始终获得服务器 ip。例如

root@ubuntu:~$ dig +short -t a example1.com
111.222.333.444

因此,我想知道。浏览器如何准确地知道指向哪里?是否有另一个 DNS 记录指定 URL 的路径?

domain-name-system url nameserver
  • 2 个回答
  • 106 Views
Martin Hope
mcgheee
Asked: 2020-10-02 07:43:45 +0800 CST

为什么我的 Apache RewriteRule 会从目标 url 查询字符串中删除十六进制代码?

  • 3

我有一个 apache 重写规则:

RewriteRule ^/xy[/]{0,1}$ https://www.example.com/path/file.php?utm_source=Billboard&utm_medium=Print&utm_campaign=MyOrg%20Promo&utm_term=2020FA&utm_context=XY%2C%20border%20state%20abbreviation%20redirect [R]

但我的目标网址实际上正在变成:

https://www.example.com/path/file.php?utm_source=Billboard&utm_medium=Print&utm_campaign=MyOrg0Promo&utm_term=2020FA&utm_context=XYC0border0state0abbreviation0redirect

因此,它正在剥离%2目标查询字符串中的部分十六进制代码。

我尝试设置 PT、B、NE、QSD 和 BNP 标志。我在 Apache 2.4.6(CentOS) 上,那里不支持 BNP 标志。

我怎样才能让 Apache 不理会这些代码?

url rewrite mod-rewrite apache-2.4
  • 1 个回答
  • 207 Views
Martin Hope
zab nicola
Asked: 2020-09-26 01:37:45 +0800 CST

返回 virtualHosts 列表名称或 ip 的 Api 请求

  • 0

有没有办法向 apache Web 服务器发送请求并返回所有虚拟主机、名称或 IP 地址的列表?可以用一些api来完成吗?

我知道执行apache2ctl -S我得到关于虚拟主机的信息

VirtualHost configuration:

*:80 is a NameVirtualHost
        default server **first.example.com** (/etc/httpd/conf.d/first.example.com.conf:1)
 
Main DocumentRoot: "**/var/www/html**"

我无权访问 pc 服务器上的 apache2ctl 程序。

我的目标是从私人网络或家庭网络中获得一小部分链接。Urls 可以从 html 文件中获取,但文件位于 var/www/ 中。Url 可以通过 http HEAD 请求地址来尝试单词的组合和测试。

我想在 virtualHosts 配置文件中列出 IP 地址,以下载 first.example.com 的主 html 页面。

就,关于

url web-server html apache2 whitelist
  • 1 个回答
  • 75 Views
Martin Hope
Ricardo Alves
Asked: 2020-04-03 03:59:07 +0800 CST

HTTPS 中的查询字符串参数在 DNS 解析器中是否可见?

  • 0

我正在处理的一个项目中有一个案例,我们必须发送一个 JWT 令牌作为另一个服务的查询参数。由于安全原因,我的一位同事认为该令牌将被 DNS 解析器可见并捕获。这是真的?

关于发送在查询字符串中可见的令牌是否还有其他安全问题?

domain-name-system url https
  • 1 个回答
  • 758 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