Mac OS X + Express 設定メモ
環境
- Mac OS X EL Capitan 10.11.4
- Node.js
- Express 4.13.1
Express をインストール
- Express をインストール
$ npm install express
$ npm install -g express-generator
- 動作確認
$ express sample $ cd sample && npm install $ DEBUG=sample:* npm start
Welcome to Express が見えたらOK
Mac OS X + Node.js + MongoDB インストールメモ
環境
- Mac OS X EL Capitan 10.11.4
- Node.js
- MongoDB v3.2.5
Node.js をインストール
- nvm をインストール
$ git clone https://github.com/creationix/nvm.git ~/.nvm
- installできるバージョン*1 の一覧
$ nvm ls-remote
- 好みのバージョンのモノをインストール
$ nvm install v0.10.24
バージョン切り替え
- 現在を確認
$ nvm ls
- 切り替え
$ nvm use v0.10.24
Monngo DB をインストール*2
- Homebrewのパッケージをupdate
$ brew update
- MongoDBをインストール
$ brew install mongodb
- デフォルトデータ格納先
/usr/local/var/mongodb /usr/local/var/log/mongodb/mongo.log
MongoDB起動
- 手動 *3
$ mongod --config /usr/local/etc/mongod.conf
- 手動で永続的に起動
$ mongod --fork --logpath /usr/local/var/log/mongodb/mongo.log --nojournal --noprealloc --dbpath /usr/local/var/mongodb
- 自動起動,すぐに起動,停止
$ ln -fs /usr/local/opt/mongodb/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/ $ sudo launchctl load /Library/LaunchDaemons/org.mongodb.mongod.plist $ sudo launchctl unload /Library/LaunchDaemons/org.mongodb.mongod.plist
- mongod 停止
$ ps ax | grep mongo $ kill -15 pid > db.adminCommand({shutdown : 1, force : true})
find 特定のファイル名を除外して文字コードを確認する。
# find . ! -name "*.zip" | xargs file
scp ローカルファイルをリモートに転送する。
Port 指定は -P (大文字)
# scp -P 2222 hogehoge.zip account@XXX.XXX.XXX.XXX:/home/account/work/
firewall-cmd http 穴あけ
動いているか、有効なモノを確認
# firewall-cmd --state running # firewall-cmd --list-services dhcpv6-client ssh
http を追加
# firewall-cmd --add-service=http success # firewall-cmd --list-services dhcpv6-client http ssh
LAMP(Apache+MariaDB+PHP) 構築メモ
LAMP(Apache+MariaDB+PHP)をインストール
phpをインストール
# yum -y install php-mysql php php-gd php-mbstring # php --version PHP 5.4.16 (cli) (built: Jun 23 2015 21:17:27) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
mariadbをインストール
# yum -y install mariadb mariadb-server # mysql --version mysql Ver 15.1 Distrib 5.5.44-MariaDB, for Linux (x86_64) using readline 5.1
mariadb ブート時に自動起動ON
# systemctl list-unit-files | grep mariadb mariadb.service disabled # systemctl start mariadb.service # systemctl list-units | grep mariadb mariadb.service loaded active running MariaDB database server # systemctl enable mariadb.service ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service' # systemctl list-unit-files | grep mariadb mariadb.service enabled
Apache は phpと一緒にもう入っている。
# rpm -qa | grep http httpd-tools-2.4.6-31.el7.centos.1.x86_64 httpd-2.4.6-31.el7.centos.1.x86_64
Apache ブート時に自動起動ON
# systemctl start httpd.service # systemctl list-units | grep httpd httpd.service loaded active running The Apache HTTP Server # systemctl list-unit-files | grep httpd httpd.service disabled # systemctl enable httpd.service ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service' # systemctl list-unit-files | grep httpd httpd.service enabled
plenvでのperlの導入
plenvでのperlの導入
参考にさせて頂きました。 github.com
もともと
$ perl -v This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level
- plenv と perl の導入
$ curl -L http://is.gd/plenvsetup | sh $ plenv install 5.20.2 $ plenv global 5.20.2 $ plenv versions system * 5.20.2 (set by /Users/XXXX/.plenv/version) $ perl -v This is perl 5, version 20, subversion 2 (v5.20.2) built for darwin-2level
- cpanm も導入
$ plenv install-cpanm