技術者派遣の技術日誌ブログ

May 28, 2009

Wordpress XREAのMySQL設定

Filed under: MYSQL, PHP, Wordpress — Tags: , , , — Sayuri @ 6:02 pm

WordPressはMySQLのデータベースを利用して稼動するブログツールです。WordPressの設置の前にXREAのコントロールパネルにて、MySQLの設定を行います。このページでは、XREAのMySQLの設定の手順について解説します。

■XREAのコントロールパネルにアクセスします。XREAのコントロールパネルは、左側にメニューが並んでいます。その中より「データベース」(下の画像赤枠内)をクリックして下さい。

XREA コントロールパネルトップページ

■XREAのデータベースの設定画面です。WordPressで利用するデータベースはMySQLです。下の画像の赤い番号をご覧下さい。

XREAのコントロールパネルでのMySQLの設定

・MySQLのデータベースの選択
XREAの場合は5つまでデータベースファイルを作ることが可能です。上図の赤丸で囲まれているラジオボタンをクリックし作成するデータベースを選択します。すでに作成済みのデータベースがある場合は2つ目以降のラジオボタンをクリックしてください。
・データベース名の設定
上図1がデータベース名になります。2つ目以降のデータベースのファイル名については、※印部分に任意の値を入れてデータベース名を設定します。
・データベースパスワードの設定
上図2にて任意のパスワードを設定してください。
・文字コードの選択
XREAで契約したサーバーによって、MySQLのバージョンが変わります。バージョンが5以降のMySQLを利用している場合は、ドロップダウンリストから【EUC-JP/UNICODE(5以降のみ)/SHIFT_JIS(5以降のみ)】のいずれかを選択して下さい。当サイトでは、WordPressMEは、文字コードをutf-8としていますので、ここでは【UNICODE(5以降のみ)】を選択して下さい。。利用しているMySQLのバージョンが分からない場合は、http://www.value-domain.com/xreaip.php から調べることができます。
・データベースの作成
XREAは[作成]ボタンをクリックするだけでMySQLが生成されます。

以上の工程でMySQLの設定が完了です。ここで設定した内容をメモしておきましょう。WordPressのインストール時に必要になります。

データベース名 「DB/ユーザ名」(上図1)
データベースユーザー名 データベース名と同じ
データベースパスワード 「パスワード」(上図2)
※データベースパスワードについて
データベースパスワードは、*で非表示になっている右側にある[確認]のリンクテキストをクリックすると内容を確認できます。
データベースホスト localhost

May 23, 2009

Google Chrome と Firefox アドインの Prism のアプリケーション起動を比較してみました

Filed under: ALL — Tags: , , — citiszo @ 4:20 pm

Firefox で Web サイトをアプリケーション単体として起動・実行できるアドインである Prism のベータ版がリリースされたので、Google Chrome 2.0 のアプリケーションショートカットを比較してみました。

Prism が何かは下記記事をご覧ください。

以下の4つのサービスを比較してみたのですが、起動時間は体感的にはほとんど差を感じませんでした。Chrome の方が早いだろうと思い込んでいたのでちょっと意外でした。

  • Gmail
  • Google Reader
  • delicious
  • check*pad

そして起動直後の使用メモリ容量も意外な結果でした。

・Gmail

Chrome Prism
プロセス名 メモリ使用量 プロセス名 メモリ使用量
chrome.exe 6,224 KB firefox.exe 41,456 KB
chrome.exe 23,704 KB
chrome.exe * 21,632 KB
51,560 KB 41,456 KB

* はタスクマネージャーより Webサイトで使用していると思われるプロセス

・Google Reader

Chrome Prism
プロセス名 メモリ使用量 プロセス名 メモリ使用量
chrome.exe 12,204 KB firefox.exe 22,636 KB
chrome.exe * 19,540 KB
chrome.exe 1,456 KB
33,200 KB 22,636 KB

* はタスクマネージャーより Webサイトで使用していると思われるプロセス

・delicious

Chrome Prism
プロセス名 メモリ使用量 プロセス名 メモリ使用量
chrome.exe 5,076 KB firefox.exe 22,904 KB
chrome.exe 14,300 KB
chrome.exe * 19,120 KB
38,496 KB 22,904 KB

* はタスクマネージャーより Webサイトで使用していると思われるプロセス

・check*pad

Chrome Prism
プロセス名 メモリ使用量 プロセス名 メモリ使用量
chrome.exe 7,492 KB firefox.exe 15,432 KB
chrome.exe * 10,128 KB
17,620 KB 15,432 KB

* はタスクマネージャーより Webサイトで使用していると思われるプロセス

実行環境による誤差もあるでしょうから、これだけで Chrome より Prism の方が軽いとは言い切れないですが、少なくとも起動時のメモリ使用量は少ないとは言えると思います。

あと、興味深かったのが Chrome はアプリケーションショートカットで起動したときに Chrome のログイン情報を引き継いだのに、Prism はログイン情報を引き継がず再度ログインが必要でした。

利便性では Chromeが、セキュリティ的には Prism が望ましい形ですね。

May 21, 2009

ASP.NET の構成ファイルを暗号化する

Filed under: .NET Framework, Asp.Net — Tags: — Sayuri @ 3:24 pm

CodeProject をチェックしていたら、ASP.NET の構成ファイルをプログラムで暗号化する方法が紹介されていました。

へぇ、と思い自分でも appSettings を暗号化しようと試してみました。

もともとの appSettings はこんな感じ。

<appSettings>
  <add key=”key1″ value=”key1’s value” />
  <add key=”key2″ value=”key2’s value” />
  <add key=”key3″ value=”key3’s value” />
</appSettings>

そして構成ファイルを暗号化するプログラムはこんな感じ。

using System.Configuration;
using System.Web.Configuration;

string provider = “RSAProtectedConfigurationProvider”;
string section = “appSettings”;

protected void buttonEncrypt_Click(object sender, EventArgs e)
{
    Configuration confg =
      WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
    ConfigurationSection confStrSect = confg.GetSection(section);
    if (confStrSect != null)
    {
        confStrSect.SectionInformation.ProtectSection(provider);
        confg.Save();
    }
}

これを実行すると appSettings がこんな感じで暗号化されます。

    <appSettings configProtectionProvider=”RsaProtectedConfigurationProvider”>
  <EncryptedData Type=”http://www.w3.org/2001/04/xmlenc#Element
   xmlns=”http://www.w3.org/2001/04/xmlenc#”>
   <EncryptionMethod Algorithm=”http://www.w3.org/2001/04/xmlenc#tripledes-cbc” />
   <KeyInfo xmlns=”http://www.w3.org/2000/09/xmldsig#”>
    <EncryptedKey xmlns=”http://www.w3.org/2001/04/xmlenc#”>
     <EncryptionMethod Algorithm=”http://www.w3.org/2001/04/xmlenc#rsa-1_5” />
     <KeyInfo xmlns=”http://www.w3.org/2000/09/xmldsig#”>
      <KeyName>Rsa Key</KeyName>
     </KeyInfo>
     <CipherData>
      <CipherValue>MVZ9lJBnRj9b45wCpWVrSZgtbxLdbuMeY7StZfjMs1t1/Mx89D+XvYY4lWwRkg4kFjzP8lyVwtlZxkDrtS9NkG9kwoIQSijyNxG0qaxS+5V7VJcypPEP9f6jeewCs2DLfIUGwKy87cx+23puDGnzFQxqXcG4emF/NLPoxH2smOQ=</CipherValue>
     </CipherData>
    </EncryptedKey>
   </KeyInfo>
   <CipherData>
    <CipherValue>BXQFUE6w8pXyzm/S7+zHZ5z/K0JgsKOof+Aiu3qPQWJFQwqRa0I+tKl1Z7rkHUFwcrpKQm2rTUOLraYbyZY0s403WHTK9KiGPQjmHSBvmz4pzaEm2OmtuBfflkXX0pCTjsxSLsbtohGOUV+ieHebSywhHxf091aCt9qvkvlzPvgN+4EMTtPJwYiOb+effVMxT3bUt3h7jFOhzRp6mVrBXarUibldfwRKWSW8QJpGRBk=</CipherValue>
   </CipherData>
  </EncryptedData>
</appSettings>

構成ファイルが暗号化されているのに、以下のようなプログラムで普通に値を取得できます。

protected void Button1_Click(object sender, EventArgs e)
{
    textBoxKey1.Text =
        System.Configuration.ConfigurationManager.AppSettings["key1"];
    textBoxKey2.Text =
        System.Configuration.ConfigurationManager.AppSettings["key2"];
    textBoxKey3.Text =
        System.Configuration.ConfigurationManager.AppSettings["key3"];
}

これはなかなかいい感じ。

復号化するには以下のようにします。

protected void buttonDecrypt_Click(object sender, EventArgs e)
{
    Configuration confg =
     WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
    ConfigurationSection confStrSect = confg.GetSection(section);
    if (confStrSect != null && confStrSect.SectionInformation.IsProtected)
    {
        confStrSect.SectionInformation.UnprotectSection();
        confg.Save();
    }
}

構成ファイルを暗号化したいときはよくあるのでこれは便利だと思いつつ、プログラムで実行するのは不便だなぁと思っていたら、aspnet_regiis コマンドで暗号化する方法がちゃんと公開されていました。

May 14, 2009

Schematron on the Browser: JavaScript, CSS3 selectors, JQuery …

Schematron run from inside JavaScript on the web-browser, editing structured documents/data trascribed to HTML. Click “validate” and a box comes up with a list of the validation problems; click on of those and the corresponding text or …

Schematron run from inside JavaScript on the web-browser, editing structured documents/data trascribed to HTML. Click “validate” and a box comes up with a list of the validation problems; click on of those and the corresponding text or …

Schematron run from inside JavaScript on the web-browser, editing structured documents/data trascribed to HTML. Click “validate” and a box comes up with a list of the validation problems; click on of those and the corresponding text or …

Schematron run from inside JavaScript on the web-browser, editing structured documents/data trascribed to HTML. Click “validate” and a box comes up with a list of the validation problems; click on of those and the corresponding text or …

Schematron run from inside JavaScript on the web-browser, editing structured documents/data trascribed to HTML. Click “validate” and a box comes up with a list of the validation problems; click on of those and the corresponding text or …

Read the rest here:
Schematron on the Browser: JavaScript, CSS3 selectors, JQuery …

May 6, 2009

how to use web sevices in c# ( VSTO) WCF/WF

Filed under: ADO.NET, ALL, Asp.Net, C# — Tags: , , , , , , , , — Sayuri @ 2:15 pm

,ASP.NET,JAVASCRIPT,JQUERY

Hello All, I am working on a Excel Add-in ( c# ) that will be talking to a web server via webserice.

Hello All, I am working on a Excel Add-in (c#) that will be talking to a web server via webserice. I am new to web services and could. … how to use web sevices in c# ( VSTO). Posted by kris kumar in WCF/WF … http://geeks.netindonesia. net/blogs/andriyadi/archive/2008/04/16/save-excel-workbook-to-server-using-vsto-v3.aspx?CommentPosted=true http://www.packtpub.com/article/microsoft-office-outlook-programming-vsto-c-sharp-part1 …

See the original post here:
how to use web sevices in c# ( VSTO) WCF/WF

May 2, 2009

「cpedialog」かなり使いやすいGoogle App Engine製ブログエンジン

Filed under: ALL, Python — Tags: , — strmozo @ 9:32 am

個人的にGoogle App Engine(GAE)の上で動くブログエンジンというのは高いポテンシャルを秘めていると思う。何せ独自ドメインまで使えるブログエンジンが無料で手に入るようなものなのだ。ASPで動かすよりもよっぽども高速、安全、安易な運用が可能だ。

ピクチャ 91.png
編集画面

 

そのためには高機能なブログエンジンの登場が待たれる。候補としてcpedialogは有力ではないだろうか。

今回紹介するオープンソース・ソフトウェアはcpedialog、GAE上で動作するブログエンジンだ。

 

cpedialogはブログのエントリー投稿はもちろん、ページ管理機能も備えている。YUIのWYSIWYGエディタを用いており、画像のアップロードにも対応している。さらにシステム設定やメニュー管理、Picasaにアップロードした写真も管理できる。

ピクチャ 93.png
閲覧画面

 

フィードの管理、キャッシュ管理など多彩な機能に溢れている。ユーザ管理はGoogleのIDはもちろんのこと、OpenIDによる認証にも対応している。レイアウトの変更はグラフィカルにできるようで(Mac OSXだとJavaScriptエラーが出てしまうが)、オンラインでほぼ全ての操作が完結してしまうすごいブログエンジンだ。

ブログを立てる際には、ASPまたは独自で立てるというのがこれまでの選択肢だった。だが今後はGAEで立てるという選択肢も考えられるようになりそうだ。その際にはcpedialogも候補に挙げて検討してみたい。

 

cpedialog -Google Code
 
http://code.google.com/p/cpedialog/

このページの上部に戻る

Powered by WordPress