Linux服务器软件安装备忘
1.Centos安装Mysql
--安装
yum install mysql-server 卸载 yum -e mysql-server
--设置为开机启动
chkconfig mysqld on
--启动mysql
service mysqld start
--设置root密码
mysqladmin -u root password 'xxx'
#双机热备
GRANT REPLICATION SLAVE ON *.* TO 'backup'@'192.168.1.33' IDENTIFIED BY 'backup_xxx';
#一般账号
--GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
flush privileges;
乱码:
[mysqld]
#add
default-character-set = utf8
character-set-server = utf8
collation-server = utf8_general_ci
init_connect = 'SET collation_connection = utf_general_ci'
init_connect = 'SET NAMES utf8'
[mysqld_safe]
2.安装Redis
wget http://download.redis.io/releases/redis-2.8.7.tar.gz or http://download.redis.io/releases/redis-2.6.17.tar.gz
tar -zvxf xxx
configure
make && make install
3.启动memcached
memcached -d -m 100 -u root -p 11211 -P /tmp/memcached.pid
4.防火墙:
Iptables:
启动iptables
service iptables start
iptables --list //*查看iptables规则集*//
下面是没有定义规划时iptables的样子:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
如何开启/关闭指定端口
例如:
开启81端口:
iptables -I INPUT -i eth0 -p tcp --dport 81 -j ACCEPT
iptables -I OUTPUT -o eth0 -p tcp --sport 81 -j ACCEPT
关闭81端口:
iptables -I INPUT -i eth0 -p tcp --dport 81 -j DROP
iptables -I OUTPUT -o eth0 -p tcp --sport 81 -j DROP
然后保存
/etc/rc.d/init.d/iptables save
你可以使用lsof命令来查看某一端口是否开放.查看端口可以这样来使用.
我就以81端口为例:
lsof -i:81
如果有显示说明已经开放了.如果没有显示说明没有开放
5.环境变量
Tomcat JVM配置--catalina.bat/catalina.sh
windows
set JAVA_OPTS = -Xmx512m -Xms512m -XX:MaxPermSize=256m
linux
JAVA_OPTS ="-server -Xmx400m -Xms400m -Xmn128m -XX:MaxPermSize=128m -XX:PermSize=128m"
6.项目直接访问
【Tomcat直接访问项目--去掉访问路径上的项目名称】
修改Tomcat_Home/conf/server.xml
<Host> 下添加 <Context path="" docBase="项目路径" reloadable="true" />
path为访问路径,与request.getContextPath()返回值一样。
7.Nginx配置:
安装 pcre-devel openssl-devel
http{
#...
gzip on;
gzip_min_length 1k;
gzip_buffers 16 64k;
gzip_http_version 1.1;
gzip_comp_level 4;
gzip_types text/plain text/css application/xml image/png; #...
gzip_vary on;
sendfile on;
client_max_body_size 1024m;#附件上传
upstream e_learning{
server 192.168.1.30:8080;
server 192.168.1.31:8080;
ip_hash;
}
server{
listen 80;
server_name 192.168.1.34;
index index.jsp;
location / {
index index.jsp;
proxy_pass http://e_learning;
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ^~ /upload/ {
expires 10d;
root /var/e_learning;
}
location ^~ /vod {
proxy_pass http://192.168.1.36:1935/vod/;
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~*\.(gif|jpg|png|js|css)$ {
expires 10d;
proxy_pass http://e_learning;
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
Linux服务器软件安装备忘的更多相关文章
- 安装 CentOS 后的系统配置及软件安装备忘
安装 CentOS 后的系统配置及软件安装备忘 // */ // ]]> 安装 CentOS 后的系统配置及软件安装备忘 Table of Contents 1 Linux 自举过程 1.1 ...
- nginx1.8+php5.6.10 服务器编译安装备忘2015-06
又要重新装一台阿里云服务器.开始想用脚本,但发现脚本的程序版本都比较低 还是手动编译最新版本 开始前 更新服务器到最新版本 #yum makecache #yum update //分区挂数据盘 # ...
- Sublime Text4(Build 4126) 安装备忘
Sublime Text4(Build 4126) 安装备忘 sublime text 4126 PJ已测可用 打开浏览器进入网站https://hexed.it 打开sublime text4安装目 ...
- MSDE2008安装备忘
MSDE2008安装备忘(适用于WIN7 8 10) 1.系统中必须要VC8.0,即VC2005运行库.2.系统中必须要有.net framework2.0.3.5.4.6运行库.3.windows防 ...
- CentOS安装备忘2
CentOS7安装备忘2 安装过程中不联网,安装完成也不要立刻联网,先关闭远程的服务后再联网更新.安装默认使用English,目的是生成的Home下所有文件夹都是英文的,方便使用. ========= ...
- Linux课程---3、Linux远程登录和传输(操作Linux服务器软件)
Linux课程---3.Linux远程登录和传输(操作Linux服务器软件) 一.总结 一句话总结: xshell:Xshell是一个强大的安全终端模拟软件 Xshell是一个强大的安全终端模拟软件, ...
- Linux中软件安装包的格式
一.Linux常用安装包及安装方法 1.安装包一般有四类: 1)tar包,如software-1.2.3-1.tar.gz.他是使用UNIX系统的打包工具tar打包的. 2)rpm包,如softwar ...
- CentOS7安装备忘
======1 下载CentOS镜像文件:https://www.centos.org/download/http://isoredirect.centos.org/centos/7/isos/x86 ...
- WRF 安装备忘
▶ n 年前在笔记本上安装 WRF 的一个过程 ● 安装 cpp,csh,m4,quota,samba # apt-get install cpp csh m4 quota samba ● 网上教程有 ...
随机推荐
- POJ 1611 The Suspects(简单并查集)
( ̄▽ ̄)" #include<iostream> #include<cstdio> using namespace std; ]; void makeSet(int ...
- WEBROOT根目录 <%=request.getContextPath()%>
WEBROOT根目录 <%=request.getContextPath()%> == ${pageContext.request.contextPath}
- 12.04 ubuntu 更改IP
在一个局域网里面,如果是自动获取IP,就会导致IP冲突 进入要连接的热点进行设置 IPV4 Setting address netmask ...
- rebar
www.cnblogs.com/panfeng412/archive/2011/08/14/2137990.html
- 扩展方法之ToDictionary()
Person类: public class Person { public int Id { set; get; } public string WorkNo { set; get; } public ...
- 转 oracle 如何停下oracle 服务
设置SET ORACLE_SID=ORCL ORCL--实例名称 --停止oracle实例服务 C:\Users\Administrator>net stop oracleserviceORCl ...
- 【贪心】 poj 1032 和为n的若干数最大乘积
给出n,把n分解为若干不相同数之和,使之乘积最大.贪心,Discuss里面的思路:把n分解为从2开始的连续整数,如果有多,则从高位开始依次加1.如26,我们得到2+3+4+5+6,此时还剩余6(26- ...
- javaScript 新学习:Array.contains 函数
Array.contains 函数 确定指定对象是否是 Array 对象中的元素. 此函数是静态的,可在不创建对象实例的情况下调用. var itemExists = Array.contains(a ...
- php 10.2总
注意事项 获取表单信息 <?php if($_POST["submit"]=="登录"){ echo "您输入的用户名为:".$_PO ...
- servlet & javabean
1.servelet 什么是Servlet?① Servlet就是JAVA 类② Servlet是一个继承HttpServlet类的类③这个在服务器端运行,用以处理客户端的请求 Servlet相关包的 ...