262144 安装脚本
#!/bin/bash
wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum -y install nginx
systemctl start nginx
systemctl enable nginx
systemctl status nginx.service
yum -y install mariadb mariadb-server
systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb
mysqladmin -uroot password Abc@1234
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y install php70w-tidy php70w-common php70w-devel php70w-pdo php70w-mysql php70w-gd php70w-ldap php70w-mbstring php70w-mcrypt php70w-fpm
php -v
systemctl start php-fpm
systemctl enable php-fpm
sed -i "9s/index index.html index.htm;/index index.php index.html index.htm;/" /etc/nginx/conf.d/default.conf
sed -i "10a location ~ \\\.php$ {" /etc/nginx/conf.d/default.conf
sed -i "11a root html;" /etc/nginx/conf.d/default.conf
sed -i "12a fastcgi_pass 127.0.0.1:9000;" /etc/nginx/conf.d/default.conf
sed -i "13a fastcgi_index index.php;" /etc/nginx/conf.d/default.conf
sed -i "14a fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html\$fastcgi_script_name;" /etc/nginx/conf.d/default.conf
sed -i "15a include fastcgi_params;" /etc/nginx/conf.d/default.conf
sed -i "16a }" /etc/nginx/conf.d/default.conf
service nginx reload
echo "<?php" >> /usr/share/nginx/html/info.php
echo "phpinfo();" >> /usr/share/nginx/html/info.php
echo "?>" >> /usr/share/nginx/html/info.php
/usr/bin/expect <<EOF
spawn mysql -u root -p
expect "Enter password: "
send "Abc@1234\r"
expect "mysql>"
send "CREATE DATABASE wordpress;\r"
expect "mysql>"
send "GRANT ALL ON wordpress.* TO root@localhost IDENTIFIED BY 'Abc@1234';\r"
expect eof
exit
EOF
wget -P /opt https://wordpress.org/wordpress-5.7.4.tar.gz
tar -xvf /opt/wordpress-5.7.4.tar.gz -C /opt/
rm -rf /usr/share/nginx/html/*
mv /opt/wordpress/* /usr/share/nginx/html/
chmod -R 777 /usr/share/nginx/html/
------------------------安装RC---------------------
#1.设置monogo repo
cat << EOF | sudo tee -a /etc/yum.repos.d/mongodb-org-4.0.repo
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
EOF
#手动安装node 下载 file/node的tar 解压 放到/usr/loca/bin/node 编写环境变量 export PATH:/
#source 就行
#2.安装依赖
yum install -y gcc-c++ make nodejs mongodb-org GraphicsMagick npm
yum groupinstall 'Development Tools' -y
#3.下载rocketchat 解压
wget -O rocket.chat.tgz https://releases.rocket.chat/3.18.2/download
tar -zxvf rocket.chat.tgz
mv bundle /opt/Rocket.Chat
#4.npm 设置 华为npm 源
npm config set registry https://repo.huaweicloud.com/repository/npm/
#5.npm 安装依赖
npm install -g inherits n
#查看/opt/Rocket.Chat/.node_version.txt
#查看版本号 使用n 进行切换
n 12.22.1
#下载完成后 重新登录 node -v查看版本号
#6.进入rocket chat
cd /opt/Rocket.Chat/programs/server
npm install
#7.修改 /etc/mongod.conf
storage:
dbPath: /var/lib/mongo
journal:
enabled: true
engine: mmapv1 #这里
.....
replication: #这里
replSetName: rs01 #这里
#8.启动 mongodb
systemctl start mongod
systemctl enable mongod
#9.使用mongodb 创建副本 他会把rs01创建出来
mongo --eval "printjson(rs.initiate())"
#10.编辑/usr/lib/systemd/system/rocketchat.service
[Unit]
Description=The Rocket.Chat server
After=network.target remote-fs.target nss-lookup.target nginx.target mongod.target
[Service]
ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=root
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01 ROOT_URL=http://主机IP:3000/ PORT=3000
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start rocketchat
#查看状态
systemctl status rocketchat
lsof -i:3000
#安全组开放3000端口,外面才能访问到
- 点赞
- 收藏
- 关注作者
评论(0)