トップ 差分 一覧 ping ソース 検索 ヘルプ PDF RSS ログイン

CentOS7


RSS 無料英単語

目次



記事一覧

キーワード

CentOS7

[CentOS]

Tips

 ネットワーク

 IPアドレス

確認

# ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:f5:18:8e brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.35/24 brd 192.168.0.255 scope global dynamic enp0s3
       valid_lft 85143sec preferred_lft 85143sec
    inet6 2402:6b00:3498:1a00:a00:27ff:fef5:188e/64 scope global noprefixroute dynamic
       valid_lft 260sec preferred_lft 260sec
    inet6 fe80::a00:27ff:fef5:188e/64 scope link
       valid_lft forever preferred_lft forever

設定変更

# nmtui

 Httpdのインストール

インストール

# yum install httpd
# systemctl start httpd
# systemctl enable httpd

ファイアーウォールの設定

# firewall-cmd --permanent --zone=public --add-service=http
success
# firewall-cmd --permanent --zone=public --add-service=https
success
# firewall-cmd --reload
success

 Host名の変更

# hostnamectl set-hostnamee [hostname]

ランレベルの切り替え

ランレベル3
# systemctl set-default multi-user.target
ランレベル5
# systemctl set-default graphical.target

 Firewall

ポート開放

# firewall-cmd --permanent --zone=public --add-port=3306/tcp
success
# firewall-cmd --reload
success

HTTPを許可

# firewall-cmd --add-service=http --zone=public --permanent
# firewall-cmd --reload

 SELinux

無効化

  • /etc/selinux/config
#SELINUX=enforcing
SELINUX=disabled

 SSH認証用KEY作成

[piroto@ganzin ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/piroto/.ssh/id_rsa):
Created directory '/home/piroto/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/piroto/.ssh/id_rsa.
Your public key has been saved in /home/piroto/.ssh/id_rsa.pub.
The key fingerprint is:
c7:75:49:7e:b7:db:6c:09:aa:1d:3f:90:75:34:75:fe piroto@ganzin
The key's randomart image is:
+--[ RSA 2048]----+
|              . +|
|             o =.|
|            . = =|
|         . . o o+|
|        S o o...E|
|         . o. ..+|
|           o.  o+|
|          o o. . |
|         . . ..  |
+-----------------+



YAGI Hiroto (piroto@a-net.email.ne.jp)
twitter http://twitter.com/pppiroto