Skip to content

Commit cb7613e

Browse files
authoredFeb 2, 2019
Add Redhat_N_Apache.md
1 parent 3719581 commit cb7613e

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
 

‎Redhat_N_Apache.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Redhat7.6 に Apache2.4入れてみた
2+
3+
EC2 RedHat7.6
4+
T2.micro
5+
6+
セキュリティグループとか何も設定してない
7+
8+
```
9+
# とりあえずアップデートする
10+
$ sudo yum repolist all
11+
$ sudo yum update
12+
```
13+
14+
RHEL標準のApacheをインストール
15+
16+
```
17+
# 標準のApache(httpd)をインストール
18+
$ sudo yum install httpd -y
19+
```
20+
21+
インストール直後にApacheの起動を確認する。
22+
23+
```
24+
# 起動
25+
$ sudo systemctl start httpd
26+
27+
# 状態の確認
28+
$ sudo systemctl status httpd
29+
● httpd.service - The Apache HTTP Server
30+
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
31+
Active: active (running) since Sat 2019-02-02 01:06:28 UTC; 1min 21s ago
32+
Docs: man:httpd(8)
33+
man:apachectl(8)
34+
Main PID: 29765 (httpd)
35+
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
36+
CGroup: /system.slice/httpd.service
37+
├─29765 /usr/sbin/httpd -DFOREGROUND
38+
├─29766 /usr/sbin/httpd -DFOREGROUND
39+
├─29767 /usr/sbin/httpd -DFOREGROUND
40+
├─29768 /usr/sbin/httpd -DFOREGROUND
41+
├─29769 /usr/sbin/httpd -DFOREGROUND
42+
└─29770 /usr/sbin/httpd -DFOREGROUND
43+
44+
Feb 02 01:06:28 ip-10-0-45-109.ap-northeast-1.compute.internal systemd[1]: Starting The Apache HTTP Server...
45+
Feb 02 01:06:28 ip-10-0-45-109.ap-northeast-1.compute.internal systemd[1]: Started The Apache HTTP Server.
46+
```
47+
48+
※ 環境によるが起動時にWarningが発生するの場合があるので、原因となるファイルを修正する。
49+
50+
```
51+
# 「ServerName localhost:80」を追記する
52+
$ sudo vi /etc/httpd/conf/httpd.conf
53+
```
54+
55+
最後に自動起動設定を行う。
56+
57+
```
58+
$ sudo systemctl enable httpd
59+
```

0 commit comments

Comments
 (0)
Please sign in to comment.