Skip to content

Latest commit

 

History

History
94 lines (62 loc) · 1.61 KB

0527.md

File metadata and controls

94 lines (62 loc) · 1.61 KB

0527

network

$ nmtui

$ ping 10.6.53.5

$ ping 10.6.53.6

$ nmcli connection show
$ nmcli c s

$ nmcli connection mod "Wired connection 2" ipv4.address "10.6.53.50/24"
$ nmcli c m

$ nmcli connection mod "Wired connection 2" +ipv4.address "10.6.53.50/24"

$ nmcli connection mod "Wired connection 2" -ipv4.address "10.6.53.50/24"

$ nmcli connection up "Wired connection 2"

$ ping 10.6.53.50

DNS

$ cat /etc/hosts

$ cat /etc/nsswitch.conf

search DNS

# Windows
$ nslookup tw.yahoo.com

# macOS
$ sudo dnf install -y bind-utils

$ host tw.yahoo.com

# ipv4
$ host -t a tw.yahoo.com

# ipv6
$ host -t aaaa tw.yahoo.com

virtual host

$ dnf install httpd

$ systemctl enable --now httpd

$ firewall-cmd --add-service=http --permanent

$ firewall-cmd --reload

$ vi /etc/hosts
# 10.6.53.6 serverb www.domain.com web1.example.com web2.linux.class

$ cd /etc/httpd/conf.d

$ sudo cp /usr/share/doc/httpd/httpd-vhosts.conf www.web1.example.com.conf

$ vi www.web1.example.com.conf

$ cd /var/www/html

$ mkdir web1.example.com

$ cd web1.example.com

$ vi index.html

$ systemctl restart httpd

$ curl http://web1.example.com
<VirtualHost *:80>
    ServerAdmin webmaster@web1.example.com
    DocumentRoot "/var/www/html/web1.example.com"
    ServerName web1.example.com
    ServerAlias www.web1.example.com
    ErrorLog "/var/log/httpd/web1.example.com-error_log"
    CustomLog "/var/log/httpd/web1.example.com-access_log" common
</VirtualHost>