| httpd インストール/設定2013/07/08 | 
| 
httpd をインストールしてWebサーバーを構築します。
事前にファイアウォールの設定で80番ポートと443ポートを通しておいてください。
 | |
| [1] | httpd インストール | 
| 
[root@www ~]#  yum -y install httpd  # ウェルカムページ削除 [root@www ~]# rm -f /etc/httpd/conf.d/welcome.conf | 
| [2] | httpd の設定です。サーバーの名前等は自分の環境に置き換えて設定してください。 | 
| 
[root@www ~]#  vi /etc/httpd/conf/httpd.conf  # 86行目:管理者アドレス指定 ServerAdmin root@srv.world # 95行目:コメント解除しサーバー名指定 ServerName www.srv.world:80 # 151行目:変更 AllowOverride All # 164行目:ディレクトリ名のみでアクセスできるファイル名を追記 DirectoryIndex index.html index.cgi index.php # 最終行に追記 # サーバーの応答ヘッダ ServerTokens Prod # キープアライブオン KeepAlive On systemctl start httpd.service  [root@www ~]# systemctl enable httpd.service  | 
| [3] | HTMLテストページを作成して動作確認をします。作成したテストページにWebブラウザでアクセスして、以下のようなページが表示されればOKです。 | 
| 
[root@www ~]#  vi /var/www/html/index.html  <html> <body> <div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> Test Page </div> </body> </html> | 
|   | 
| Sponsored Link | 
|  |