0
1

More than 1 year has passed since last update.

OracleVM VirtualBox_Apache設定

Posted at

1. 事前

httpdを起動する。

# systemctl start httpd.service

ブラウザで「http://IPアドレス」を入力する。
IPアドレスはteratermでCentOSにログインする際のアドレスと同じ。
結果としてはアクセス不可になる。
CentOS上のFirewallが有効になっていることが原因のため、
httpd通信を許可する設定を行っていく必要がある。

2.設定変更

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

Firewall設定を読み込むために再起動を行う。

# firewall-cmd --reload
success

Firewall設定で、サービス欄にhttpが追加されていることを確認をする。

# firewall-cmd --zone=public --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s3
  sources:
  services: dhcpv6-client http ssh
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

再度ブラウザで「http://IPアドレス」を入力する。
Apatcheのデフォルトページが表示されることを確認する。

3.ページを作成する

# vi /var/www/html/index.html
<html>
<head>
 <title>Test Page</title>
</head>
 <h1>Hello Apache</h1>
</body>
</html>
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1