OSバージョン確認
cat /etc/redhat-release
hostnameを変更
hostnamectl set-hostname proxy-test
デバイスを確認
nmcli device
インターフェイスを有効化
nmcli connection modify eth0 connection.autoconnect yes
IPアドレス変更
nmcli connection modify eth0 ipv4.addresses "192.168.56.99/24"
nmcliでNW再起動
nmcli con up <NICデバイス>
teratermでUSERに接続
firewalld停止
systemctl stop firewalld
SElinuxのステータス確認
getenforce
SELinuxを無効化する。SELINUX=enforcingからdisabledに修正
vi /etc/sysconfig/selinux
[root@proxy-test~]# vi /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled ★
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
OSを再起動
reboot
SElinuxのステータス確認
getenforce
Apacheのインストール
yum install httpd
SSLモジュールのインストール
yum -y install mod_ssl
Apacheのモジュール一覧を表示
httpd -M
Apacheのバーチャルホストの設定一覧を表示
httpd -S
Apacheのバージョン情報表示
httpd -V
apachectl -v
httpd サービスを起動する
systemctl start httpd
echo "Test Web server." > /var/www/html/test.html
HTTPリクエストで確認
curl http://localhost:80/test.html
プロセス確認
ps aux | grep -e httpd -e USER | grep -v grep
OS確認
mount -v
df -hT
rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort > `hostname`_rpmqa_before_`date +%Y%m%d`.log
systemctl が「起動失敗」としか返してこない場合、
実際に Apache が読み込んでエラーを吐いている行を確認しないと原因は特定できません。
まずは 必ず 3 ステップでログを確認。
1) 構文チェックだけ実行
$ /usr/sbin/httpd -t
2) systemd が拾った最新 50 行を見る
$ journalctl -u httpd -n 50 --no-pager
3) 詳細を見たい時は
$ systemctl status httpd -l

コメント