<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>httpd | じじぃの引出し</title>
	<atom:link href="https://www.kazuban.com/blog/tag/httpd/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.kazuban.com/blog</link>
	<description>なにかしら、皆さんの参考になれば幸いです！</description>
	<lastBuildDate>Mon, 22 Dec 2025 23:10:55 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.kazuban.com/blog/wp-content/uploads/2020/05/cropped-ICON-1-32x32.png</url>
	<title>httpd | じじぃの引出し</title>
	<link>https://www.kazuban.com/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>httpd インストール後の設定</title>
		<link>https://www.kazuban.com/blog/httpd-setting/</link>
		
		<dc:creator><![CDATA[kazuban]]></dc:creator>
		<pubDate>Mon, 15 Jul 2019 07:07:37 +0000</pubDate>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux (CentOS、Rocky、Ubuntu)]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[覚書]]></category>
		<guid isPermaLink="false">https://www.kazuban.com/blog/?p=945</guid>

					<description><![CDATA[インストール後ウェルカムページが表示されれば、apache は正常に動作しています次には、自分の環境に合わせてセキュリティ強化も含めて設定していきます こちらのサイトがとても分かりやすいですほとんどサイト通りで設定できる [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><a href="https://www.kazuban.com/blog/apache-install/">インストール後ウェルカムページが表示されれば、apache は正常に動作しています</a><br>次には、自分の環境に合わせてセキュリティ強化も含めて設定していきます</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><a href="https://www.rem-system.com/centos-httpd-inst/#httpd-6">こちらのサイトがとても分かりやすいです</a><br>ほとんどサイト通りで設定できると思います</p></blockquote>



<p>私も、参考に設定しましたが、ほとんどトラブルなく設定できました。<br>後々の覚書として自分の設定を書き込んでおこうと思います<br>また、設定する場合には、設定ファイルを「vi」などのエディタで編集する事になりますが、編集する前にファイルをコピーして「org」などと名前を変えて残しておいたほうが安全です。<br>設定ミスで動作しなくなった場合、名前を戻す事で元にもどせます<br>また、すでに書かれている項目を編集する際も、直接編集しないで、その行をコピーしてコメントとして残しておいたほうが後で参考にできる場合があります<br>さらにその上の行に、日付けと検索しやすいように分かりやすいキー文字をコメントとして残しておくと後に検索する場合などに重宝します</p>



<h3 class="wp-block-heading"><span id="toc1">/etc/httpd/conf/httpd.conf を編集</span></h3>



<pre class="wp-block-preformatted">$ cd /etc/httpd/conf/
$ sudo vi ./httpd.conf
　　・
　　・
 User apache　　&lt;---- 参考サイトでは、「www」に変更していますが
 Group apache　　私は、既存のBBSなどとの互換性も考えて、「apatch」に設定しました
　　・
　　・
 #---- 2019.05.01 Hogehoge
 #ServerAdmin root@localhost
 ServerAdmin hoge@hogehoge.com
　　・
　　・
  #---- 2019.05.01 Hogehoge
  #ServerName www.example.com:80
  ServerName www.Hogehoge.com:80
　　・
　　・
 #---- 2019.05.01 hogehoge
 #DocumentRoot "/var/www/html"　  &lt;---- /var の容量は多くしていないので
 DocumentRoot "/home/www/html"　　　　  /home に変更 
　　・
　　・
 #---- 2019.05.01 hogehoge
 #&lt;Directory "/var/www"&gt;  
 &lt;Directory "/home/www"&gt;          &lt;---- /home に合わせる  
    AllowOverride None
    # Allow open access:
    Require all granted
 &lt;/Directory&gt;
　　・
　　・ 
 #---- 2019.05.01 hogehoge
 #&lt;Directory "/var/www/html"&gt;
 &lt;Directory "/home/www/html"&gt;　　&lt;---- /home に合わせる   
　　・
　　・  
 #---- 2019.05.01 hogehoge
  #Options Indexes FollowSymLinks  &lt;--- ファイル一覧を表示させない 
  Options  FollowSymLinks
　　・
　　・  
　#---- 2019.05.01 hogehoge
　#&lt;Directory "/var/www/cgi-bin"&gt;
　&lt;Directory "/home/www/cgi-bin"&gt; 　&lt;---- /home に合わせる 
    AllowOverride None
    Options None
    Require all granted
　&lt;/Directory&gt;
　　・
　　・  
  #----- 2019.05.01 hogehoge
  #HTTP TRACE off
  TraceEnable off
　　・
　　・  
  Header append X-FRAME-OPTIONS "SAMEORIGIN"
　　・
　　・  
  ServerTokens ProductOnly   &lt;------　追加
  ServerSignature off        &lt;------　追加
 </pre>



<h3 class="wp-block-heading"><span id="toc2">ドキュメントの保存ディレクトリを作成</span></h3>



<p>設定が終了したら、「httpd.conf」を保存します<br>上記設定で、サイトのコンテンツを作成する場所を「/var/www/」から「/home/www/」に変更したので、必要なディレクトリを作成します</p>



<pre class="wp-block-preformatted">$ cd /home
$ sudo mkdir www
$ cd www
$ sudo mkdir cgi-bin
$ sudo mkdir html</pre>



<h3 class="wp-block-heading"><span id="toc3">不要なファイルを削除して、httpd 再起動</span></h3>



<p>「autoindex.conf」「welcome.conf」このファイル<br>セキュリティ的に不要なファイルだと言うことなので、名前を変更しておきます</p>



<pre class="wp-block-preformatted">$ cd /etc/httpd/conf.d/
$ sudo mv autoindex.conf autoindex.conf.org
$ sudo mv welcome.conf welcome.conf.org 

$ httpd -t
Syntax OK
$ sudo systemctl restart httpd</pre>



<h3 class="wp-block-heading"><span id="toc4">HTTP TRACE無効化と<br> クリックジャッキング攻撃の対策 </span></h3>



<p>HTTP TRACEメソッドは無効にしたほうが良いとの事なので、「 TraceEnable off」の設定で無効にしました<br>これの確認には、「telnet」コマンドを使用するようです。<br>インストールした、centOS7にはインストールされていなかったので、インストールします</p>



<pre class="wp-block-preformatted"> $ sudo yum -y install telnet
 読み込んだプラグイン:fastestmirror, langpacks
 Loading mirror speeds from cached hostfile
 base: ftp.iij.ad.jp
 extras: ftp.iij.ad.jp
 updates: ftp.iij.ad.jp
 base                                                     | 3.6 kB     00:00
 extras                                                   | 3.4 kB     00:00
 updates                                                  | 3.4 kB     00:00
 依存性の解決をしています
 --&gt; トランザクションの確認を実行しています。
 ---&gt; パッケージ telnet.x86_64 1:0.17-64.el7 を インストール
 --&gt; 依存性解決を終了しました。 
 依存性を解決しました
 ================================================================================
  Package          アーキテクチャー バージョン              リポジトリー    容量
 インストール中:
  telnet           x86_64           1:0.17-64.el7           base            64 k
 トランザクションの要約
 インストール  1 パッケージ
 総ダウンロード容量: 64 k
 インストール容量: 113 k
 Downloading packages:
 telnet-0.17-64.el7.x86_64.rpm                              |  64 kB   00:00
 Running transaction check
 Running transaction test
 Transaction test succeeded
 Running transaction
   インストール中          : 1:telnet-0.17-64.el7.x86_64                     1/1
   検証中                  : 1:telnet-0.17-64.el7.x86_64                     1/1
 インストール:
   telnet.x86_64 1:0.17-64.el7
 完了しました!</pre>



<p>TRACE無効化の確認をしてみます</p>



<pre class="wp-block-preformatted">$ telnet localhost 80
 Trying 127.0.0.1…
 Connected to localhost.
 Escape character is '^]'.
 OPTIONS / HTTP/1.1
 host: localhost
 HTTP/1.1 200 OK
 Date: Mon, 15 Jul 2019 05:28:31 GMT
 Server: Apache                     &lt;----- apacheのバージョンは見えない
 Allow: GET,HEAD,POST,OPTIONS       &lt;--------- TRACE がないのでOK
 X-FRAME-OPTIONS: SAMEORIGIN        &lt;--------- OK 
 Content-Length: 0
 Content-Type: text/html; charset=UTF-8
 Connection closed by foreign host.</pre>



<h3 class="wp-block-heading"><span id="toc5">OpenSSL の設定</span></h3>



<p>これから、https化に向けてサーバ設定していこうと思っていますから、SSLの対策も必要なようですので、上サイトを参考に設定していきます<br>OpenSSLのバージョンは最新にします</p>



<pre class="wp-block-preformatted">$ sudo yum install openssl
　・
　・
　・
　・
 パッケージ 1:openssl-1.0.2k-16.el7_6.1.x86_64 はインストール済みか最新バージョンです
 何もしません</pre>



<p>最新だったようです。<br>次に、「/etc/httpd/conf.d/ssl.conf」に推奨の設定をしていきます。<br>一応、バックアップしてから、編集しようと思います</p>



<pre class="wp-block-preformatted">$ cd /etc/httpd/conf.d
 $ sudo cp -p ./ssl.conf ./ssl.conf.org
 $ sudo vi ./ssl.conf

  SSLProtocol all -SSLv2 -SSLv3

  #----- 2019.05.02 hogehoge
  #SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA
   SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA:!3DES:!RC4:!DH
  
  #----- 2019.05.02 hogehoge
  #SSLHonorCipherOrder on
  SSLHonorCipherOrder on
 
  #----- 2019.05.02 hogehoge
  SSLCompression off      &lt;----------追加</pre>



<p>下記を参考に設定してみました。<br>これで少しは、強化できたでしょうか？<br> 「Rem System Techlog」さん<br> 情報ありがとうございました</p>



<p><a href="https://www.rem-system.com/Apache-security01/">攻撃を受ける前に! Apache インストール後に必要な８つの変更点 </a></p>



<h4 class="wp-block-heading"><span id="toc6">自宅でWordPressを動かそう！</span></h4>



<br>
<div class="pager">
  <a class="prev page-numbers" href="https://www.kazuban.com/blog/apache-install/">PREV</a>
  <a class="page-numbers" href="https://www.kazuban.com/blog/centos7-install/">1</a>
  <a class="page-numbers" href="https://www.kazuban.com/blog/ssh-teraterm/">2</a>
  <a class="page-numbers" href="https://www.kazuban.com/blog/apache-install/">3</a>
  <a class="page-numbers" href="https://www.kazuban.com/blog/apache-install/">4</a>
  <span aria-current="page" class="page-numbers current">5</span>
  <a class="page-numbers" href="https://www.kazuban.com/blog/to-https/">6</a>
  <a class="page-numbers" href="https://www.kazuban.com/blog/postfix-install/">7</a>
  <a class="page-numbers" href="https://www.kazuban.com/blog/ssl-for-mail/">8</a>
  <a class="page-numbers" href="https://www.kazuban.com/blog/php7-3/">9</a>
  <a class="page-numbers" href="https://www.kazuban.com/blog/mariadb-10/">10</a>
  <a class="page-numbers" href="https://www.kazuban.com/blog/wordpress-install/">11</a>
  <a class="next page-numbers" href="https://www.kazuban.com/blog/to-https/">NEXT</a>
</div>
<hr>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
