tomcat+tengine+redis+postgresql

1.安装Tengine

  1. 关于tengine的简介:tengine.taobao.org
  2. [root@localhost tengine-2.1.2]# wget -c http://tengine.taobao.org/download/tengine-2.1.2.tar.gz
  3. [root@localhost tengine-2.1.2]# tar xf tengine-2.1.2.tar.gz
  4. [root@localhost tengine-2.1.2]# useradd -s /bin/false -r tengine
  5. [root@localhost tengine-2.1.2]# yum -y install openssl-devel pcre-devel
  6. [root@localhost tengine-2.1.2]# ./configure –prefix=/usr/local/tengine –user=tengine –group=tengine
  7. [root@localhost tengine-2.1.2]# make && make install
  8. [root@localhost tengine-2.1.2]# vim /usr/lib/systemd/system/tengined.service

    [Unit]
    Description=The Tengine Http Server
    After=syslog.target network.target remote-fs.target nss-lookup.target

    [Service]
    Type=forking
    PIDFile=/usr/local/tengine/logs/nginx.pid
    ExecStartPre=/usr/bin/rm -f /usr/local/tengine/logs/nginx.pid
    ExecStartPre=/usr/local/tengine/sbin/nginx -t
    ExecStart=/usr/local/tengine/sbin/nginx
    ExecReload=/bin/kill -s HUP $MAINPID
    ExecStop=/bin/kill -s QUIT $MAINPID
    KillMode=process
    KillSignal=SIGQUIT
    TimeoutStopSec=5
    PrivateTmp=true
    [Install]
    WantedBy=multi-user.target

  9. [root@localhost sbin]# systemctl enable tengined.service

2.安装Tomcat

点击查看

3.安装Redis

  1. [root@localhost ~]# wget -c http://download.redis.io/releases/redis-3.2.0.tar.gz
  2. [root@localhost ~]# tar xf redis-3.2.0.tar.gz -C /usr/local
  3. [root@localhost redis-3.2.0]# yum -y install tcl
  4. [root@localhost redis-3.2.0]# make && make test && make install
  5. [root@localhost redis-3.2.0]# vim /usr/lib/systemd/system/redis.service

    [Unit]
    Description=Redis persistent key-value database
    After=network.target
    [Service]
    ExecStart=redis-server /data/apps/redis-3.2.0/redis.conf --daemonize no
    ExecStop=redis-cli -h 192.168.0.3 -p 9999 -a pwd shutdown
    User=root
    Group=redis
    [Install]
    WantedBy=multi-user.target

    `

4.安装PostgreSQL

  1. [root@localhost ~]# wget -c https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
  2. [root@localhost ~]# rpm -ivh pgdg-centos95-9.5-2.noarch.rpm
  3. [root@localhost ~]# yum -y install postgresql95-server postgresql95-contrib
  4. [root@localhost ~]# systemctl enable postgresql-9.5.service
  5. 初始化数据库
  6. [root@localhost ~]# /usr/pgsql-9.5/bin/postgresql95-setup initdb
  7. [root@localhost ~]# systemctl start postgresql-9.5.service
  8. 配置文件位置
  9. [root@localhost ~]# vim /var/lib/pgsql/9.5/data/pg_hba.conf
  10. 配置密码
  11. [root@localhost ~]# su - postgres
  12. [root@localhost ~]# psql -U postgres
  13. postgres=# alter user postgres with password ‘your_password’;

5.可能遇到的错误

PID file /your_path/nginx.pid not readable (yet?) after start.
这个就是你启动脚本和配置文件的pid不一致导致的

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值