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

Alex's questions

Martin Hope
Alex
Asked: 2016-04-28 14:54:51 +0800 CST

在 CentOS 7 上设置默认网关并使用 route 和 netstat -r 显示它

  • 0

我正在关注此处找到的有关如何为每个适配器设置网关以及默认网关的教程:

http://linux-training.be/sysadmin/ch22.html

但是当我运行命令时

$ route

和

$ netstat -r

网关没有出现,如教程中所示。

这是我的相关文件:

$ cat /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=lvs
GATEWAY=192.168.1.1


$ cat /etc/sysconfig/network-scripts/ifcfg-eth0

NAME=eth0
DEVICE=eth0
TYPE=Ethernet
NM_CONTROLLED=no
BOOTPROTO=none
ONBOOT=yes

HWADDR=08:00:27:47:BD:B3

IPADDR0=192.168.1.100
GATEWAY=192.168.1.1
NETMASK=255.255.255.0


$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s3

TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s3
UUID=5cc476e7-c116-41f0-bcb6-129fdba369ba
DEVICE=enp0s3
ONBOOT=yes

我想我已经正确地遵循了一切。所以我不明白为什么网关没有像教程中那样显示。

$ route

[root@lvs network-scripts]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         gateway         0.0.0.0         UG    0      0        0 eth0
link-local      0.0.0.0         255.255.0.0     U     1002   0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

$ netstat -r

[root@lvs network-scripts]# netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         gateway         0.0.0.0         UG        0 0          0 eth0
link-local      0.0.0.0         255.255.0.0     U         0 0          0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
centos linux-networking
  • 1 个回答
  • 16107 Views
Martin Hope
Alex
Asked: 2016-04-27 12:55:49 +0800 CST

是否可以使用云中的虚拟服务器进行直接服务器返回 DSR 负载平衡?

  • 1

如果我所有的液滴都来自同一个数据中心,是否可以在云中进行这种负载平衡,例如在 Digital Ocean 中?还是我需要某种物理设备来进行这种第 4 层负载平衡?

如此处所示:http: //blog.haproxy.com/2011/07/29/layer-4-load-balancing-direct-server-return-mode/

我喜欢负载均衡器只是分发然后服务器将请求直接回复给客户端的想法。这是否可以在没有物理硬件的情况下完成,但使用像 haproxy 这样的软件?

load-balancing haproxy
  • 1 个回答
  • 4522 Views
Martin Hope
Alex
Asked: 2016-04-27 11:20:36 +0800 CST

如何增加 Linux 上的打开文件限制?

  • 2

我正在使用 CentOS 7。我发现可以使用$ ulimit -a(查找打开的文件)查看当前值。

要不就$ ulimit -n

然后我尝试通过编辑文件来编辑这些限制

$ vim /etc/security/limits.conf

并添加这两行:

soft nofile 999999
hard nofile 999999

在快速重启并检查是否发生了什么事情之后

$ ulimit -n

它仍然是一样的,我得到 1024 作为输出。

如何更改此值并使其在重新启动后保持不变?

linux centos ulimit limits
  • 1 个回答
  • 4415 Views
Martin Hope
Alex
Asked: 2015-02-24 03:05:31 +0800 CST

由于某种原因无法更改 nginx 上的 root

  • 2

由于某种原因,我无法更改根。我拥有与默认 root 相同的权限,并且我对其他文件夹中的所有文件和文件夹/usr/share/nginx/html也具有递归权限。755我什至尝试将用户和组来回更改为 root 和 nginx,看看它是否有任何区别,但没有。我不断收到403 Forbidden

所以基本上我做了这个文件夹

$ mkdir -p /srv/www/test.com/public_html

$ vi /srv/www/test.com/public_html/index.html

$ vi /srv/www/test.com/public_html/test.php

$ chmod -R 755 /srv/www/test.com/public_html

试图将用户和组更改为 nginx

$ chown -R nginx:nginx /srv/www

配置主conf文件

$ vi /etc/nginx/nginx.conf

这就是我的配置的样子,包含被注释掉

user  nginx;
worker_processes  1;
error_log  /var/log/nginx/error.log;   
pid        /run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;
    sendfile        on;
    keepalive_timeout  65;
    index index.php index.html index.htm;

    server {

        listen       80;
        server_name  _;
        root /srv/www/test.com/public_html;
        # root  /usr/share/nginx/html;

        location / {
                autoindex on;
        }

        error_page  404 /404.html;

        location = /40x.html { }


        error_page   500 502 503 504  /50x.html;

        location = /50x.html { }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass   unix:/var/run/php-fpm/www.sock;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }

    }

}       

一切都在被注释掉的默认根文件夹中工作,但是当我更改根目录时,我得到 403 禁止。我觉得我已经尽我所能,更改用户和文件权限等等。php-fpm 有 nginx 作为用户和组。并且用户在 main.conf 文件中设置为 nginx。我只使用这一个文件来配置 nginx,并将包含的内容注释掉。

我不知道该怎么做。已经卡了几个小时了。任何帮助将不胜感激

nginx
  • 1 个回答
  • 2045 Views
Martin Hope
Alex
Asked: 2015-02-19 20:28:58 +0800 CST

无法更改 Centos 7 上的键盘布局

  • 12

我已经被这个问题困扰了好几个小时了,这真的很令人沮丧。

我在 Oracle Virtualbox 上安装了 Centos 7.0.1406,在安装过程中我选择了挪威语键盘布局,因为我有一个挪威语键盘。

问题出在 Ubuntu 上,一切正常,当我输入 æøå 时,我得到了这些字母。但是在 centos7 中出现了其他东西。最大的问题是我无法访问管道 | 字符,因为我不知道在键盘上的哪里可以找到它,因为默认键提供了其他东西。

我一直在四处寻找,人们一直说我必须编辑 /etc/sysconfig/keyboard 但 /etc/sysconfig 中没有键盘

我不知道该怎么做。

将永远非常感谢提示!

centos
  • 2 个回答
  • 26023 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

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助
subwaysurfers
my femboy roommate

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve