2012年8月7日火曜日

node実装

(メモ)
cloud9
http://codedehitokoto.blogspot.jp/2012/01/nodeidecloud9.html
チュート★★★
http://sakuratan.biz/archives/3101
設定ファイル
http://d.hatena.ne.jp/sugyan/20110603/1307064303
★
http://updoor.com/2011/11/node-js%E3%81%8B%E3%82%89mysql%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B/
[innoDBエラーのやつ]
★http://memo.yomukaku.net/entries/279
★http://d.hatena.ne.jp/S_a_k_U/20110703
★http://ogawa.s18.xrea.com/tdiary/20060215.html

[ちゃっと]
★http://wise9.jp/archives/4218

「ポストとゲット」
http://d.hatena.ne.jp/replication/20110307/1299451484

[hint]モジュール

(要件)
ログイン画面

mysql接続
http://nantekottai.com/2011/08/15/node-mysql/
http://updoor.com/2011/11/node-js%E3%81%8B%E3%82%89mysql%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B/

メール送信
http://dev.classmethod.jp/server-side/node-mail/
http://spagetty.hatenablog.com/entry/20110321/1300720832
http://blog.araishi.com/node-js-mail-sender/

【IDE】
 http://codedehitokoto.blogspot.jp/2012/01/nodeidecloud9.html

(導入編)
【node】
 express入れたいと思うじゃん。→npmが無くて怒られます。
 ↓
 wget http://nodejs.org/dist/v0.8.5/node-v0.8.5.tar.gz
 (こいつから→http://nodejs.jp/)
 ↓
(追記!)
 tar zxvf node-v0.8.5.tar.gz
 cd node-v0.8.5
 ./configure
 make(大体10分そこいらで終わる)
 sudo make install
 node -v
↓
【npm】
 curl http://npmjs.org/install.sh | sh
 (curl入ってないですよーって怒られた人は)yum install curl
 npm -v
↓
【express】
 npm install express -g
 express --version
 (Tips:バージョン指定はexpress@バーションと指定)
↓
【ひな形作成】
 express -tejs app1
 cd app1
 npm install express ejs socket.io (*mysql)


【Bootstrap】
 http://kikki.hatenablog.com/entry/2012/04/04/000116
 <link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css"/>
↓
【nodeファイルの作成】
 フツーにjsファイルを作成してnodeの書き方してやればいい。

フォームについて
 http://st.ik.am/form-maker/form/


【mail】
送信できないっていうね。。。
http://codedehitokoto.blogspot.jp/2012/04/nodejs_30.html
断念...
http://dev.classmethod.jp/server-side/node-mail/
これ、エラーでるんですよねー・・・portのところあたりで
↓
頑張ればなんとかいけます。
http://dev.classmethod.jp/server-side/node-mail/



これをやりたかった
http://updoor.com/2011/11/node-js%E3%81%8B%E3%82%89mysql%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B/

【ERROR】
(mysql)
plugin 'innodb' init function returned error
vim /var/log/mysqld.log
[ヒント]
http://d.hatena.ne.jp/Loups-garous/20080926
http://www.l2tp.org/?p=991

【mongoはこっち】
http://blog.livedoor.jp/ishiduca/archives/51153130.html
//MongoDBの設定
var mongoose = require('mongoose').Mongoose;
//mydb(database)への接続
var db = mongoose.connect('mongodb://localhost:27017/mydb');

mysql起動
/etc/rc.d/init.d/mysqld start

★npm -g install mysql

【node-mysql sample】
★http://dev.classmethod.jp/etc/node-js-module-mysq/
(一応公式:https://github.com/felixge/node-mysql/)
✕http://updoor.com/2011/11/node-js%E3%81%8B%E3%82%89mysql%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B/
(接続自体はこれで)
|var mysql = require(mysql');
|var TABLE = 'bookmarks';
|var client = mysql.createClinet({
| user:'root',
| password:'',
| database:'NODEdb'
|});
|client.query(
| 'select * from '+TABLE, (*fromの後に半角スペースがいる)
| function (err, result)|
| if(err){
| throw err;cd
| }
| console.log(result);
| console.log(field);←お好みで
| client.end();
| }
|);

ところで。。。
フォームってどうするんだ?


2012年8月3日金曜日

動作確認

nginx
/usr/share/nginx/html

ネットワーク
/etc/sysconfig/network-script/ifcfg-eth2
BOOTPROTO="dhcp"

*
yumでNginxをインストールすると標準で起動スクリプトがインストールされますが、Passengerからインストールするとスクリプトがありませんので、作成します。基本的には公式サイトの記述を参考にします。
http://akibe.com/centos-setup-21-nginx/
↓
http://wiki.nginx.org/RedHatNginxInitScript

wiki
http://www26.atwiki.jp/nginx/


/etc/nginx/nginx.conf
(http://taichino.com/engineer-life/linux/2170)

sudo service mysqld start

udevの話
http://luna2-linux.blogspot.jp/2011/08/centos-60-nic-ethx.html



/etc/sysconf/networek-script/ifcfg-eth2
BOOTPROTO="dhcp


MACアドレスを変えてservice networkをリスタートした時に起きる問題
↓
ifconfig で表示されなくなる。
↓
udev
↓
/etc/udev/rules.d/70-persistent-net.rules
↓
こいつに、新しくMACアドレスをVMの設定から当てたやつを参考に
おのおのアドレスが当たっているところにNAME="eth"の番号を振ってやる。
↓
host2,3のeth2ともに、inet addr:192.168.56.101と2が振られた
↓
で?



【nginx】
http://www26.atwiki.jp/nginx/pages/14.html
http://www.happytrap.jp/blogs/2012/02/23/8243/
http://abeerforyou.com/?p=391


【ロードバランサー系】
http{server{のやつ}}
http://wiki.nginx.org/NginxLoadBalanceExample


【Node】
nave
http://www.atmarkit.co.jp/fwcr/rensai2/nodejs02/01.html



【レプリケーション系】
レプリケーションはるときに、eth1を設定していなかったからこれで。
/etc/sysconfig/network-scripts/ifcfg-eth1
BOOTPROTO="static"
IPADDR="198.168.x.x"
http://www.obenri.com/_minset_wbel3/netconfig_wbel3.html
ネットワーク系詳細=>http://d.hatena.ne.jp/bojovs/20081020/1224429418

レプリケーションの設定(SQL)
http://wadslab.net/wiki/index.php?MySQL%20%A5%EC%A5%D7%A5%EA%A5%B1%A1%BC%A5%B7%A5%E7%A5%F3%A4%CE%A5%BB%A5%C3%A5%C8%A5%A2%A5%C3%A5%D7%BC%EA%BD%E7


http://tech.hitsug.net/?CentOS%2FMySQL%2F%E5%88%9D%E6%9C%9F%E8%A8%AD%E5%AE%9A


環境説明

-nginx
【成功例:FastMail.FM | Wordpress.com】
HTTPとリバースプロキシのサーバーで、メールプロキシサーバーでもあります。
>プロキシ


-innodb
 -トランザクションイノロック

-レプリケーション

-Collation

2012年8月1日水曜日

環境構築



ERMaster  =>  http://ermaster.sourceforge.net/index_ja.html
JMater   =>  http://d.hatena.ne.jp/language_and_engineering/20081014/1223905380

VirtualBox  内部 =>http://linux2.g.hatena.ne.jp/lnznt/20120131/1328021979

Scientific Linux  = > http://ftp.riken.jp/Linux/scientific/6/x86_64/iso/

Openssh  => http://kazmax.zpp.jp/linux/lin_sshrsa_win.html#ah_2

VisualBox <= Scientifc Linux =>http://fakeyakuza.hatenablog.com/entry/20110914/1316013181(2011-09-14)
=>http://assimane.blog.so-net.ne.jp/2011-07-10
(install系)=>http://scientificsrv.com/scientific6.shtml


共有フォルダ
http://tobysoft.net/wiki/index.php?Ubuntu%2FVirtualBox%2F%B6%A6%CD%AD%A5%D5%A5%A9%A5%EB%A5%C0%BC%FE%A4%EA#b7b7b30d

[VisualBox-Scientific Linux]
all host = > SElinux無効化 => http://fedorasrv.com/memo/log/35.shtml
                                     => http://scientificsrv.com/scientific6-init.shtml
           = > iptables 無効化 = > http://www.server-world.info/query?os=Scientific_Linux_6&p=initial_conf&f=2

host1 = >Nginx install = >http://blog.wnotes.net/blog/article/16
    =>http://sakura.off-soft.net/centos/apache-nginx-1-nginx-install.html
hos2,3 => NodeJS = > http://scribble.washo3.com/linux/node-js%E3%82%92%E3%83%AD%E3%83%BC%E3%82%AB%E3%83%AB%E3%81%AB%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB.html
                          => http://blog.glidenote.com/blog/2012/01/24/install-hubot/
                          =>
         => MySQLServer =>http://centossrv.com/mysql.shtml
                                  => https://rewse.jp/blog/p/4370
         => Mroonga => http://mroonga.github.com/ja/docs/install.html
         => Memchach =>


mySQL-Reprication-udev


scientific linux-yum update でエラー
[Error 14]PYCURL ERROR6 みたいな。
scientific errno 14 pycurl error 6
<解決策>=>ネットワーク設定
eth1(NAT)
 "BOOTPROTO=dhcp"


make install -> No rule to make target 'install'.Stop

# ./configure --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module
ー>not found gcc
yum install gcc
再度実行

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by usi
yum -y install pcre-devel(http://d.hatena.ne.jp/pirosikick/20101018/1287415379)
再度実行
→今度はopensslがない。
yum install openssl-devel
→今度はlibxml2/libxslt
→今度はimage filter modele GD library




sudo rpm -ivhU http://nginx.org/packages/centos/6/x86_64/RPMS/nginx-1.2.2-1.el6.ngx.x86_64.rpm

[node]
http://d.hatena.ne.jp/replication/20110720/1311088237

mysql
http://tech.hitsug.net/?CentOS%2FMySQL%2FMySQL5%EF%BC%88yum%EF%BC%89%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB
→v0.6.20


Memcache
http://blog.mktime.com/archive/55.html

Mroonga
→全然ダメ
→mysql5.5だとそもそも入らない。
→mysql5.1だと入る。
http://mroonga.github.com/ja/docs/install.html
→vi /etc/yum.repos.d/groonga.repo
で、どっかを6にする。
からの、yum  makecache
からの、yum mysql-mroonga
で、確認http://mroonga.github.com/ja/docs/install.html


共有フォルダ
http://d.hatena.ne.jp/kakurasan/20070708/p1
http://mpweb.mobi/windows/share-centos.php
Guest Additionhttp://ikekobo.com/2011/09/virtualbox-%E3%81%AB-centos6-0-%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/
した準備http://mpweb.mobi/windows/guestadditions-centos.php
あとこれじゃね?http://d.hatena.ne.jp/calcul8/20101204/1291457686



ーーーーーーーーーーーーーーーーーーーーーーーーーーー
OpenSSHの公開鍵の登録とGitリポジトリの作成をお願いします。
サーバー:http://~
ユーザー名:mail
パスワード:パスワード
プロジェクト:メールアドレスの@以前

http://rat.cis.k.hosei.ac.jp/article/java/eclipseandcvs.html