httpdのセットアップとWebページ公開
インストール
code:bash
$ yum install -y httpd
$ httpd -version
Server version: Apache/2.4.34 ()
Server built: Sep 1 2018 05:35:00
起動、自動起動
systemdが使えるのでそっちを使う
code:bash
$ systemctl enable httpd
$ systemctl start httpd
$ ps aux | grep httpd
root 3374 0.0 0.7 307296 7792 ? Ss 13:21 0:00 httpd --version
apache 3375 0.0 0.6 348412 6892 ? Sl 13:21 0:00 httpd --version
apache 3376 0.0 0.6 348412 6892 ? Sl 13:21 0:00 httpd --version
apache 3377 0.0 0.6 545084 6900 ? Sl 13:21 0:00 httpd --version
apache 3378 0.0 0.6 348412 6892 ? Sl 13:21 0:00 httpd --version
apache 3379 0.0 0.6 348412 6892 ? Sl 13:21 0:00 httpd --version
root 3479 0.0 0.0 119468 972 pts/0 S+ 13:24 0:00 grep --color=auto httpd
index.htmlの配置
code:/var/www/html/index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>トップページ</title>
</head>
<body>
Hello World!
</body>
</html>
localhostで確認
code:bash
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>トップページ</title>
</head>
<body>
Hello World!
</body>
</html>
他、設定ファイルを眺めるだけ。ほとんどいじらず。
/etc/httpd/conf/httpd.conf
/etc/httpd/conf.d/autoindex.conf
/etc/httpd/conf.d/userdir.conf
/etc/httpd/conf.d/welcome.conf