当前位置: 首页 > wzjs >正文

广州市白云区建设局 网站怎样无货源开网店

广州市白云区建设局 网站,怎样无货源开网店,济南网站建设要多少钱,58同城做网站找谁一、spug代码仓库地址: spug: 开源运维平台:面向中小型企业设计的无 Agent的自动化运维平台,整合了主机管理、主机批量执行、主机在线终端、文件在线上传下载、应用发布、任务计划、配置中心、监控、报警等一系列功能。 - Gitee.com 注意:如…

一、spug代码仓库地址:

spug: 开源运维平台:面向中小型企业设计的无 Agent的自动化运维平台,整合了主机管理、主机批量执行、主机在线终端、文件在线上传下载、应用发布、任务计划、配置中心、监控、报警等一系列功能。 - Gitee.com

注意:如果要找怎么进行容器化部署的详细说明,直接在这个仓库看官方文档就行了

一般流程:

1.进入docs/docker目录,执行docker-compose up -d

2.docker-compose ps查看容器的端口,打开浏览器查看效果

如果过程中有报错,一般是linux系统版本和软件版本不匹配,比如我的系统是Rockylinux8.6,我根据报错信息替换掉软件(比如将mariadb-server换成mysql-server),升级软件(python3换成python39,顺便升级对应的pip软件)

二、clone或下载代码到本地共享目录

之所以使用共享目录,是因为可以在windows系统使用代码编辑器,在linux系统执行shell命令,可以参考这篇文章:

linux使用samba共享目录,其他虚拟机和windows都可以访问-CSDN博客

如果想直接在windows系统,不借助vmware工具直接打开Ubuntu系统,执行shell命令,配置挺复杂,有兴趣的可以查看如下地址的文档说明:

Manual installation steps for older versions of WSL | Microsoft Learn

1.拷贝docs目录下的install.sh到spug-api目录下:

aedc384b7205489e827976eb9dc31b0c.png

install.sh因为是在本地运行,所以改了一下,最大的改变就是python的版本,一般python3.9为好,还需要升级原本的python3.9对应的pip,否则会报错,其他的自行判断:

#!/bin/bash#set -e #如果写上这一行任何一个报错就会中止程序,不会继续后面的程序spuy_banner() {echo "                           ";
echo " ####  #####  #    #  #### ";
echo "#      #    # #    # #    #";
echo " ####  #    # #    # #     ";
echo "     # #####  #    # #  ###";
echo "#    # #      #    # #    #";
echo " ####  #       ####   #### ";
echo "                           ";}init_system_lib() {source /etc/os-releasecase $ID incentos|fedora|rhel|rocky)echo "开始安装/更新可能缺少的依赖"yum -y remove python3yum install -y python39yum -y install git mysql-server \gcc openldap-devel redis nginx supervisorsed -i 's/ default_server//g' /etc/nginx/nginx.confMYSQL_CONF=/etc/my.cnf.d/spug.cnfSUPERVISOR_CONF=/etc/supervisord.d/spug.iniREDIS_SRV=redisSUPERVISOR_SRV=supervisord;;debian|ubuntu|devuan)echo "开始安装/更新可能缺少的依赖"apt-get update#下载相应的软件,参照上面centos那些系统来写,就是把yum换成ubuntu的下载命令#。。。略。。。rm -f /etc/nginx/sites-enabled/defaultMYSQL_CONF=/etc/mysql/conf.d/spug.cnfSUPERVISOR_CONF=/etc/supervisor/conf.d/spug.confREDIS_SRV=redis-serverSUPERVISOR_SRV=supervisor;;*)exit 1;;esac
}install_spug() {echo "开始安装Spug..."python3 -m venv venvsource venv/bin/activate/usr/bin/pip3.9 install --upgrade pippip3.9 install wheel -i https://pypi.doubanio.com/simple/pip3.9 install gunicorn mysqlclient -i https://pypi.doubanio.com/simple/pip3.9 install -r requirements.txt -i https://pypi.doubanio.com/simple/
}setup_conf() {echo "开始配置Spug配置..."
# mysql conf
cat << EOF > $MYSQL_CONF
[mysqld]
bind-address=127.0.0.1
EOF
echo $PWD
# spug conf
cat << EOF > spug/overrides.py
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1']DATABASES = {'default': {'ATOMIC_REQUESTS': True,'ENGINE': 'django.db.backends.mysql','NAME': 'spug','USER': 'spug','PASSWORD': 'spug.dev','HOST': '127.0.0.1','OPTIONS': {'charset': 'utf8mb4','sql_mode': 'STRICT_TRANS_TABLES',}}
}
EOFcat << EOF > $SUPERVISOR_CONF
[program:spug-api]
command = bash /data/spug/spug_api/tools/start-api.sh
autostart = true
stdout_logfile = /data/spug/spug_api/logs/api.log
redirect_stderr = true[program:spug-ws]
command = bash /data/spug/spug_api/tools/start-ws.sh
autostart = true
stdout_logfile = /data/spug/spug_api/logs/ws.log
redirect_stderr = true[program:spug-worker]
command = bash /data/spug/spug_api/tools/start-worker.sh
autostart = true
stdout_logfile = /data/spug/spug_api/logs/worker.log
redirect_stderr = true[program:spug-monitor]
command = bash /data/spug/spug_api/tools/start-monitor.sh
autostart = true
stdout_logfile = /data/spug/spug_api/logs/monitor.log
redirect_stderr = true[program:spug-scheduler]
command = bash /data/spug/spug_api/tools/start-scheduler.sh
autostart = true
stdout_logfile = /data/spug/spug_api/logs/scheduler.log
redirect_stderr = true
EOFcat << EOF > /etc/nginx/conf.d/spug.conf
server {listen 80 default_server;root /data/spug/spug_web/build/;location ^~ /api/ {rewrite ^/api(.*) \$1 break;proxy_pass http://127.0.0.1:9001;proxy_redirect off;proxy_set_header X-Real-IP \$remote_addr;}location ^~ /api/ws/ {rewrite ^/api(.*) \$1 break;proxy_pass http://127.0.0.1:9002;proxy_http_version 1.1;proxy_set_header Upgrade \$http_upgrade;proxy_set_header Connection "Upgrade";proxy_set_header X-Real-IP \$remote_addr;}error_page 404 /index.html;
}
EOFsystemctl start mysqld
systemctl enable mysqldmysql -e "create database if not exists spug default character set utf8mb4 collate utf8mb4_unicode_ci;"
mysql -e "create user if not exists spug@'%' identified by 'spug.dev';"
mysql -e "grant all on spug.* to spug@'%'"
mysql -e "create user if not exists admin@'%' identified by 'spug.dev';"
mysql -e "grant all on *.* to admin@'%';"
mysql -e "flush privileges;"python3.9 manage.py initdb
python3.9 manage.py useradd -u admin -p spug.dev -s -n 管理员systemctl enable nginx
systemctl enable $REDIS_SRV
systemctl enable $SUPERVISOR_SRVsystemctl restart nginx
systemctl start $REDIS_SRV
systemctl restart $SUPERVISOR_SRV
}spuy_banner
init_system_lib
install_spug
setup_conf
echo 'good ending'
echo -e "\n\n\033[33m安全警告:默认的数据库和Redis服务并不安全,请确保其仅监听在127.0.0.1,推荐参考官网文档自行加固安全配置!\033[0m"
echo -e "\033[32m安装成功!\033[0m"
echo "默认管理员账户:admin  密码:spug.dev"
echo "默认数据库用户:spug   密码:spug.dev"

在linux系统的spug-api目录下执行:./install.sh

2.将docs/docker目录下的init_spug.sh放在spug-api目录下并修改:

#!/bin/bash
#
set -e
set -upython3.9 manage.py updatedb
python3.9 manage.py user add -u admin -p spug.dev -n 管理员 -s
python3.9 manage.py user add -u spug -p spug.dev -n 开发人员 -s

linux系统执行./init_spug.sh会给数据库填充更新数据,比如新增可登陆的用户名和密码数据

启动效果:

[root@git spug_api]# python3.9 manage.py runserver
/usr/local/lib/python3.9/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0."cipher": algorithms.TripleDES,
/usr/local/lib/python3.9/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0."class": algorithms.TripleDES,
/usr/local/lib/python3.9/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0."cipher": algorithms.TripleDES,
/usr/local/lib/python3.9/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0."class": algorithms.TripleDES,
Performing system checks...System check identified no issues (0 silenced).
September 19, 2024 - 00:04:27
Django version 2.2.28, using settings 'spug.settings'
Starting ASGI/Channels version 2.3.1 development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

3.启动spug-web

linux系统下运行如下命令(最好在同一个Linux服务器运行,如果在Windows或其他Linux服务器,则需要把对应接口的IP地址改为后端启动服务所在服务器的IP地址)

npm i下载插件依赖

npm start运行,默认端口3000,被占用3000端口的话提示替换成3001

Compiled successfully!You can now view spug_web in the browser.Local:            http://localhost:3001On Your Network:  http://192.168.137.12:3001Note that the development build is not optimized.
To create a production build, use npm run build.

windows的浏览器效果

203a832778994b25a9c769b84cd35349.png

使用admin和他的密码登录

60eb709f06b94b948b4b74814bb3b43e.png

 

 

 

 

 

http://www.dtcms.com/wzjs/7991.html

相关文章:

  • 无法登陆建设银行网站软件开发app制作
  • 汽修厂做网站有什么好处乔拓云智能建站系统
  • 龙岩建设局招聘网站百度广告怎么推广
  • phpstudy 安装wordpress宁波网站seo公司
  • 网站开发商城东莞seo推广公司
  • 广告联盟怎么赚钱无锡百度关键词优化
  • 广州荔湾网站制作公司提升seo排名平台
  • 贵州新闻做seo需要投入的成本
  • 怎样做网站编辑一个网站推广
  • wordpress 移动导航呼出seo推广教学
  • 最好的开发网站建设价格百度做广告怎么收费
  • 长春做网站4435seo网站推广优化论文
  • 做网站虚拟主机哪里有seo网站推广批发
  • 在小型网站建设小组百度seo点击工具
  • 泉州模板自助建站产品推广方案范文
  • 网站你啦怎样做旺仔饼干网络营销软文范例大全800
  • wordpress证书查询网站seo优化培训
  • 网站建设的重点百度安装应用
  • 深圳门户网站建设公司哪个网站学seo是免费的
  • 如何部署asp网站app推广员好做吗
  • 收费小说网站怎么做广告联盟论坛
  • wordpress 链接按钮网站文章优化技巧
  • 制作一个公司网站用vs怎么做网站建设服务
  • 视频网站砸钱做生态seo的研究对象
  • 多个招聘网站格式不一致如何做招聘记录seo推广价格
  • 网站建设推广公司价格数字营销是干啥的
  • 大连省建设厅网站青岛网站快速排名提升
  • 做个网站好还是做淘宝好什么平台发广告最有效
  • 绥化网站建设兼职淄博网站推广
  • 设计制作服务合同上海seo推广公司