Fedora 36にApache2.4.53 をインストールする方法
環境
OSバージョンを確認します
# cat /etc/redhat-release
Fedora release 36 (Thirty Six)
# cat /etc/redhat-release
Fedora release 36 (Thirty Six)
# cat /etc/redhat-release Fedora release 36 (Thirty Six)
Apache httpdのインストール手順
1.Apacheをインストールします
# dnf -y install httpd
# dnf -y install httpd
# dnf -y install httpd
httpdバージョンを確認します
# httpd -V
Server version: Apache/2.4.53 (Fedora Linux)
# httpd -V
Server version: Apache/2.4.53 (Fedora Linux)
# httpd -V Server version: Apache/2.4.53 (Fedora Linux)
2.サーバーの名前等を設定します
# vi /etc/httpd/conf/httpd.conf
91行目 管理者アドレスを指定
ServerAdmin contact@arkgame.com
100行目 メント解除しサーバーを指定
ServerName www.arkgame.com:80
ServerName www.arkgame.com:80
ServerName www.arkgame.com:80
149行目
修正前
Options Indexes FollowSymLinks
Options Indexes FollowSymLinks
Options Indexes FollowSymLinks
修正後
Options FollowSymLinks
Options FollowSymLinks
Options FollowSymLinks
156行目
修正前
AllowOverride None
修正後
AllowOverride All
169行目
修正前
DirectoryIndex index.html
DirectoryIndex index.html
DirectoryIndex index.html
修正後
DirectoryIndex index.html index.php index.cgi
DirectoryIndex index.html index.php index.cgi
DirectoryIndex index.html index.php index.cgi
最終行に以下の内容を追記します
ServerTokens Prod
httpd自動起動を設定します
# systemctl enable --now httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
# systemctl enable --now httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
# systemctl enable --now httpd Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
3.Firewalld を有効にしている場合は HTTP サービスの許可を設定します
# firewall-cmd --add-service=http
success
# firewall-cmd --runtime-to-permanent
success
# firewall-cmd --add-service=http
success
# firewall-cmd --runtime-to-permanent
success
# firewall-cmd --add-service=http success # firewall-cmd --runtime-to-permanent success
4.テストページを作成します
# vi /var/www/html/index.html
以下の内容を追記します
<html>
<body>
<div>
Apache Test Page
</div>
</body>
</html>
<html>
<body>
<div>
Apache Test Page
</div>
</body>
</html>
<html> <body> <div> Apache Test Page </div> </body> </html>
5.動作確認
Webブラウザを起動し、http://192.168.71.128/にアクセスします。
「Apache Test Page」が表示されます。
Webブラウザを起動し、http://192.168.71.128/にアクセスします。
「Apache Test Page」が表示されます。
Webブラウザを起動し、http://192.168.71.128/にアクセスします。 「Apache Test Page」が表示されます。