テーマファイルとURL

WordPressのURLは設定→パーマリンク設定でパターンカスタマイズできるので、その設定毎のURLを示します

■デフォルト

ページ種別 テーマファイル

URL
個別記事 single.php /?p=[リビジョン番号]
固定ページ page.php /?page_id=[リビジョン番号]
アーカイブ archive.php /?m=[年月]
カテゴリー category.php /?cat=[カテゴリID]
タグ tag.php /?tag=[slug]
検索 search.php /?s=[検索文字]

■日付と投稿名

ページ種別 テーマファイル URL
個別記事 single.php /[年]/[月]/[日]/[slug]
固定ページ page.php /[slug]
アーカイブ archive.php /[年]/[月]/
カテゴリー category.php /category/[slug]
タグ tag.php /tag/[slug]
検索 search.php /?s=[検索文字]

■月と投稿名

ページ種別 テーマファイル URL
個別記事 single.php /[年]/[月]/[slug]
固定ページ page.php /[slug]
アーカイブ archive.php /[年]/[月]/
カテゴリー category.php /category/[slug]
タグ tag.php /tag/[slug]
検索 search.php /?s=[検索文字]

■数字ベース

ページ種別 テーマファイル URL
個別記事 single.php /archve/[リビジョン番号]
固定ページ page.php /[slug]
アーカイブ archive.php /archve/date/[年]/[月]/
カテゴリー category.php /archve/category/tag/[slug]/
タグ tag.php /archve/tag/[slug]
検索 search.php /?s=[検索文字]

■投稿名ベース

ページ種別 テーマファイル URL
個別記事 single.php /[slug]
固定ページ page.php /[slug]
アーカイブ archive.php /[年]/[月]/
カテゴリー category.php /category/[slug]
タグ tag.php /tag/[slug]
検索 search.php /?s=[検索文字]

XAMPP+VHOSTでSSL

XAMPPでSSLを利用する場合、localhostへのアクセスは特に設定をすることなくでるけど、バーチャルホストでSSLを利用する場合は認証鍵の作成などが必要になるのでその方法を残します。

■認証鍵の作成に必要なものと在り処

ファイル名 PATH
openssl.exe %XAMPP_PATH%\apache\bin\openssl.exe
openssl.cnf %XAMPP_PATH%\apache\conf\openssl.cnf

■SSL作成手順
※%XAMPP_PATH%の部分はそれぞれの環境に合わせて置換してください

  1. 認証鍵を保存するために任意の場所に適当なフォルダを作ります
  2. コマンドプロンプトを開く
  3. カレントを最初に作成したフォルダに変更する
    cd %PATH_TO_DIR%
  4. openssl.exeにPATHを通す。
    set path=%path%;%XAMPP_PATH%\apache\bin
  5. 環境変数「OPENSSL_CONF」にopenssl.cnfのフルパスをセットする
    set OPENSSL_CONF=%XAMPP_PATH%\apache\conf\openssl.cnf
  6. 秘密鍵を作成
    openssl genrsa -des3 -out example.com.key 1024
    
    Loading 'screen' into random state - done
    Generating RSA private key, 1024 bit long modulus
    ..++++++
    ..................++++++
    e is 65537 (0x10001)
    Enter pass phrase for ec-movie.local.key: #パスフレーズを入力
    Verifying - Enter pass phrase for ec-movie.local.key: #もう一度入力
    
  7. 公開鍵を作成
    openssl req -new -key example.com.key -out example.com.csr
    
    Enter pass phrase for ec-movie.local.key: #パスフレーズを入力
    Loading 'screen' into random state - done
    You are about to be asked to enter information that will be incorporated
    into your certificate request.
    What you are about to enter is what is called a Distinguished Name or a DN.
    There are quite a few fields but you can leave some blank
    For some fields there will be a default value,
    If you enter '.', the field will be left blank.
    -----
    Country Name (2 letter code) [AU]:JA
    State or Province Name (full name) [Some-State]: #都道府県を入力
    Locality Name (eg, city) []: #市区町村を入力
    Organization Name (eg, company) [Internet Widgits Pty Ltd]: #会社名
    Organizational Unit Name (eg, section) []: #部署名
    Common Name (e.g. server FQDN or YOUR name) []: #ドメイン
    Email Address []: #空
    
    Please enter the following 'extra' attributes
    to be sent with your certificate request
    A challenge password []: #空
    An optional company name []: #空
    
    
  8. 証明書の作成
    openssl req -new -x509 -days 365 -key example.com.key -out example.com.crt
    Enter pass phrase for ec-movie.local.key: #パスフレーズ
    Loading 'screen' into random state - done
    You are about to be asked to enter information that will be incorporated
    into your certificate request.
    What you are about to enter is what is called a Distinguished Name or a DN.
    There are quite a few fields but you can leave some blank
    For some fields there will be a default value,
    If you enter '.', the field will be left blank.
    -----
    Country Name (2 letter code) [AU]:JA
    State or Province Name (full name) [Some-State]: #都道府県を入力
    Locality Name (eg, city) []: #市区町村を入力
    Organization Name (eg, company) [Internet Widgits Pty Ltd]: #会社名
    Organizational Unit Name (eg, section) []: #部署名
    Common Name (e.g. server FQDN or YOUR name) []: #ドメイン
    Email Address []: #空
    
    
  9. 秘密鍵のパスフレーズを解除
    openssl rsa -in example.com.key -out example.com.key
    
    Enter pass phrase for ec-movie.local.key: #パスフレーズ
    writing RSA key
    
    

■Apacheに反映

  1. 秘密鍵(key)、公開鍵(csr)、証明書(crt)をそれぞれ%XAMPP_PATH%\conf\のそれぞれのフォルダにコピーする
  2. httpd-vhosts.confに定義を追加
    <VirtualHost *:443>
        ServerAdmin webmaster@dummy-host.example.com
        DocumentRoot "c:\path\to\document\root"
        ServerName example.com
        ServerAlias www.example.com
        ErrorLog "logs/ec.example.com.com-error.log"
        CustomLog "logs/ec.example.com.com-access.log" common
    
        SSLEngine on
        SSLProtocol all -SSLv2
        SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
        
        SSLCertificateFile "conf/ssl.crt/example.com.crt"
        SSLCertificateKeyFile "conf/ssl.key/example.com.key"
    
        <Directory "c:\path\to\document\root">
    	    Options FollowSymLinks
    	    AllowOverride All
    	    Require all granted
        </Directory>
    </VirtualHost>

    ※非SSL(http)のバーチャルホスト定義をコピペしてSSL(443)ポートの定義を書き、SSLキーファイルを追記してます

あとはxamppを起動して動作確認してください。

久しぶりのCentOS(6.4-i386)インストール

久しぶりにCentOS(6.4-i386)をインストールしたので備忘ログ

  1. とりあえず、標準サーバでインストール
  2. ipv6をoff
  3. iptableをoff
  4. ntpで時間合わせ
  5. アンチウィルスソフト(clam antivirus)のインストール
  6. apache(httpd)をインストール
  7. MySQLをインストール
  8. PHPをインストール

ipv6を無効にする

1. /etc/sysconfig/networkに以下を追加。

vi /etc/sysconfig/network

NETWORKING_IPV6=no

2. /etc/modprobe.d/disable-ipv6.confファイルを作成して以下を書く。

vi /etc/modprobe.d/disable-ipv6.conf

options ipv6 disable=1

3. 以下を実行。

chkconfig ip6tables off

4. /etc/sysconfig/network-scripts/ifcfg-eth0を変更

vi /etc/sysconfig/network-scripts/ifcfg-eth0

IPV6INIT=”no”
IPV6_AUTOCONF=”no”

5. 再起動。

reboot