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

DiogoSaraiva's questions

Martin Hope
DiogoSaraiva
Asked: 2016-09-09 06:31:26 +0800 CST

在 CentOS 7 实例中重新启动后主机名不会持续存在

  • 5

我正在尝试hostnamectl set-hostname server.domain.tld在 CentOS 7 中设置主机名,但是当我重新启动时它返回到 sp-30.localdomain

我总是使用该命令来更改主机名,但现在无法正常工作,所以或者我错过了一些东西或者是一些错误?

但是,我怎样才能永久更改我的主机名?

在重新启动之前,我检查 /etc/hostname 文件及其正确,但是当我重新启动时它会恢复

“SP-30”是我给 OVH 公共云中的实例起的名字。

centos networking hostname centos7
  • 2 个回答
  • 4049 Views
Martin Hope
DiogoSaraiva
Asked: 2016-05-25 14:41:58 +0800 CST

phpMyAdmin(带有别名)如何具有不同 documentRoot 的虚拟主机子域

  • 1

为了提高服务器的安全性,我只为管理员创建了一个子域,例如admin.domain.tld,通常我只admin.domain.tld/mysqladmin在配置文件中访问 phpmyadmin:

<VirtualHost *:80>

    ServerName admin.domain.tld
    Alias /mysqladmin /usr/share/phpMyAdmin/

    <Directory /usr/share/phpMyAdmin/>
        AddDefaultCharset UTF-8
        AllowOverride All

    [...]

</VirtualHost>

现在我有一个子域,我想对其进行 SSL 保护,因为我需要配置一个虚拟主机或类似的东西,(我使用 certbot aka let's encrypt),但由于我必须配置一个虚拟主机,我决定创建一个仅管理 html 页面,admin.domain.tld其中包含指向我的管理页面(如 phpmyadmin、joomla 管理页面等)的链接...

配置文件:

    ServerName  admin.domain.tld

    DocumentRoot /var/www/admin.domain.tld
    ErrorLog /var/log/httpd/admin.domain.tld/error.log
    <Directory /var/www/admin.domain.tld>
            Options FollowSymLinks Indexes
            AllowOverride All
    </Directory>

但现在当我去admin.domain.tld/mysqladmin我得到一个错误:

The requested URL /mysqladmin/ was not found on this server.

那么,我怎样才能让它像这样工作:

admin.domain.tld 是 /var/www/admin.domain.tld
和
admin.domain.tld/mysqladmin 是 phpmyadmin

编辑:我想我的问题是别名不起作用所以当我去 admin.domain.tld 它显示 /var/www/admin.domain.tld/mysqladmin 而不是 /usr/share/phpMyAdmin

centos virtualhost .htaccess httpd
  • 2 个回答
  • 1356 Views
Martin Hope
DiogoSaraiva
Asked: 2016-05-06 14:21:08 +0800 CST

如果不推荐使用,我应该使用什么来代替 eth0:1

  • 1

通常我创建/etc/sysconfig/network-scripts/ifcfg-eth0:1 ,/etc/sysconfig/network-scripts/ifcfg-eth0:2但我在互联网上看到它已被弃用使用 eth0 :1

那么我可以用什么来让 VPS 使用额外的 IP?

通常我的文件是:

DEVICE=eth0
BOOTPROTO=static
IPADDR=164.132.193.xxx
NETMASK=255.255.255.255
ONBOOT=yes
GATEWAY=164.132.192.1 

和新的

在 ifcfg-eth0:1

DEVICE=eth0:1
BOOTPROTO=static
IPADDR=91.134.28.xxx
NETMASK=255.255.255.255
ONBOOT=yes

在 ifcfg-eth0:2 中:

DEVICE=eth0:2
BOOTPROTO=static
IPADDR=91.134.158.xxx
NETMASK=255.255.255.255
ONBOOT=yes

我现在该怎么办?使用额外的IP,因为它已被弃用?

我在 CentOS/RHEL 6 中使用“ip”命令在重新启动时看到了这个Persist IP 地址别名

但我不知道额外的 IP 网关...

centos networking ip ip-aliasing centos7
  • 1 个回答
  • 205 Views
Martin Hope
DiogoSaraiva
Asked: 2016-04-26 15:49:28 +0800 CST

CentOS 7 VPS 中缺少 firewallD

  • 2

我在 OVH VPS 中全新安装了 CentOS 7。但是当我运行命令时,firewall-cmd我得到了这个:

-bash: firewall-cmd: command not found

所以我正在寻找如何解决这个问题,我发现基本上我需要安装它。

所以我试图完全禁用iptables:systemctl mask iptables但我收到一个奇怪的错误,因为我以root身份运行:

Failed to execute operation: Access denied

我之前也尝试过以下命令:

[root@vps****** ~]# systemctl status iptables
● iptables.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

和

[root@vps****** ~]# systemctl stop iptables
Failed to stop iptables.service: Unit iptables.service not loaded.

所以我认为iptables也没有安装但是当我运行命令时iptables --version我得到iptables v1.4.21了所以我猜它安装了......

那么,是什么导致 iptables 无法被 systemctl 识别,以及为什么没有默认安装 firewallD?

有些人因为 OpenVZ 也有类似的问题,但是 OVH 不再使用 OpenVZ...

系统信息:

cat /proc/sys/kernel/osrelease 
3.10.0-327.13.1.el7.x86_64

--

cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core) 
iptables centos7 systemctl firewalld ovh
  • 1 个回答
  • 1530 Views
Martin Hope
DiogoSaraiva
Asked: 2015-02-16 10:33:22 +0800 CST

我猜我的邮件服务器没有受到保护,垃圾邮件发送者正在使用我的邮件服务器向自己发送垃圾邮件[重复]

  • 0
这个问题在这里已经有了答案:
打击垃圾邮件 - 作为电子邮件管理员、域所有者或用户,我能做什么? (6 个回答)
7年前关闭。

由于我切换到自己的邮件服务器(我遵循了这两个教程:https ://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql和https://www.digitalocean .com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin)我在 15 分钟内发送了 15 次垃圾邮件……
为什么?

也许我的邮件服务器不安全?

今天我收到一封来自字段的邮件正是我在 postfix/dovecot 中配置的主机名(Ubuntu):请参阅:

From: Roberto@Ubuntu, Rojas@Ubuntu
To: ******@******.com
Subject: ***** SPAM 10.3 ***** your life will never be the same

他们是如何发现我的主机名的?

垃圾邮件发送者是否有可能进入我的计算机并查看/删除/编辑我的一些文件?

我也有 HTTP、FTP 和 telnet 7300 到合适的软件,同一台机器上的服务器

ubuntu
  • 1 个回答
  • 107 Views
Martin Hope
DiogoSaraiva
Asked: 2015-02-03 08:35:09 +0800 CST

如何配置子域以重定向到 apache 中的内部/本地 IP

  • 1

默认情况下,当我要访问我的外部 IP 或无 IP 域时,我会留在我的互联网路由器的页面上,直到我为我的站点设置 apache 并在路由器中打开端口 80...

我的问题是:
如何在我的服务器机器 192.168.1.104 的 apache 中配置重定向或重定向,例如使用本地 ip 192.168.1.254 的路由器?

我的目标是在无 ip 中创建一个子域,例如 router.example.com,当我访问它时,会出现我的路由器的登录页面(我家的 ip 是 192.168.1.254)

我试过这个:

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName router.example.com
    Redirect permanent / http://192.168.1.254

    ErrorLog ${APACHE_LOG_DIR}/router-error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/router-access.log combined

</VirtualHost>

但不能从外部工作......

redirect
  • 1 个回答
  • 1782 Views
Martin Hope
DiogoSaraiva
Asked: 2015-01-30 07:18:54 +0800 CST

无法将电子邮件接收到我的邮件服务器

  • 2

我按照本教程创建了一个邮件服务器:
https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql,

我在我的电子邮件客户端、SMTP 和 IMAP 上配置了电子邮件,并且两个连接都正常工作,我可以将电子邮件从我的电子邮件地址 ([email protected]) 发送到另一个 ([email protected]),我也可以阅读它,但是当我发送到我的电子邮件服务器的电子邮件地址([email protected])时,它会发送,但我在 [email protected] 的收件箱中看不到它...

创建了一个 mx 记录:example.com mx 10 example.com
并创建了一个 spf 记录:v=spf1 a mx ~all

邮件服务器位于 Ubuntu 14.04.1 桌面上。

结果dovecot -n

# 2.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 3.13.0-44-generic x86_64 Ubuntu 14.04.1 LTS ext4
auth_mechanisms = plain login
mail_location = maildir:/var/mail/vhosts/%d/%n
mail_privileged_group = mail
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = 
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocols = imap pop3 lmtp
service auth-worker {
  user = vmail
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-userdb {
    mode = 0600
    user = vmail
  }
  user = dovecot
}
service imap-login {
  inet_listener imap {
    port = 0
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
}
service pop3-login {
  inet_listener pop3 {
    port = 0
  }
}
ssl = required
ssl_cert = </etc/dovecot/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.pem
userdb {
  args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
  driver = static
}

结果netstat -panet:

tcp        0      0 0.0.0.0:995             0.0.0.0:*               ESCUTA      0          11309       986/dovecot     
tcp        0      0 0.0.0.0:7300            0.0.0.0:*               ESCUTA      1001       13485       1371/perl       
tcp        0      0 192.168.1.104:27754     0.0.0.0:*               ESCUTA      1001       13484       1371/perl       
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               ESCUTA      117        11024       1134/mysqld     
tcp        0      0 0.0.0.0:587             0.0.0.0:*               ESCUTA      0          11611       1232/master     
tcp        0      0 0.0.0.0:465             0.0.0.0:*               ESCUTA      0          11617       1232/master     
tcp        0      0 127.0.1.1:53            0.0.0.0:*               ESCUTA      0          12148       1486/dnsmasq    
tcp        0      0 0.0.0.0:21              0.0.0.0:*               ESCUTA      0          9546        993/vsftpd      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               ESCUTA      0          9555        980/sshd        
tcp        0      0 127.0.0.1:631           0.0.0.0:*               ESCUTA      0          8840        510/cupsd       
tcp        0      0 0.0.0.0:25              0.0.0.0:*               ESCUTA      0          11602       1232/master     
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               ESCUTA      1000       21171       3082/1          
tcp        0      0 0.0.0.0:993             0.0.0.0:*               ESCUTA      0          10582       986/dovecot     
tcp        0      0 192.168.1.104:993       85.242.102.178:50794    ESTABELECIDO 119        24686       3168/imap-login 
tcp        0      0 192.168.1.104:7300      78.111.205.56:45853     ESTABELECIDO 1001       21084       1371/perl       
tcp        0      0 192.168.1.104:993       85.242.102.178:55965    ESTABELECIDO 119        21384       3176/imap-login 
tcp        0    264 192.168.1.104:22        192.168.1.90:57457      ESTABELECIDO 0          21118       3046/sshd: diogosar
tcp        0      0 192.168.1.104:993       85.242.102.178:57359    ESTABELECIDO 119        21396       3178/imap-login 
tcp6       0      0 :::995                  :::*                    ESCUTA      0          11310       986/dovecot     
tcp6       0      0 :::587                  :::*                    ESCUTA      0          11612       1232/master     
tcp6       0      0 :::80                   :::*                    ESCUTA      0          10956       1340/apache2    
tcp6       0      0 :::465                  :::*                    ESCUTA      0          11618       1232/master     
tcp6       0      0 :::22                   :::*                    ESCUTA      0          9557        980/sshd        
tcp6       0      0 :::25                   :::*                    ESCUTA      0          11603       1232/master     
tcp6       0      0 ::1:6010                :::*                    ESCUTA      1000       21170       3082/1          
tcp6       0      0 :::993                  :::*                    ESCUTA      0          10583       986/dovecot   

我的问题是:如果我向它发送电子邮件,为什么我在电子邮件中看不到收件箱?我也尝试过使用 POP3 ......

更新:

文件摘录:/var/log/mail.log:

Jan 29 15:07:43 Ubuntu postfix/error[3196]: AA1E22C3528: to=<[email protected]>, relay=none, delay=59795, delays=59795/0.06/0/0, dsn=4.4.2, status=deferred (delivery temporarily suspended: lost connection with Ubuntu[private/dovecot-lmtp] while receiving the initial server greeting)
    Jan 29 15:11:03 Ubuntu postfix/scache[3193]: statistics: start interval Jan 29 15:07:43
    Jan 29 15:11:03 Ubuntu postfix/scache[3193]: statistics: domain lookup hits=0 miss=2 success=0%
    Jan 29 15:12:43 Ubuntu postfix/qmgr[3157]: 225BE2C3568: from=<[email protected]>, size=519, nrcpt=1 (queue active)
    Jan 29 15:12:43 Ubuntu dovecot: lmtp(3217): Fatal: Error reading configuration: Invalid settings: postmaster_address setting not given
    Jan 29 15:12:43 Ubuntu postfix/lmtp[3216]: 225BE2C3568: to=<[email protected]>, relay=Ubuntu[private/dovecot-lmtp], delay=58634, delays=58634/0.03/0.01/0, dsn=4.4.2, status=deferred (lost connection with Ubuntu[private/dovecot-lmtp] while receiving the initial server greeting)
    Jan 29 15:17:43 Ubuntu postfix/qmgr[3157]: 083672C3576: from=<[email protected]>, size=697, nrcpt=1 (queue active)
    Jan 29 15:17:43 Ubuntu dovecot: lmtp(3225): Fatal: Error reading configuration: Invalid settings: postmaster_address setting not given
    Jan 29 15:17:43 Ubuntu postfix/lmtp[3224]: 083672C3576: to=<[email protected]>, relay=Ubuntu[private/dovecot-lmtp], delay=57731, delays=57731/0.03/0.01/0, dsn=4.4.2, status=deferred (lost connection with Ubuntu[private/dovecot-lmtp] while receiving the initial server greeting)
    Jan 29 15:20:52 Ubuntu dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=85.242.102.178, lip=192.168.1.104, mpid=3232, TLS, session=<wzqYCMwNSQBV8may>
    Jan 29 15:22:43 Ubuntu postfix/qmgr[3157]: 369702C3665: from=<>, size=2930, nrcpt=1 (queue active)
    Jan 29 15:22:43 Ubuntu postfix/qmgr[3157]: F0A022C3538: from=<[email protected]>, size=1260, nrcpt=1 (queue active)
    Jan 29 15:22:43 Ubuntu postfix/qmgr[3157]: 0A11C2C3581: from=<[email protected]>, size=525, nrcpt=3 (queue active)
    Jan 29 15:22:43 Ubuntu dovecot: lmtp(3654): Fatal: Error reading configuration: Invalid settings: postmaster_address setting not given
    Jan 29 15:22:43 Ubuntu dovecot: lmtp(3657): Fatal: Error reading configuration: Invalid settings: postmaster_address setting not given
    Jan 29 15:22:43 Ubuntu postfix/lmtp[3652]: 369702C3665: to=<[email protected]>, relay=Ubuntu[private/dovecot-lmtp], delay=30046, delays=30046/0.03/0.01/0, dsn=4.4.2, status=deferred (lost connection with Ubuntu[private/dovecot-lmtp] while receiving the initial server greeting)
    Jan 29 15:22:43 Ubuntu postfix/lmtp[3653]: F0A022C3538: to=<[email protected]>, relay=Ubuntu[private/dovecot-lmtp], delay=21441, delays=21441/0.02/0.01/0, dsn=4.4.2, status=deferred (lost connection with Ubuntu[private/dovecot-lmtp] while receiving the initial server greeting)
    Jan 29 15:22:43 Ubuntu dovecot: lmtp(3660): Fatal: Error reading configuration: Invalid settings: postmaster_address setting not given
    Jan 29 15:22:43 Ubuntu postfix/lmtp[3652]: 0A11C2C3581: to=<[email protected]>, relay=Ubuntu[private/dovecot-lmtp], delay=30047, delays=30047/0.03/0.02/0, dsn=4.4.2, status=deferred (lost connection with Ubuntu[private/dovecot-lmtp] while receiving the initial server greeting)
    Jan 29 15:26:03 Ubuntu postfix/scache[3659]: statistics: start interval Jan 29 15:22:43
    Jan 29 15:26:03 Ubuntu postfix/scache[3659]: statistics: domain lookup hits=0 miss=1 success=0%
    Jan 29 15:29:44 Ubuntu postfix/smtpd[3765]: connect from nk11p03mm-asmtp001.mac.com[17.158.232.236]
    Jan 29 15:29:45 Ubuntu postfix/smtpd[3765]: BE8582C34DE: client=nk11p03mm-asmtp001.mac.com[17.158.232.236]
    Jan 29 15:29:45 Ubuntu postfix/cleanup[3776]: BE8582C34DE: message-id=<[email protected]>
    Jan 29 15:29:45 Ubuntu postfix/qmgr[3157]: BE8582C34DE: from=<[email protected]>, size=1267, nrcpt=1 (queue active)
    Jan 29 15:29:45 Ubuntu dovecot: lmtp(3780): Fatal: Error reading configuration: Invalid settings: postmaster_address setting not given
    Jan 29 15:29:45 Ubuntu postfix/lmtp[3779]: BE8582C34DE: to=<[email protected]>, relay=Ubuntu[private/dovecot-lmtp], delay=0.23, delays=0.21/0.01/0.01/0, dsn=4.4.2, status=deferred (lost connection with Ubuntu[private/dovecot-lmtp] while receiving the initial server greeting)
    Jan 29 15:29:46 Ubuntu postfix/smtpd[3765]: disconnect from nk11p03mm-asmtp001.mac.com[17.158.232.236]

结果:telnet cr7akg.com smtp

Trying 85.242.102.178...
Connected to cr7akg.com.
Escape character is '^]'.
220 Ubuntu ESMTP Postfix (Ubuntu)

结果:telnet 192.168.1.104 smtp

Trying 192.168.1.104...
Connected to ubuntu.lan.
Escape character is '^]'.
220 Ubuntu ESMTP Postfix (Ubuntu)
postfix
  • 2 个回答
  • 2291 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