[root@ASANGE ~]# uname -r
2.6.32-358.el6.x86_64
[root@ASANGE ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)
[root@ASANGE ~]# ifconfig | grep addr: |awk '{print $2}' |awk -F: '{print $2}'
192.168.2.103
127.0.0.1[root@ASANGE ~]# mount /dev/cdrom /media/cdrom/
[root@ASANGE ~]# vim /etc/yum.repos.d/local.repo //添加如下内容
[LOCAL]
name=local
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0
[root@ASANGE ~]# yum clean all[root@ASANGE ~]# yum -y install gcc pcre pcre-devel gcc-c++ autoconf libxml2 libxml2-devel zlib zlib-devel glibc libjepg libjepg-devel libpng libpng-devel glibc-devel glib2 glib2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers makeGCC(GNU Compiler Collection,GNU编译器套装),是一套由GNU开发的编程语言编译器。
PCRE(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正规表达式库.
autoconf是一个用于生成可以自动地配置软件源代码包以适应多种Unix类系统的 shell脚本的工具.
libxml2是一个用来解析XML文档的函数库,它用C语言写成, 并且能为多种语言所调用.
zlib是提供资料压缩之用的函式库.
glibc:GNU C 库(GNU C Library,又称为glibc)是一种按照LGPL许可协议发布的,公开源代码的,免费的,方便从网络下载的C的编译程序.
ncurses(new curses)是一个程序库,它提供了API,可以允许程序员编写独立于终端的基于文本的用户界面。
cURL是一个利用URL语法在命令行下工作的文件传输工具,它支持文件上传和下载,所以是综合传输工具.
e2fsprogs(又称为e2fs programs)是用以维护ext2,ext3和ext4文件系统的工具程序集。
OpenSSL是套开放源代码的SSL套件,其函式库是以C语言所写成,实作了基本的传输层资料加密功能。
OpenLDAP是轻型目录访问协议(Lightweight Directory Access Protocol,LDAP)的自由和开源的实现.
make编译工具。
gd:graphic device,图像工具库,gd库是php处理图形的扩展库,gd库提供了一系列用来处理图片的API,使用GD库可以处理图片,或者生成图片。 在网站上GD库通常用来生成缩略图或者用来对图片加水印或者对网站数据生成报表。(TTP p_w_picpath filter module requires the GD library.)[root@ASANGE ~]# groupadd -r nginx
[root@ASANGE ~]# useradd -r -g nginx -s /bin/false -M nginx 2、下载nginx源码包,并安装:nginx-1.4.1.tar.gz[root@ASANGE ~]# tar xf nginx-1.4.1.tar.gz
[root@ASANGE ~]# cd nginx-1.4.1
[root@ASANGE nginx-1.4.1]#./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre --with-http_realip_module --with-http_gzip_static_module --with-file-aio
[root@ASANGE nginx-1.4.1]# make && make install[root@ASANGE ~]# vim /etc/init.d/nginx
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /usr/local/nginx/logs/nginx.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
nginx="/usr/local/nginx/sbin/nginx"
prog=$(basename $nginx)
NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"
[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
lockfile=/var/lock/subsys/nginx
make_dirs() {
# make required directories
user=`nginx -V 2>&1 | grep "configure arguments:" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -`
options=`$nginx -V 2>&1 | grep 'configure arguments:'`
for opt in $options; do
if [ `echo $opt | grep '.*-temp-path'` ]; then
value=`echo $opt | cut -d "=" -f 2`
if [ ! -d "$value" ]; then
# echo "creating" $value
mkdir -p $value && chown -R $user $value
fi
fi
done
}
start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
make_dirs
echo -n $"Starting $prog: "
daemon $nginx -c $NGINX_CONF_FILE
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog -QUIT
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
configtest || return $?
stop
sleep 1
start
}
reload() {
configtest || return $?
echo -n $"Reloading $prog: "
killproc $nginx -HUP
RETVAL=$?
echo
}
force_reload() {
restart
}
configtest() {
$nginx -t -c $NGINX_CONF_FILE
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart|configtest)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
exit 2
esac 为启动脚本赋予执行权限、添加至服务管理列表并开机自动启动:[root@ASANGE ~]# chmod +x /etc/init.d/nginx
[root@ASANGE ~]# chkconfig --add nginx
[root@ASANGE ~]# chkconfig nginx on4、 启动服务并测试,(注意iptables规则可能阻止访问):[root@ASANGE ~]# service nginx start
正在启动 nginx: [确定]
nginx配置成功![root@ASANGE mysql]# mkdir -pv /mysql/data
[root@ASANGE mysql]# groupadd -r mysql
[root@ASANGE mysql]# useradd -g mysql -r -s /bin/false -M -d /mysql/data mysql3、 解压并初始化安装[root@ASANGE ~]# tar vxf mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz
[root@ASANGE ~]# mv mysql-5.6.12-linux-glibc2.5-x86_64 /usr/local/mysql
[root@ASANGE ~]# cd /usr/local/mysql
[root@ASANGE mysql]# ls
bin data include lib mysql-test scripts sql-bench
COPYING docs INSTALL-BINARY man README share support-files
[root@ASANGE mysql]# chown mysql:mysql /mysql/data/
[root@ASANGE mysql]# chown mysql:mysql ./*
[root@ASANGE mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/mysql/data
[root@ASANGE mysql]# chown -R root ./* 安装完成之后,主配置文件为/usr/local/mysql/my.cnf,可根据需要进行文件配置,这里添加如下项:[root@ASANGE mysql]# mkdir /var/run/mysqld
[root@ASANGE mysql]# vim my.cnf
[mysqld]
datadir = /mysql/data
basedir = /usr/local/mysql
port = 3306
socket = /tmp/mysql.sock
pid_file = /var/run/mysqld/mysqld.pid[root@ASANGE mysql]# ln -sv /usr/local/mysql/include /usr/include/mysql[root@ASANGE mysql]# echo '/usr/local/mysql/lib' > /etc/ld.so.conf.d/mysql.conf
[root@ASANGE mysql]# ldconfig[root@ASANGE mysql]# vim /etc/profile
PATH=$PATH:/usr/local/mysql/bin
[root@ASANGE mysql]# . /etc/profile[root@ASANGE mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld
[root@ASANGE mysql]# chkconfig --add mysqld
[root@ASANGE mysql]# chkconfig mysqld on至此mysql安装完成,启动mysql服务[root@ASANGE mysql]# service mysqld start[root@ASANGE ~]# mkdir /usr/local/phpextend[root@ASANGE ~]# tar xf jpegsrc.v9.tar.gz
[root@ASANGE ~]# cd jpeg-9/
[root@ASANGE jpeg-9]# ./configure --prefix=/usr/local/phpextend --enable-shared --enable-static
[root@ASANGE jpeg-9]# make && make install 2、编译安装libpng,增强对png格式图片的处理功能。libpng-1.6.2.tar.gz [root@ASANGE ~]# tar xf libpng-1.6.2.tar.gz
[root@ASANGE ~]# cd libpng-1.6.2
[root@ASANGE libpng-1.6.2]# ./configure --prefix=/usr/local/phpextend
[root@ASANGE libpng-1.6.2]# make && make install 3、编译安装freetype,增强php对字体的处理功能。 freetype-2.4.12.tar.gz [root@ASANGE ~]# tar xf freetype-2.4.12.tar.gz
[root@ASANGE ~]# cd freetype-2.4.12
[root@ASANGE freetype-2.4.12]# ./configure --prefix=/usr/local/phpextend
[root@ASANGE freetype-2.4.12]# make && make install 4、编译安装mhash,使php支持多种哈稀演算法。 mhash-0.9.9.9.tar.gz[root@ASANGE ~]# tar xf mhash-0.9.9.9.tar.gz
[root@ASANGE ~]# cd mhash-0.9.9.9
[root@ASANGE mhash-0.9.9.9]# ./configure --prefix=/usr/local/phpextend
[root@ASANGE mhash-0.9.9.9]# make && make install 5、编译安装libmcrypt,使php支持多种加密算法。libmcrypt-2.5.8.tar.gz[root@ASANGE ~]# tar xf libmcrypt-2.5.8.tar.gz
[root@ASANGE ~]# cd libmcrypt-2.5.8
[root@ASANGE libmcrypt-2.5.8]# ./configure --prefix=/usr/local/phpextend
[root@ASANGE libmcrypt-2.5.8]# make && make install 6、编译安装libevent,支持select、epoll、kqueue等事件调度机制。 libevent-2.0.21-stable.tar.gz[root@ASANGE ~]# tar xf libevent-2.0.21-stable.tar.gz
[root@ASANGE ~]# cd libevent-2.0.21-stable
[root@ASANGE libevent-2.0.21-stable]# ./configure --prefix=/usr/local/phpextend
[root@ASANGE libevent-2.0.21-stable]# make && make install 7、编译安装libiconv,实现一个字符编码到另一个字符编码的转换。 libiconv-1.14.tar.gz[root@ASANGE ~]# tar xf libiconv-1.14.tar.gz
[root@ASANGE ~]# cd libiconv-1.14
[root@ASANGE libiconv-1.14]# ./configure --prefix=/usr/local/phpextend
[root@ASANGE libiconv-1.14]# make && make install 8、输出库文件[root@ASANGE ~]# echo "/usr/local/phpextend/lib" >> /etc/ld.so.conf.d/phpextend.conf
[root@ASANGE ~]# ldconfig 9、编译安装php。 php-5.5.0.tar.bz2[root@ASANGE php-5.5.0]# tar xf php-5.5.0.tar.bz2
[root@ASANGE php-5.5.0]# cd php-5.5.0
[root@ASANGE php-5.5.0]# ./configure --prefix=/usr/local/php --enable-fastcgi --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir=/usr/local/phpextend --with-jpeg-dir=/usr/local/phpextend --with-png-dir=/usr/local/phpextend --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap
[root@ASANGE php-5.5.0]# make // 如果报错“make: *** [sapi/cli/php] Error 1” 使用命令“make ZEND_EXTRA_LIBS='-liconv' ”进行编译
[root@ASANGE php-5.5.0]# make install 提供php主配置文件:[root@ASANGE php-5.5.0]# cp php.ini-development /usr/local/php/lib/php.ini为php-fpm提供启动脚本,添加至服务列表并开机启动:[root@ASANGE php-5.5.0]# cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
[root@ASANGE php-5.5.0]# chmod +x /etc/init.d/php-fpm
[root@ASANGE php-5.5.0]# chkconfig --add php-fpm
[root@ASANGE php-5.5.0]# chkconfig php-fpm on 10、启用fastcgi:# cd /usr/local/php/etc/
# cp php-fpm.conf.default php-fpm.conf
# vi php-fpm.conf //一般配置的依据如下
内存小于4G服务器(值可逐级递减):
修改如下参数:
pm=dynamic
pm.max_children=40
pm.start_servers=10
pm.min_spare_servers=10
pm.max_spare_servers=40
******************************
内存大于4G服务器(值可逐级递增):
修改如下参数:
pm=static
pm.max_children=100location / {
root html;
index index.html index.htm index.php; //添加index.php
}
//启用下面的配置
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
} 编辑fastcgi_params参数,将里面的内容全部替换为以下内容:#vim /etc/nginx/fastcgi_params
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name; 启动php-fpm,重启nginx[root@ASANGE ~]# service php-fpm start
Starting php-fpm done
[root@ASANGE ~]# service nginx restart
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
停止 nginx: [确定]
正在启动 nginx:tig[root@ASANGE ~]# vim /usr/local/nginx/html/index.php
<?php
phpinfo();
?>浏览器上访问:
[root@ASANGE ~]# unzip eaccelerator-0.9.6.1.zip
[root@ASANGE ~]# cd eaccelerator-0.9.6.1
[root@ASANGE eaccelerator-0.9.6.1]# ls
AUTHORS control.php doc ea_dasm.c ea_restore.h Makefile.in opcodes.h win32
bugreport.php COPYING eaccelerator.c ea_dasm.h ea_store.c mm.c optimize.c
ChangeLog dasm.php eaccelerator.h ea_info.c ea_store.h mm.h PHP_Highlight.php
config.m4 debug.c eaccelerator.ini ea_info.h fnmatch.c NEWS README
config.w32 debug.h eaccelerator_version.h ea_restore.c fnmatch.h opcodes.c README.win32
[root@ASANGE eaccelerator-0.9.6.1]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
[root@ASANGE eaccelerator-0.9.6.1]# ./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config
[root@ASANGE eaccelerator-0.9.6.1]# make && make install我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po
我打算为ruby脚本创建一个安装程序,但我希望能够确保机器安装了RVM。有没有一种方法可以完全离线安装RVM并且不引人注目(通过不引人注目,就像创建一个可以做所有事情的脚本而不是要求用户向他们的bash_profile或bashrc添加一些东西)我不是要脚本本身,只是一个关于如何走这条路的快速指针(如果可能的话)。我们还研究了这个很有帮助的问题:RVM-isthereawayforsimpleofflineinstall?但有点误导,因为答案只向我们展示了如何离线在RVM中安装ruby。我们需要能够离线安装RVM本身,并查看脚本https://raw.github.com/wayn
我有一个奇怪的问题:我在rvm上安装了rubyonrails。一切正常,我可以创建项目。但是在我输入“railsnew”时重新启动后,我有“程序'rails'当前未安装。”。SystemUbuntu12.04ruby-v"1.9.3p194"gemlistactionmailer(3.2.5)actionpack(3.2.5)activemodel(3.2.5)activerecord(3.2.5)activeresource(3.2.5)activesupport(3.2.5)arel(3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(
我刚刚为fedora安装了emacs。我想用emacs编写ruby。为ruby提供代码提示、代码完成类型功能所需的工具、扩展是什么? 最佳答案 ruby-mode已经包含在Emacs23之后的版本中。不过,它也可以通过ELPA获得。您可能感兴趣的其他一些事情是集成RVM、feature-mode(Cucumber)、rspec-mode、ruby-electric、inf-ruby、rinari(用于Rails)等。这是我当前用于Ruby开发的Emacs配置:https://github.com/citizen428/emacs
我的瘦服务器配置了nginx,我的ROR应用程序正在它们上运行。在我发布代码更新时运行thinrestart会给我的应用程序带来一些停机时间。我试图弄清楚如何优雅地重启正在运行的Thin实例,但找不到好的解决方案。有没有人能做到这一点? 最佳答案 #Restartjustthethinserverdescribedbythatconfigsudothin-C/etc/thin/mysite.ymlrestartNginx将继续运行并代理请求。如果您将Nginx设置为使用多个上游服务器,例如server{listen80;server
我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e
我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search
我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121
由于fast-stemmer的问题,我很难安装我想要的任何rubygem。我把我得到的错误放在下面。Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingfast-stemmer:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcreatingMakefilemake"DESTDIR="cleanmake"DESTDIR=
当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub