CONTENTS
#contents
----
Lastmodified &lastmod;
----
*Apache22 to 24 [#k7e3a222]
* Apache22 to 24 [#sf71a1b1]
Apacheを22から24へ移行します。Apache22を使用している状態では、/etc/make.conf に、
 
 DEFAULT_VERSIONS+=apache=2.2

403 アクセスコントロールの構文がかわりました。( ̄^ ̄)ゞ
があると思いますが、これを消去(コメントアウト?)します。でないと、Apache24インストール後に、mod_php5とかが入りません。

phpMyAdminのインストール後、403が取れずに半日嵌まったワ orz

http://ora.geo.jp/?p=246
 # pkg delete apache22-2.2.34 
 # portinstall www/apache24
 # portinstall mod_php56-5.6.31

/etc/rc.conf
 
 apache22_enable="YES"  > apache24_enable="YES"

 ===>   Registering installation for mod_php5-5.4.32,1
 [activating module `php5' in /usr/local/etc/apache24/httpd.conf]
 ***************************************************************

uncoment /usr/local/etc/apache24/httpd.conf

 LoadModule vhost_alias_module libexec/apache24/mod_vhost_alias.so
 LoadModule rewrite_module libexec/apache24/mod_rewrite.so
 LoadModule userdir_module libexec/apache24/mod_userdir.so
 LoadModule ssl_module libexec/apache24/mod_ssl.so
 
 Make sure index.php is part of your DirectoryIndex.
 ServerAdmin foo@smb.net



すると、/usr/local/etc/apache24 に設定ファイルが出来ます。が、apache22のディレクトリも残っています。

ただし、Apache22 と 24 では設定方法やデフォルトのmodなどが大きく異なっていて、22の設定ファイルをそのまま持ってきても殆ど動きません。

ということで、22から24へ変更した場合、httpd.confを直接編集しても良いのですが、/usr/local/etc/apache24/httpd.conf の差分?を、/usr/local/etc/apache24/Includes にまとめてしまおうと思います。

** /usr/local/etc/apache24/Includes [#l61ace26]

*** php.conf [#h0472915]

php5, php5-extensions をインストールしたら、/usr/local/etc/apache24/Includes/php.conf を作り、apacheを再起動します。

 ########### PHP Setting for Apache24 or later ##########
 <IfModule mime_module>
 	AddType application/x-httpd-php .php
 	AddType application/x-httpd-php-source .phps
 </IfModule>
 
 You should add the following to your Apache configuration file:
 <IfModule dir_module>
 	DirectoryIndex index.html index.php
 </IfModule>
 
 <FilesMatch "\.php$">
     SetHandler application/x-httpd-php
 </FilesMatch>
 <FilesMatch "\.phps$">
     SetHandler application/x-httpd-php-source
 </FilesMatch>
 <IfModule dir_module>
 	
 	<FilesMatch "\.php$">
     	SetHandler application/x-httpd-php
 	</FilesMatch>
 	<FilesMatch "\.phps$">
     	SetHandler application/x-httpd-php-source
 	</FilesMatch>
 </IfModule>



*** cgi-bin.conf [#r259bf0c]

mailman を導入した場合、cgiが動くように、/usr/local/etc/apache24/Includes/cgi-bin.confを作ります。

 <IfModule !mpm_prefork_module>
 	LoadModule cgid_module libexec/apache24/mod_cgid.so
 </IfModule>
 <IfModule mpm_prefork_module>
 	LoadModule cgi_module libexec/apache24/mod_cgi.so
 </IfModule>

** アプリケーション毎の設定 [#wc48e4f6]
*** wordpress.conf アクセス制限無しの場合 [#nb45bdda]

   Alias /wordpress /usr/local/www/wordpress/
     AcceptPathInfo On
   <Directory /usr/local/www/wordpress>
       AllowOverride None
       Require all granted
 #      Order Allow,Deny  #Apache22だとこちらでOKだった
 #      Allow from all
   </Directory>


*** mailman アクセス制限無しの場合 [#q1c5d079]
 <IfModule alias_module>
     ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/" 
     Alias /pipermail/ "/usr/local/mailman/archives/public/"
     Alias /icons/ "/usr/local/mailman/icons/"
 </IfModule>
 
 ***************************************************************
 <Directory "/usr/local/mailman/">
  Options FollowSymLinks ExecCGI
  AllowOverride None
  Require all granted
 </Directory>

*** phpmyadmin.conf アクセス制限有りの場合 [#t2e612e5]

 Alias /phpmyadmin "/usr/local/www/phpMyAdmin/"
 
 ===> SECURITY REPORT:
       This port has installed the following files which may act as network
       servers and may therefore pose a remote security risk to the system.
 /usr/local/libexec/apache24/libphp5.so
 <Directory "/usr/local/www/phpMyAdmin/">
     #Options Indexes FollowSymLinks ExecCGI
     Options none
     #AllowOverride ALL
     AllowOverride Limit
 
       If there are vulnerabilities in these programs there may be a security
       risk to the system. FreeBSD makes no guarantee about the security of
       ports included in the Ports Collection. Please type 'make deinstall'
       to deinstall the port if this is a concern.
     Require local
     Require ip 172.16.XXX.YYY
     #Require all granted
 
       For more information, and contact details about the security
       status of this software, see the following webpage:
 http://www.php.net/
 
*phpMyAdmin [#jf71df5c]
     Require host	.smb.net
     Require host	.hogehoge.net
     Require host	.fugafuga.info
 </Directory>
 
** guard [#j59e0e37]

 phpMyAdmin-4.2.7.1 has been installed into:
/usr/local/etc/apache24/extra・httpd-ssl.conf

 SSLMutex  "file:/etc/httpd/logs/ssl_mutex"

   ↓

 Mutex default ssl-cache



** piano2nd [#k8e05a44]

 # pkg delete apache22
 # portinstall apache24
 # portinstall mod_php56

uncoment /usr/local/etc/apache24/httpd.conf

 LoadModule vhost_alias_module libexec/apache24/mod_vhost_alias.so
 LoadModule rewrite_module libexec/apache24/mod_rewrite.so
 LoadModule userdir_module libexec/apache24/mod_userdir.so
 
     /usr/local/www/phpMyAdmin
 
 Please edit config.inc.php to suit your needs.
 
 To make phpMyAdmin available through your web site, I suggest
 that you add something like the following to httpd.conf:
 
 For Apache versions earlier than 2.4:
 
     Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
 
     <Directory "/usr/local/www/phpMyAdmin/">
         Options none
         AllowOverride Limit
 
         Order Deny,Allow
         Deny from all
         Allow from 127.0.0.1 .example.com
     </Directory>
 
 For Apache version 2.4.x or above:
 
     Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
 
     <Directory "/usr/local/www/phpMyAdmin/">
         Options None
         AllowOverride Limit
  
         Require local
         Require host .example.com
     </Directory>
 
 SECURITY NOTE: phpMyAdmin is an administrative tool that has had several
 remote vulnerabilities discovered in the past, some allowing remote
 attackers to execute arbitrary code with the web server's user credential.
 All known problems have been fixed, but the FreeBSD Security Team strongly
 advises that any instance be protected with an additional protection layer,
 e.g. a different access control mechanism implemented by the web server
 as shown in the example.  Do consider enabling phpMyAdmin only when it
 is in use.
 
 ===>  Cleaning for phpMyAdmin-4.2.7.1
 ServerAdmin foo@smb.net


** blackcube [#x94421cd]
** hotshot [#x2f67a09]

http://vogel.at.webry.info/201502/article_12.html
----
Total access &counter(total);:本日 &counter(today);:昨日 &counter(yesterday);
#counter([total|today|yesterday]);


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS