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

EnzoR's questions

Martin Hope
EnzoR
Asked: 2024-01-16 00:01:41 +0800 CST

Apache v2.4 通过端口 443 提供 HTTP 服务

  • 6

我在 Ubuntu 20.04 上遇到了这个问题。

它看起来很像许多类似的东西,但经过几个小时的尝试,结果证明它不是通常的东西。

我曾经certbot --apache将 HTTPS 添加到我服务器上的一个工作网站。我要求自动重定向到 HTTPS。一切显然都顺利。我还运行a2enmod ssl; a2nsite default-ssl.conf启用 SSL 模块并重新启动 apache2。

在日志中似乎读取了证书:

[ssl:info] [pid 4187632] AH02568: Certificate and private key mysite.com:443:0 configured from /etc/letsencrypt/live/mysite.com/fullchain.pem and /etc/letsencrypt/live/mysite.com/privkey.pem

我也发现了这个,但找不到足够的文档:

 [headers:debug] [pid 4188047] mod_headers.c(899): AH01503: headers: ap_headers_error_filter()

最终发生的情况是,apache2 正在侦听端口 443,但一旦发生重定向,就会通过该端口提供 HTTP 服务。当然,浏览器无法工作并会抛出如下错误:

This site can’t provide a secure connection
mysite.com sent an invalid response.
ERR_SSL_PROTOCOL_ERROR

没有别的。

从另一台服务器我可以做这两个简单的测试:

$ nmap -A -Pn -p 443 mysite.com.
Nmap scan report for mysite.com. (1.2.3.4)
Host is up (0.044s latency).
Other addresses for mysite.com. (not scanned): 1234:1234:123:1234::
rDNS record for 1.2.3.4: host1.hosting.net

PORT    STATE SERVICE VERSION
443/tcp open  http    Apache httpd 2.4.41
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Did not follow redirect to https://mysite.com/
Service Info: Host: mysite.com

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 7.64 seconds

和

$ wget -v -v -v https://mysite.com/
--2024-01-15 16:42:45--  https://mysite.com/
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving mysite.com (mysite.com)... 1.2.3.4, 1234:1234:123:1234::
Connecting to mysite.com (mysite.com)|1.2.3.4|:443... connected.
GnuTLS: An unexpected TLS packet was received.
Unable to establish SSL connection.

这些证实了我的诊断(通过端口 443 的 HTTP),并且没有防火墙阻止任何内容。

有什么提示吗?

我的(主要)配置位如下。

所有其他文件(000-default.conf和default-ssl.conf)都是 Ubuntu 20.04 安装的默认文件。

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.conf

Listen 80

<IfModule ssl_module>
        Listen 443
</IfModule>

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

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

mysite.conf

<VirtualHost _default_:80>
  ServerName  mysite.com
  ServerAlias  www.mysite.com
  ServerAdmin [email protected]
  DocumentRoot /home/fe/public_html

  <Directory />
    Options FollowSymLinks ExecCGI
    AllowOverride All
    AuthType Basic
    AuthName "Credentials, please"
    AuthUserFile /home/fe/.htpasswd
    Require valid-user
  </Directory>

  ScriptAlias /x/ /home/fe/cgi/
  <Directory "/home/fe/cgi">
    Options ExecCGI
    SetHandler cgi-script
    Require all granted
  </Directory>

  ErrorLog ${APACHE_LOG_DIR}/mysite-error.log
  LogLevel debug
  CustomLog ${APACHE_LOG_DIR}/mysite-access.log combined
  <FilesMatch "\.(cgi|shtml|phtml|php)$">
  </FilesMatch>
  <Directory /usr/lib/cgi-bin>
  </Directory>
  BrowserMatch "MSIE [2-6]" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
  # MSIE 7 and newer should be able to use keepalive
  BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
RewriteEngine on
RewriteCond %{SERVER_NAME} =site.mysite.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

最后三行已由 添加certbot。

mysite-le-ssl.conf

<IfModule mod_ssl.c>
 <VirtualHost _default_:443>
  ServerName  mysite.com
  ServerAlias  www.mysite.com
  ServerAdmin [email protected]
  DocumentRoot /home/fe/public_html

  <Directory />
    Options FollowSymLinks ExecCGI
    AllowOverride All
    AuthType Basic
    AuthName "Credentials, please"
    AuthUserFile /home/fe/.htpasswd
    Require valid-user
  </Directory>

  ScriptAlias /x/ /home/fe/cgi/
  <Directory "/home/fe/cgi">
    Options ExecCGI
    SetHandler cgi-script
    Require all granted
  </Directory>

  ErrorLog ${APACHE_LOG_DIR}/mysite-error.log
  LogLevel debug
  CustomLog ${APACHE_LOG_DIR}/mysite-access.log combined
  <FilesMatch "\.(cgi|shtml|phtml|php)$">
  </FilesMatch>
  <Directory /usr/lib/cgi-bin>
  </Directory>
  BrowserMatch "MSIE [2-6]" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
  # MSIE 7 and newer should be able to use keepalive
  BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

  SSLCertificateFile /etc/letsencrypt/live/mysite.com/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/mysite.com/privkey.pem
  Include /etc/letsencrypt/options-ssl-apache.conf
  </VirtualHost>
</IfModule>
apache2
  • 1 个回答
  • 44 Views
Martin Hope
EnzoR
Asked: 2016-06-20 06:56:59 +0800 CST

如何通过命令行添加 ID3“封面艺术”?

  • 9

我需要在一些 MP3 文件中添加 ID3 封面。我需要一个命令行工具(没有 GUI),但似乎 id3 和 id3v2 工具都做不到。有什么提示吗?

command-line
  • 2 个回答
  • 11290 Views
Martin Hope
EnzoR
Asked: 2016-04-24 02:15:07 +0800 CST

如何在桌面上调整文件夹视图小部件的大小?

  • 22

这肯定是我的错,但我无法调整放在桌面上的文件夹视图小部件的大小。

在以前的版本(14.04,KDE 4)中,文件夹视图小部件都具有自动出现的句柄,用于设置、旋转和调整大小,以及其他功能。

现在我不知道该怎么做。任何想法?

kubuntu
  • 2 个回答
  • 5848 Views
Martin Hope
EnzoR
Asked: 2016-01-29 23:56:15 +0800 CST

为什么 Ubuntu 不提供 USB 映像而不是 ISO 映像?

  • 6

到目前为止,Ubuntu(和衍生产品)一直在提供要刻录到光学媒体上的 ISO 映像。然后有一个工具(usb-creator)可以将这些 ISO“刻录”到 USB 驱动器上。我可能是错的,但我认为现在大多数用户不使用光学媒体来安装 Ubuntu(以及其他操作系统)也是因为光驱不再是标准的。

“USB 映像”通常是使用标准 dd “烧录”的,该标准dd在您已有的任何操作系统中都很容易获得。如果您不是来自 Ubuntu,那么您的转换工具很可能与 Ubuntu 不同,并且无法完美运行。

Ubuntu 保留 ISO 而不是“dd-able”映像有什么优势?

usb-drive
  • 1 个回答
  • 1141 Views
Martin Hope
EnzoR
Asked: 2016-01-08 02:38:06 +0800 CST

为什么 curl/libcurl 不支持 sftp?

  • 2

我刚刚发现了这个苦涩的事实:我的 curl 不支持 sftp。

~ curl --version
curl 7.43.0 (x86_64-pc-linux-gnu) libcurl/7.43.0 GnuTLS/3.3.15 zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets 

阉割这么有用的工具的原因是什么?我应该自己重新编译软件包还是可以将其视为要提交的“错误”/“增强”?

sftp
  • 2 个回答
  • 1804 Views
Martin Hope
EnzoR
Asked: 2015-12-01 02:45:02 +0800 CST

从 Firefox 打印时如何更改字体大小?

  • 1

从 Firefox 打印页面时,我只能得到非常大的字体,因此即使是最小的网页也需要两个或更多页面。缩放屏幕字体已被证明是无效的。因此我的问题。TIA。

firefox
  • 1 个回答
  • 1156 Views
Martin Hope
EnzoR
Asked: 2015-09-16 02:46:56 +0800 CST

一个 USB 设备,两个串行接口:如何?

  • 1

我有一个串行设备,应该公开为两个串行端口:/dev/ttyACM0 和 /dev/ttyACM1。

目前我只得到第一个,尽管 Windows 下的同一个单元暴露为预期的两个连续剧。我的 dmesg 报告了这个:

[ 2738.788150] usb 2-1.2: new full-speed USB device number 3 using ehci-pci
[ 2738.876575] usb 2-1.2: New USB device found, idVendor=152a, idProduct=8230
[ 2738.876584] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2738.876590] usb 2-1.2: Product: Septentrio USB Device
[ 2738.876594] usb 2-1.2: Manufacturer: Septentrio
[ 2738.941229] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device
[ 2738.942171] usbcore: registered new interface driver cdc_acm
[ 2738.942174] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN 

一边lsusb -vvv说这话。

/sys/kernel/debug/usb/devices 中的相关部分是这样的:

T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs=  2
P:  Vendor=152a ProdID=8230 Rev= 1.10
S:  Manufacturer=Septentrio  
S:  Product=Septentrio USB Device
C:  #Ifs= 4 Cfg#= 2 Atr=c0 MxPwr=  2mA
I:  If#= 0 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=02 Prot=ff Driver=
I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=ff Driver=
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:  If#= 2 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=02 Prot=ff Driver=
I:  If#= 3 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=ff Driver=
E:  Ad=04(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=85(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
C:* #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=cdc_acm
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

我的设备(GPS 调制解调器)是Bus 001 Device 004: ID 152a:8230 Thesycon Systemsoftware & Consulting GmbH.

我认为 cdc_acm 模块有一些选项可以与 modprobe/insmod 一起使用,但似乎很难找到关于它的任何信息。

如何在 Ubuntu 下识别/创建/启用两个串行端口?TIA。

[更新] 我还发现了另一个与我的问题紧密相关的问题。但不知道如何实施建议的更改。

usb
  • 1 个回答
  • 1324 Views

Sidebar

Stats

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

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve