linux+Nginx+MongoDB+PHP
2012-10-14 20:14:39
Linux:
1.报错:unable to find a medium containing a live file system
解决:将镜像内文件复制到移动硬盘安装。
Nginx:
1.用sudo(因为只读文件)打开/etc/apt/sources.list文件添加(Esc从编辑切换到命令,o从命令切换到编辑,并在下方建立新行,:wq退出并保存)
一直在编译可以吃饭去了
回来各种报错
patchlevel.h:没有那个文件或目录
于是:sudo apt-get install python-dev
然后又bzlib.h:没有那个文件或目录
于是:sudo apt-get install libbz2-dev
嗯嗯$ ./b2 install
继续吃
然后回到mongo目录(编译太久了都忘了要干啥了)
1.报错:unable to find a medium containing a live file system
解决:将镜像内文件复制到移动硬盘安装。
Nginx:
1.用sudo(因为只读文件)打开/etc/apt/sources.list文件添加(Esc从编辑切换到命令,o从命令切换到编辑,并在下方建立新行,:wq退出并保存)
deb http://nginx.org/packages/ubuntu/ lucid nginx deb-src http://nginx.org/packages/ubuntu/ lucid nginx
然后
sudo -s nginx=stable # use nginx=development for latest development version add-apt-repository ppa:nginx/$nginx apt-get update apt-get install nginx 如果报错缺少密钥啥的就
sudo -s nginx=stable # use nginx=development for latest development version echo "deb http://ppa.launchpad.net/nginx/$nginx/ubuntu lucid main" > /etc/apt/sources.list.d/nginx-$nginx-lucid.list apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C apt-get update apt-get install nginx
MongoDB:(安装姿势不对,果断换姿势,MongoDB,如继续阅读则仅供作编译过程参考)
aptitude install -y git-core build-essential scons aptitude install -y libboost-dev libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev
git clone git://github.com/mongodb/mongo.git cd mongo # pick a stable version unless doing true dev git tag -l # Switch to a stable branch (unless doing development) -- # an even second number indicates "stable". For example: git checkout r2.0.4 然后编译,我这报错 can't find boost headers google发现是一个c++编译器,废话木有编译器编译个毛毛 官方文档http://www.boost.org/doc/libs/1_51_0/more/getting_started/unix-variants.html wget http://sourceforge.net/projects/boost/files/boost/1.51.0/boost_1_51_0.tar.gz $ ./bootstrap.sh --prefix=/usr/local
$ ./b2 install一直在编译可以吃饭去了
回来各种报错
patchlevel.h:没有那个文件或目录
于是:sudo apt-get install python-dev
然后又bzlib.h:没有那个文件或目录
于是:sudo apt-get install libbz2-dev
嗯嗯$ ./b2 install
继续吃
然后回到mongo目录(编译太久了都忘了要干啥了)
scons all 果断继续报错 In file included from /usr/local/include/boost/filesystem/operations.hpp:24:0, from /usr/local/include/boost/filesystem/convenience.hpp:22, from pch.h:83, from pch.cpp:18: /usr/local/include/boost/filesystem/config.hpp:16:5: error: #error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3 In file included from util/goodies.h:22:0, from pch.h:161, from pch.cpp:18: util/concurrency/mutex.h: In function 'boost::xtime mongo::incxtimemillis(long long int)': util/concurrency/mutex.h:32:31: error: 'TIME_UTC' is not a member of 'boost' scons: *** [pch.o] Error 1 scons: building terminated because of errors. google原因因为 This is Version 3 of the Filesystem library. Version 2 is not longer supported. 1.49.0 was the last release of Boost to supply Version 2 不兼容,不兼容,兼容,容。。。。石化ing 好吧我错了,下1.49.0的 wget http://sourceforge.net/projects/boost/files/boost/1.49.0/boost_1_49_0.tar.gz 打开boost_1_49_0/tools/build/v2 sudo vi user-config.jam 去掉注释: using gcc : 4.4 : g++-4.4 ; 给与权限 chmod +x ./bootstrap.sh
如果报错tools/build/v2/engine/build.sh: Permission denied
继续给权限 manna@ubuntu:/etc/apt/boost_1_49_0/tools/build/v2/engine$ sudo chmod +x ./build.sh sudo ./bootstrap.sh cpu开始转动了休息 建立链接 sudo ln -s /etc/apt/boost_1_49_0/boost /usr/include/boost 换个1.48.0的 果断报错 Performing configuration checks - has_icu builds : no warning: Graph library does not contain MPI-based parallel components. note: to enable them, add "using mpi ;" to your user-config.jam - iconv (libc) : yes - icu : no - icu (lib64) : no - ../config//has_gcc_visibility builds : yes - ../config//has_long_double_support builds : yes warning: skipping optional Message Passing Interface (MPI) library. note: to enable MPI support, add "using mpi ;" to user-config.jam. note: to suppress this message, pass "--without-mpi" to bjam. note: otherwise, you can safely ignore this message. wget http://download.icu-project.org/files/icu4c/49.1.2/icu4c-49_1_2-src.tgz
cd source ./configure --prefix=/usr make