# adduser 【你的用户名称】
# passwd 【你的用户名称】
# groupadd dev
# usermod -G dev 【你的用户名称】
# vi /etc/passwd
# vi /etc/group
- 创建并修改项目部署目录(/data)的用户组和权限
# mkdir /data
# chown -R :dev /data
# chmod -R 775 /data
mkdir -p /usr/java
rpm -ivh jdk-8u101-linux-x64.rpm
# vi /etc/profile
shift+g //定位到文档最后一行
gg //定位到文档第一行
export JAVA_HOME=/usr/java/jdk1.8.0_101
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
# source /etc/profile
# java –version
# vi $JAVA_PATH/jre/lib/security/java.security
securerandom.source=file:/dev/random
替换成
securerandom.source=file:/dev/urandom
# tar -zxvf kafka_2.11-0.10.1.0.tgz
# mv kafka_2.11-0.10.1.0 /usr/local/kafka
# vi /usr/local/kafka/config/server.properties
//修改listeners=PLAINTXT://192.168.0.125(对应application.xml):9092
listeners=PLAINTXT://localhost:9092
//修改zookeeper.connect=192.168.0.125(对应application.xml):2181
zookeeper.connect=localhost:2181
# sudo firewall-cmd --zone=public --add-port=9092/tcp --permanent
# sudo firewall-cmd --zone=public --add-port=2181/tcp --permanent
# sudo firewall-cmd --reload
//启动zookeeper:
# /usr/local/kafka/bin/zookeeper-server-start.sh -daemon /usr/local/kafka/config/zookeeper.properties
//关闭zookeeper:
# /usr/local/kafka/bin/zookeeper-server-stop.sh
//启动kafka服务:
# /usr/local/kafka/bin/kafka-server-start.sh -daemon /usr/local/kafka/config/server.properties
//关闭kafka服务:
# /usr/local/kafka/bin/kafka-server-stop.sh
// 安装 openssl
# yum -y install openssl openssl-devel
// 找到openssl安装路径
# whereis openssl
//创建源码目录
# mkdir -p /usr/nginx
// 解压
# tar zxvf nginx-1.10.1.tar.gz
//进入源码目录
# cd nginx-1.10.1
//编译
# ./configure --with-openssl=/usr/include/openssl/
//安装
# make && make install
//启动
# /usr/local/nginx/sbin/nginx
//查看进程
# ps -ef | grep nginx
//将nginx做成系统服务
# vi /etc/init.d/nginx
#! /bin/sh
# chkconfig: 2345 55 25
# Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and
# run 'update-rc.d -f nginx defaults', or use the appropriate command on your
# distro. For CentOS/Redhat run: 'chkconfig --add nginx'
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO
# Author: licess
# website: http://lnmp.org
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=nginx
NGINX_BIN=/usr/local/nginx/sbin/$NAME
CONFIGFILE=/usr/local/nginx/conf/$NAME.conf
PIDFILE=/usr/local/nginx/logs/$NAME.pid
case "$1" in
start)
echo -n "Starting $NAME... "
if netstat -tnpl | grep -q nginx;then
echo "$NAME (pid `pidof $NAME`) already running."
exit 1
fi
$NGINX_BIN -c $CONFIGFILE
if [ "$?" != 0 ] ; then
echo " failed"
exit 1
else
echo " done"
fi
;;
stop)
echo -n "Stoping $NAME... "
if ! netstat -tnpl | grep -q nginx; then
echo "$NAME is not running."
exit 1
fi
$NGINX_BIN -s stop
if [ "$?" != 0 ] ; then
echo " failed. Use force-quit"
exit 1
else
echo " done"
fi
;;
status)
if netstat -tnpl | grep -q nginx; then
PID=`pidof nginx`
echo "$NAME (pid $PID) is running..."
else
echo "$NAME is stopped"
exit 0
fi
;;
force-quit)
echo -n "Terminating $NAME... "
if ! netstat -tnpl | grep -q nginx; then
echo "$NAME is not running."
exit 1
fi
kill `pidof $NAME`
if [ "$?" != 0 ] ; then
echo " failed"
exit 1
else
echo " done"
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
reload)
echo -n "Reload service $NAME... "
if netstat -tnpl | grep -q nginx; then
$NGINX_BIN -s reload
echo " done"
else
echo "$NAME is not running, can't reload."
exit 1
fi
;;
configtest)
echo -n "Test $NAME configure files... "
$NGINX_BIN -t
;;
*)
echo "Usage: $0 {start|stop|force-quit|restart|reload|status|configtest}"
exit 1
;;
esac
# chkconfig --add nginx
# chmod +x /etc/init.d/nginx
# service nginx start
# service nginx restart
//开机启动
# systemctl enable nginx
//添加shell别名
# alias nginx="/usr/local/nginx/sbin/nginx"
//CentOS默认禁用了80端口
// 开启http服务:
# firewall-cmd --permanent --zone=public --add-service=http
// 重启防火墙:
# firewall-cmd --reload
# cd /home/[你的用户名称]
// 下载并解压tomcat压缩包
# tar -zxvf apache-tomcat-7.0.29.tar.gz
# mv apache-tomcat-7.0.29 /usr/local/tomcat
//打开端口
# sudo firewall-cmd --zone=public --permanent --add-port=8080/tcp
# sudo firewall-cmd --reload
//启动tomcat
# /usr/local/tomcat/bin/startup.sh