部署项目用到的杂七杂八linux命令。 做个笔记,自己参考。
个人笔记,大家不要浪费时间阅读。
tar -xvf jdk-8u202-linux-x64.tar.gz //解压tar
export JAVA_HOME=/usr/local/java/jdk1.8.0_202
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
unzip firstly-ui.zip //解压zip
mv mysql-8.0.23-linux-glibc2.17-x86_64-minimal/ mysql
./bin/mysqladmin -u root password ‘000000’ //密码登录
/usr/local/mysql/support-files/mysql.server start //开启mysql服务
ln -fs /usr/local/mysql/bin/mysql mysql //软连接
ln -s /usr/local/nodejs/node-v10.15.3-linux-x64/bin/npm /usr/local/bin/ //软连接
ln -s /usr/local/nodejs/node-v10.15.3-linux-x64/bin/node /usr/local/bin/ //软连接
set password for root@127.0.0.1 = password(‘123456’) //mysql>设置密码
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf //nginx映射
rm /usr/local/bin/npm //删除空文件夹
rm -rf /usr/local/bin/npm //删除文件夹及其子目录
kill 8240 //结束8240进程
useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false&useSSL=false
/usr/local/mysql/bin/mysqld_safe --user=mysql & //mysql后台一直开启
nohup java -jar freelychat.jar & //java后台一直运行
nohup java -jar firstlyChat.jar &
lsof -i :8080
/usr/local/nginx/nginx-1.13.7/sbin/nginx -s reload //启动
cd /usr/sbin 然后直接 nginx
[root@freelychat sbin]# ps -ef | grep nginx //查看nginx进程
try_files $uri $uri/ /index.html; //解决niginx刷新404
vi /usr/local/nginx/conf/nginx.conf
server {
listen 8088;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /var/www/html;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}