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

Andrus's questions

Martin Hope
Andrus
Asked: 2020-01-31 00:20:27 +0800 CST

如何在还原时创建数据库

  • -1

我希望 pg_restore 在使用 Debian 10 上的 Postgres 12 恢复之前创建数据库

我试过了

PG_COLOR=auto
PGHOST=localhost
PGPASSWORD=mypass
PGUSER=postgres
export PGHOST  PGPASSWORD PG_COLOR PGUSER
pg_restore --clean --create --if-exists --dbname=mydb  --jobs=4 --verbose "mydb.backup"

但有错误

pg_restore:连接到数据库进行还原 pg_restore:错误:连接到数据库“mydb”失败:致命:数据库“mydb”不存在

恢复前如何创建数据库?

在 Debian 10 上使用 Postgres 12

postgresql
  • 1 个回答
  • 667 Views
Martin Hope
Andrus
Asked: 2019-01-05 12:00:00 +0800 CST

如何使用 Apache 在 Debian 6 上释放 SSL 证书

  • 0

我正在寻找一种在 Debian 6 挤压中运行的 Apache 中使用免费 SSL 证书的方法。

我尝试使用 Lets-Encrypt

跑步

./certbot-auto --apache certonly --no-bootstrap

抛出错误

WARNING: couldn't find Python 2.7+ to check for updates.
Traceback (most recent call last):
  File "<stdin>", line 16, in <module>
  File "/usr/lib/python2.6/distutils/version.py", line 140, in __cmp__
    compare = cmp(self.version, other.version)
AttributeError: StrictVersion instance has no attribute 'version'

我尝试使用在 Sqeeze 中安装 python 2.7

apt-get install python-pip

但这会引发错误

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 openssl : Depends: libssl1.0.0 (>= 1.0.1e-2+deb7u5) but it is not installable
 python-pip : Depends: python-pkg-resources but it is not going to be installed
              Depends: python-setuptools (>= 0.6c1) but it is not going to be installed
 wkhtmltox : Depends: libssl1.0.0 but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

如何在 Apache 的 sqeeze 中使用免费的 SSL 证书?

Squeeze 还从源代码安装了 Mono 最新版本。也许可以使用一些 .NET 或 Mono ACME 客户端。

debian
  • 1 个回答
  • 1851 Views
Martin Hope
Andrus
Asked: 2016-05-07 07:23:14 +0800 CST

如何从 sh 文件打印

  • 1

文件prindi.sh包含

/usr/bin/lpr –P SL-M3325ND <teade.pdf

它的调用返回错误

/usr/bin/lpr: Error - unable to access "–P" - No such file or directory

如果直接从命令行调用此命令,它将起作用:

# /usr/bin/lpr -P SL-M3325ND <teade.pdf
# lpq
SL-M3325ND is ready
no entries

如何解决这个问题,以便它也可以从 prindi.sh 打印?

linux printing debian-wheezy lpr
  • 1 个回答
  • 895 Views
Martin Hope
Andrus
Asked: 2015-06-24 00:08:16 +0800 CST

如果它停止响应并且套接字仍在使用中,如何自动重新启动apache

  • 2

Apache 服务器 Debian Linux x64 为 mysite.com 中的站点单声道应用程序和其他使用虚拟主机的站点提供服务。

有时 apache 会因未知原因停止响应。Apache error_log 包含:

[Sat Jun 20 13:56:31 2015] [error] [client 90.190.33.164] File does not exist: /var/www/apple-touch-
icon.png
[Sat Jun 20 16:38:04 2015] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Sat Jun 20 17:20:11 2015] [notice] caught SIGTERM, shutting down
mod-mono-server received a shutdown message
[Tue Jun 23 09:20:50 2015] [error] mod_mono: connect error (Interrupted system call). File: /tmp/mod
_mono_server_default
mod-mono-server received a shutdown message
mod-mono-server received a shutdown message
mod-mono-server received a shutdown message
[Tue Jun 23 09:20:54 2015] [error] Not running mod-mono-server.exe because no MonoApplications, Mono
ApplicationsConfigFile or MonoApplicationConfigDir specified.
[Tue Jun 23 09:20:54 2015] [notice] Apache/2.2.16 (Debian) mod_mono/2.6.3 configured -- resuming normal operations
..

看起来像

[Sat Jun 20 16:38:04 2015] [error] server reached MaxClients setting, consider raising the MaxClients setting

日志文件中的消息首先出现。

之后可能 cron 作业会尝试在下面重新启动 apache,这会导致 error_log 中出现消息:

[Sat Jun 20 17:20:11 2015] [notice] caught SIGTERM, shutting down
mod-mono-server received a shutdown message

此时服务器已关闭:access_log 未记录从 6 月 20 日 17:20 开始的任何访问

当我手动重新启动服务器时,服务器仅在 [Tue Jun 23 09:20:50 2015] 开始重新启动。这种情况从上个月开始每月发生几次。

要解决此问题,请使用以下 crontab 脚本每 10 分钟运行一次:

wget --timeout=10 --no-verbose --tries=1 -a /var/log/wget.log -O /var/log/wgettulem.html  mysite.com || /etc/init.d/apache2 restart

如果 apache 停止响应,此脚本写入的日志文件包含

Connection timed out错误信息。

但是apache没有重新启动。尝试使用手动重新启动它

/etc/init.d/apache2 restart

返回 Sockect 正在使用错误。ps aux 显示 apace 仍在运行。

我通过使用来解决这个问题

ps aux | grpe apache  

查找应用程序进程号并使用

kill

杀死这个进程。

如何修复或找到此消息的原因?如何自动化这个过程,以便所有 apache 实例都被杀死,并且 apache 将被这个脚本自动重新启动。有什么方法可以让 apache 保持响应?

Debian 版本是 6.0.4

apache2 -V 返回

Server version: Apache/2.2.16 (Debian)
Server built:   Feb  5 2012 21:35:42
Server's Module Magic Number: 20051115:24
Server loaded:  APR 1.4.2, APR-Util 1.3.9
Compiled using: APR 1.4.2, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

apache2.conf 包含

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>
apache-2.2
  • 1 个回答
  • 6180 Views
Martin Hope
Andrus
Asked: 2015-02-17 22:19:28 +0800 CST

在 Debian 6.0 中安装 wkhtmltoimage (squeeze)

  • 0

如何在 64 位 amd debian 中安装 wkhtmltoimage?

我试过了

wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf

这只安装了 wkhtmltopdf ,而不是 wkhtmltoimage。

我也尝试加载

http://wkhtmltopdf.googlecode.com/files/wkhtmltoimage-0.9.9-static-amd64.tar.bz2

但是这个文件不存在。

我查看了下载页面

http://wkhtmltopdf.org/downloads.html

并打开 debian deb 文件。Archiever 显示该文件仅包含单个二进制文件:

deb 内容

看起来 wkhtmltoimage 不包括在内。

如果安装了这个位置的 windows 包,它会同时安装 wkhtmltoimage 和 wkhtmltopdf。

如何在 Debian x64 中也安装 wkhtmltoimage?

debian
  • 2 个回答
  • 3030 Views
Martin Hope
Andrus
Asked: 2014-10-28 07:36:10 +0800 CST

如何在 Debian Squeeze 中并行安装 Postgres 9.3

  • 0

Debian 6 包含从 Debian backports 在 5432 端口安装的 Postgres 9.1 安装

如何在此服务器上安装 Postgres 9.3。我在http://www.postgresql.org/download/linux/debian/中找到了说明

创建文件 /etc/apt/sources.list.d/pgdg.list,并为存储库添加一行

deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg main

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
   sudo apt-key add -
sudo apt-get update 
apt-get install postgresql-9.3 

这会保留现有的 9.1 安装吗?新安装的 postgres 将在哪个端口监听?

postgresql
  • 1 个回答
  • 1941 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