1.安装Tengine
- 关于tengine的简介:tengine.taobao.org
- [root@localhost tengine-2.1.2]# wget -c http://tengine.taobao.org/download/tengine-2.1.2.tar.gz
- [root@localhost tengine-2.1.2]# tar xf tengine-2.1.2.tar.gz
- [root@localhost tengine-2.1.2]# useradd -s /bin/false -r tengine
- [root@localhost tengine-2.1.2]# yum -y install openssl-devel pcre-devel
- [root@localhost tengine-2.1.2]# ./configure –prefix=/usr/local/tengine –user=tengine –group=tengine
- [root@localhost tengine-2.1.2]# make && make install
[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[root@localhost sbin]# systemctl enable tengined.service
2.安装Tomcat
3.安装Redis
- [root@localhost ~]# wget -c http://download.redis.io/releases/redis-3.2.0.tar.gz
- [root@localhost ~]# tar xf redis-3.2.0.tar.gz -C /usr/local
- [root@localhost redis-3.2.0]# yum -y install tcl
- [root@localhost redis-3.2.0]# make && make test && make install
[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
- [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
- [root@localhost ~]# rpm -ivh pgdg-centos95-9.5-2.noarch.rpm
- [root@localhost ~]# yum -y install postgresql95-server postgresql95-contrib
- [root@localhost ~]# systemctl enable postgresql-9.5.service
- 初始化数据库
- [root@localhost ~]# /usr/pgsql-9.5/bin/postgresql95-setup initdb
- [root@localhost ~]# systemctl start postgresql-9.5.service
- 配置文件位置
- [root@localhost ~]# vim /var/lib/pgsql/9.5/data/pg_hba.conf
- 配置密码
- [root@localhost ~]# su - postgres
- [root@localhost ~]# psql -U postgres
- postgres=# alter user postgres with password ‘your_password’;
5.可能遇到的错误
PID file /your_path/nginx.pid not readable (yet?) after start.
这个就是你启动脚本和配置文件的pid不一致导致的