Centos6.5
Basic Install
1. install tomcat, jdk, nginx
1 | [root@localhost temp]# tar -zxvf apache-tomcat-7.0.68.tar.gz -C ../tomcat |
- Simplier way to install nginx
First, install Extra Packages for Enterprise Linux1
$ sudo yum install epel-release
Then, install nginx:1
$ sudo yum install nginx
Then, start ngix:1
$ sudo /etc/init.d/nginx start
Config here:1
$ sudo vim /etc/nginx/nginx.conf
Shutdown:1
$ nginx -s quit
注意:
普通用户无法启动 nginx, 其端口为80,1024以下的端口只有 root 能监听,
有些文件也无法访问
解决:
切换 root 用户, /usr/sbin:1
2# chown root nginx
# chmod u+s nginx
- nginx startup cmd
1 | [root@localhost ~]# /usr/local/nginx/sbin/nginx |
2. Install tomcat as a service
Change to the /etc/init.d directory and create a script called ‘tomcat’ as shown below.1
2[root@srv6 share]# cd /etc/init.d
[root@srv6 init.d]# vi tomcat
And here is the script we will use.
1 | #!/bin/bash |
1 | [root@srv6 init.d]# chmod 755 tomcat |
3. Install Redis
1 | [root@nginx redis]# make && make install |
1 | vi /etc/redis/redis.conf |
仅修改: daemonize yes (no–>yes)
1 | echo "/usr/local/bin/redis-server /etc/redis/redis.conf &" >> /etc/rc.local |
4. install mysql
查看 mysql:
1 | yum list | grep mysql |
安装:
1 | yum install mysql-server mysql mysql-devel |
查看安装结果:
1 | [root@nginx ~]# rpm -qi mysql-server |
首次启动:
1 | [root@nginx ~]# service mysqld start |
Set a password:
1 | [root@nginx ~]# /usr/bin/mysqladmin -u root password 123456 |
设置开机自启动:
1 | [root@nginx ~]# chkconfig mysqld on |
5. install varnish
使用epel源
1 | [root@localhost bin]# rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm |
check varnish:
1 | [root@localhost bin]# yum list|grep varnish |
Startup:
1 | [root@localhost bin]# service varnish start |
Check:
1 | [root@localhost bin]# varnishd -V |
For more details:
6. Install Maven
wget and tar and config the env.
For mvnw:
https://github.com/takari/maven-wrapper
1. Install ZooKeeper
- 启动
1 | zookeeper-3.4.6/bin/zkServer.sh start |
- 输入jps命令查看进程
1 | 1573 QuorumPeerMain |
Configuration
1. Set time zone
1 | [root@demo81 Asia]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
Add line:
1 | UTC=false or no — The hardware clock is set to local time. |
Reload:
1 | [root@demo81 Asia]# /etc/init.d/ntpd restart |
Check:
1 | [root@demo81 Asia]# date |
2. 环境变量 $PATH
1 | # echo 'pathmunge /usr/local/maven/bin' > /etc/profile.d/mvn.sh |
pathmunge 是redhat版本中系统变量profile中的函数,判断当前系统是否有此命令,如果没有,放置在之前或之后 ?
3. vim
Vim show line number 显示行号
1
2
3
4Find vimrc file:
$ whereis vimrc
$ sudo vim /etc/vimrc
Add: set nu!Vim 查找单词
配置:set insearch
使用 /word 查找单词