トップ 一覧 ping 検索 ヘルプ RSS ログイン

CentOS7の変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!!!CentOS7
[CentOS]

!!CentOS 初期設定
*CentOS 初期設定
!!!Tips
!!!Service
!!systemctl
!稼働中のサービス
 systemctl list-units --type=service
!定義されているサービス
 systemctl list-unit-files --type=service
!サービス状態
 systemctl status [サービス]
 systemctl is-enabled [サービス]
,option,意味
,is-active,Check whether units are active
,is-enabled,Check whether unit files are enabled
,is-failed,Check whether units are failed

!run level の変更
,run level,説明,コマンド
,1,シングルユーザモード, systemctl set-default rescue.target
,3,CLI マルチユーザモード, systemctl set-default multi-user.target
,5,GUI マルチユーザモード, systemctl set-default graphical.target


!!GUI
!シェルを実行するとエディタが開いてしまう。
*ファイルを選択、メニュー - ファイル - 設定 - 動作 から 実行可能ファイルは実行するにチェック
{{ref_image centos7_shell_run_gui.jpg}}

!日本語表示
~/.bash_profile の末尾に以下を記述
 LANG=ja_JP.UTF-8
 export LANG

!ユーザーディレクトリを英語に変更

 $ LANG=C xdg-user-dirs-gtk-update
!!ネットワーク
!設定系コマンド
*nmcli
*nmtui
*rfkill
!!メールサーバー構築
*http://typea.info/blg/glob/2015/06/centospython.html
!!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

!https
*https://qiita.com/jinnai73/items/638dcc1434d47b12e6ba
!!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. . |
 |         . . ..  |
 +-----------------+

!!PHPのインストール
*PHP