网络设置:打开互ping
安装所需的linux包
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev zlib1g-dev libssl-dev build-essential curl git-core libc6-dev g++ gcc
sudo adduser railsu sudo usermod -G passenger,www-data,sudo railsu su - railsu
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
加载rvm (只需第一次安装时加载)
source .bashrc
安装ruby
rvm install 1.9.2
rvm 高阶应用可以参考这里的指南
安装 passenger/nginxrvm use 1.9.2 default gem install passenger rvmsudo passenger-install-nginx-module
所有都选默认,包括nginx安装目录业选择默认 /opt/nginx/
安装nginx启动脚本menxu@debian:~$ sudo apt-get install nginx-common
wget https://raw.github.com/gist/1548664/53f6d7ccb9dfc82a50c95e9f6e2e60dc59e4c2fb/nginx sudo cp nginx /etc/init.d/ sudo chmod +x /etc/init.d/nginx sudo update-rc.d nginx defaults
配置文件在 /opt/nginx/config/nginx.conf
@debian:~$ ls /etc/nginx/
conf.d koi-win naxsi.rules scgi_params uwsgi_params
fastcgi_params mime.types nginx.conf sites-available win-utf
koi-utf naxsi_core.rules proxy_params sites-enabled
@debian:~$ cp /etc/nginx/nginx.conf /etc/nginx/nginx_copy.conf
cp: 无法创建普通文件"/etc/nginx/nginx_copy.conf": 权限不够
@debian:~$ sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx_copy.conf
gem install passenger rvmsudo passenger-install-nginx-module
sudo apt-get install libcurl4-openssl-dev
:~$ ls /nginx/conf/
:~$ sudo gedit nginx/conf/nginx.conf
server { listen 80; server_name www.yourhost.com; root /home/railsu/project/public; # <--- 这里是你项目的public目录 passenger_enabled on; }
- 如果是MongoDB, 可以参考这里的部署方案
用来precompile rails assets
sudo apt-get install python-software-properties sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs
cd ~/project rake assets:precompile
sudo /etc/init.d/nginx start
直接双击提示invalid encoding,使用shell运行则提示cannot execute binary file。这两天居然被这个东东难倒了,一直以为是无法识别编码或者缺少编译环境的问题。
于是加了个什么转码器,还apt-get install g++了,问题依旧。
突然觉得会不会又是32位和64位系统的问题,结果一查,还真是这个原因,伤不起。
32位系统,下载了个64位的软件,结果就无法执行;换位32为版本即可运行。
注:
查看系统命令: -uname -a 或 lsb_release -a,如下所示
这个addon可视化的展现了监控数据,非常有用。check_mk的表格中也链接了该页面。现在看看怎么安装?
官方站点:http://docs.pnp4nagios.org/pnp-0.6/start
首先下载软件:
wget http://docs.pnp4nagios.org/_media/dwnld/pnp4nagios-head.tar.gz
解压:
tar zxvf pnp4nagios-head.tar.gz
cd pnp4nagios-head
编译步骤:
./configure --with-nagios-user=icinga --with-nagios-group=icinga
报错:
checking for rrdtool... no checking rrdtool path ... no configure: error: is a directory! PNP needs the Path to the rrdtool binary!
安装rrdtool
apt-get install rrdtool rrdtool-dbg再次运行configure, 成功。
运行make all编译很快结束。
安装:
make install
make install-webconf
make install-config
make install-init
其实应该就用一个命令搞定:
make fullinstall
后面配置真的好烦,重点参考:
https://wiki.icinga.org/display/howtos/Setting+up+PNP4Nagios+with+Icinga-Web
https://wiki.icinga.org/display/howtos/Setting+up+PNP+with+Icinga#SettingupPNPwithIcinga-Classic-UI
https://wiki.icinga.org/display/howtos/PNP4Nagios+in+Classic-UI
http://blog.csdn.net/wych1981/article/details/7246787
最后不要忘记:
apt-get purge libapache2-mod-php5 php5 && apt-get install libapache2-mod-php5 php5