Centos6.3 yum方式安装nginx

1、软件包管理 rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm CentOS 5,就用下面的源: rpm -ivh http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm Red Hat Enterprise Linux 6: rpm -ivh http://nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm Red Hat Enterprise Linux 5: rpm -ivh http://nginx.org/packages/rhel/5/noarch/RPMS/nginx-release-rhel-5-0.el5.ngx.noarch.rpm 2、安装 yum install nginx 3、启动 com.a3fun.rocket.service nginx start 4、测试 访问:http://1

yum方式安装MySQL

1、安装 yum install mysql mysql-server 2、启动 com.a3fun.rocket.service mysqld start 3、登录 mysql -uroot -p 4、改密码 set password for root@localhost=password('your_password') 5、查看密码 select user,host,password from mysql.user 备注: 更改数据库编码参考: SET character_set_client = utf8 ;

SpringMVC redirect重定向传递参数

URL不接参数的非重定向可以使用 Model.addAttribute(Object arg1); 重定向可以使用如下方法传递对象参数 RedirectAttributes.addFlashAttribute(String arg0, Object arg1) 其他传递方法则可参考RedirectAttributes类的方

EC2主机部署Wordpress

一、Wordpress配置 下载 wget http://wordpress.org/latest.zip 解压 unzip latest.zip 进入目录 cd wordpress/ 重命名 mv wp-config-sample.php wp-config.php 更改配置 vi wp-config.php 请自行根据数据库设置进行配置文件设置。 二、PHP服务器配置 安装

nginx location规则替换

server { listen 80; server_name www.6dgame.com 6dgame.com; location /2013/ { proxy_pass http://127.0.0.1:8081/; } location / { proxy_pass http://127.0.0.1:8080/; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } 对于此种设置方法, 访问:http://54.200.150.182:808

SpringMVC Controller层中 request接收参数乱码

直接使用 String email = request.getParameter("email"); 接收到email是乱码,需要转换 email = new String(request.getParameter("email").getBytes("ISO-8859-1"),"UTF-8"); 这样麻烦还需要处理异常。 还可以这么解决: web.xml <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>CharacterEncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>

亚马逊EC2上搭建Node.js

1、安装Node,js编译工具 sudo yum install gcc-c++ openssl-devel make curl git 2、下载Node.js源码、编译、安装 wget http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz tar -xvf node-v0.10.25.tar.gz cd node-v0.10.25 ./configure make 在此make会需要很长时间,我用了大约