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

xtl's questions

Martin Hope
xtl
Asked: 2019-12-14 05:28:26 +0800 CST

ASP.NET Core 应用程序在 Ubuntu 18.04 上响应 503 Service Unavailable

  • 5

我有一个库存的、几乎未修改的 Visual Studio 模板 ASP.NET Core 应用程序,我试图在 Ubuntu 18.04 上运行。我已遵循本指南:https ://docs.microsoft.com/en-gb/aspnet/core/host-and-deploy/linux-apache?view=aspnetcore-3.1 。

经过一段时间的打击和失踪后,我设法让 ASP.NET 服务运行。但是,当我访问我的页面时,我看到了 503 Service Unavailable 错误。

我的 Apache 配置:

<IfModule mod_ssl.c>
<VirtualHost *:80>
        ServerName example.com
        Redirect / https://example.com
        Redirect /panel https://example.com/panel
        Redirect /privacy https://example.com/privacy
</VirtualHost>

<VirtualHost *:443>
        ServerName example.com
        DocumentRoot /var/www/
        ServerAdmin [email protected]

        RewriteEngine On
        ErrorLog "/var/log/apache2/rewrite"
        LogLevel alert rewrite:trace6

        # ASP.NET application
        # launchSettings.json is configured to listen on this port
        ProxyPass /panel https://localhost:33138/
        ProxyPassReverse /panel https://localhost:33138/

        ProxyPass /api/socket ws://localhost:44909/api/socket
        ProxyPassReverse /api/socket ws://localhost:44909/api/socket

        ProxyPass /pgadmin4 !
        ProxyPass /privacy !
        ProxyPass /contact !
        ProxyPass /panel !

        ProxyPass / http://localhost:44909/
        ProxyPassReverse / http://localhost:44909/

        SSLEngine on
        SSLOptions +StrictRequire
        SSLProtocol TLSv1
        ServerAlias example.com
        SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

这是systemctl status tpanel(我的 ASP 守护程序)的结果:

● tpanel.service - a .NET Core 3.1 server
   Loaded: loaded (/etc/systemd/system/tpanel.service; disabled; vendor preset: enabled)
   Active: active (running) since Fri 2019-12-13 10:16:21 CET; 4h 1min ago
 Main PID: 2765 (dotnet)
    Tasks: 16 (limit: 4915)
   CGroup: /system.slice/tpanel.service
           └─2765 /usr/bin/dotnet /var/www/TPanel/publish/TPanel.dll

Dec 13 10:16:22 vps-example dotnet[2765]: info: Microsoft.Hosting.Lifetime[0]
Dec 13 10:16:22 vps-example dotnet[2765]:       Now listening on: http://localhost:5000
Dec 13 10:16:22 vps-example dotnet[2765]: info: Microsoft.Hosting.Lifetime[0]
Dec 13 10:16:22 vps-example dotnet[2765]:       Now listening on: https://localhost:5001
Dec 13 10:16:22 vps-example dotnet[2765]: info: Microsoft.Hosting.Lifetime[0]
Dec 13 10:16:22 vps-example dotnet[2765]:       Application started. Press Ctrl+C to shut down.
Dec 13 10:16:22 vps-example dotnet[2765]: info: Microsoft.Hosting.Lifetime[0]
Dec 13 10:16:22 vps-example dotnet[2765]:       Hosting environment: Production
Dec 13 10:16:22 vps-example dotnet[2765]: info: Microsoft.Hosting.Lifetime[0]
Dec 13 10:16:22 vps-example dotnet[2765]:       Content root path: /var/www/TPanel/publish

launchSettings.json:

{
  "iisSettings": {
    "windowsAuthentication": false, 
    "anonymousAuthentication": true, 
    "iisExpress": {
      "applicationUrl": "http://localhost:50015",
      "sslPort": 44313
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "TPanel": {
      "commandName": "TPanel",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:33138"
    }
  }
}

但就像我说的,当我去的时候,example.com/panel我看到了 503 错误。我网站的其他部分运行良好。

其他信息:

  • 我有另一个使用 5001 端口的不相关应用程序正在运行,但我用其他东西替换了它,所以它应该不是问题
  • 我是否将应用程序的端口设置为33138or似乎并不重要5001,它不会改变任何东西
ubuntu apache-http-server
  • 1 个回答
  • 4954 Views
Martin Hope
xtl
Asked: 2019-08-21 23:31:35 +0800 CST

DATEDIFF() 拒绝在 MySQL 事件上运行

  • 5

我想创建一个每天都会运行的事件,看看某个帐户是否很快就会过期。该soon_expires单元格稍后将由 Bash 脚本使用,该脚本会向相关用户发送电子邮件,通知他情况。

这是我的活动内容(使用 phpmyadmin):

SELECT * FROM users;

IF DATEDIFF(expirationtime, CURDATE()) < 45 THEN
    SET soon_expires = 1; 
ELSE 
    SET soon_expires = 0; 
END IF;

但是,它返回一个错误,说

#1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF DATEDIFF(expirationtime, CURDATE()) < 45 THEN SET soon_expires = 1; EL' at line 3

我还尝试创建一个触发器,它按预期工作。但我意识到触发器只会在行更新时运行 -expirationtime或多或少是静态的,所以触发器是不够的。

mysql sql
  • 1 个回答
  • 124 Views
Martin Hope
xtl
Asked: 2019-07-03 23:11:27 +0800 CST

我的 mysqldump 脚本一直失败,说 my.cnf 中没有前面的组

  • 6

所以 mysqldump 抛出以下错误:

mysqldump: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 22!
mysqldump: [ERROR] Fatal error in defaults handling. Program aborted!

我的 my.cnf 是超级基本的:

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html 
#

# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
event-scheduler=ENABLED

附带问题:我应该在我的配置文件中添加一些内容以提高安全性吗?我能以某种方式压缩我的表吗,最好是使用 phpmyadmin?

linux mysql
  • 1 个回答
  • 803 Views
Martin Hope
xtl
Asked: 2019-05-18 01:09:54 +0800 CST

匿名用户在vsftpd上看不到我上传的文件

  • 5

我有一个/var/ftp/pub具有drwxr--r--ftpuser 权限的目录。我把我的文件放在那里,但匿名帐户看不到它们。文件本身有-rw-r--r--权限。

这可能是权限问题,但是我尝试了各种权限代码,但都没有用。它可能与连接无关,因为如果我使用 Total Commander,它只会显示空目录。如果我通过浏览器访问它,它会显示“ERR_FTP_FAILED”。Ftpuser 可以很好地查看文件。

ubuntu ftp
  • 1 个回答
  • 587 Views

Sidebar

Stats

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

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve