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

网站建设江苏网站开发文档下载

网站建设江苏,网站开发文档下载,借20万资金办厂,提升网站建设品质公司一、服务器安装python环境 1、安装gcc(Ubuntu默认已安装) 2、安装python源码 wget https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz 3、安装Python依赖库 4、配置python豆瓣源 二、服务器安装虚拟环境 1、安装virtualenv pip3.10 ins…

一、服务器安装python环境

1、安装gcc(Ubuntu默认已安装)
2、安装python源码
wget https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tar.xz
3、安装Python依赖库
4、配置python豆瓣源

二、服务器安装虚拟环境

1、安装virtualenv
pip3.10 install virtualenv
2、创建虚拟环境
mkdir -p /usr/data/envs
mkdir -p virtualenv /usr/data/envs/nb --python=python3.10
3、激活虚拟环境
source /usr/data/envs/nb/bin/activate

三、uwsgi环境

1、安装
source /usr/data/envs/nb/bin/activate
pip install uwsgi
2、基于uwsgi运行flask项目
cd 项目目录
-命令行的方式
uwsgi --http :8080 --wsgi-file app.py --callable app
-配置文件的方式(推荐)
创建nb_uwsgi.ini文件
[uwsgi]
socket = 127.0.0.1:8001
chdir=项目目录
wsgi-file = app.py
callable = app
processes = 2
virtualenv = /usr/data/envs/nb

启动进程
source /usr/data/envs/nb/bin/activate
uwsgi --ini nb_uwsgi.ini关闭进程
ps -ef | grep nb_uwsgi
ps -ef | grep 进程id

四、Nginx环境

1、安装ngix
sudo apt update
sudo apt install nginx
2、修改配置文件
-普通请求 ->8081端口
-/static ->项目静态资源目录
Nginx的默认配置文件路径 /etc/nginx/nginx.conf

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;events {worker_connections 768;# multi_accept on;
}http {### Basic Settings##sendfile on;tcp_nopush on;types_hash_max_size 2048;# server_tokens off;# server_names_hash_bucket_size 64;# server_name_in_redirect off;include /etc/nginx/mime.types;default_type application/octet-stream;upstream flask {server 127.0.0.1:8001;}server {listen	80:listen	[::]:80;location /static {alias /root/zjbj_revit_family/EQPlatformServer/static;}location / {uwsgi_pass	falsk;include		uwsgi_params;}}}#mail {
#	# See sample authentication script at:
#	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#	# auth_http localhost/auth.php;
#	# pop3_capabilities "TOP" "USER";
#	# imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
#
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}
#}

3、启动Nginx

  • 启动
systemctl start nginx
systemctl stop nginx
systemctl restart nginx
  • 开机启动
systemctl enable nginx
systemctl start nginx

五、uwsgi开机自启动

vi /etc/systemd/system/uwsgi.service
	[Unit]Description=uWSGI instance to serve myappAfter=network.target[Service]User=rootGroup=rootWorkingDirectory=/root/zjbj_revit_family/EQPlatformServerEnvironment="PATH=/usr/data/envs/nb/bin"ExecStart=/usr/data/envs/nb/bin/uwsgi --ini /root/zjbj_revit_family/EQPlatformServer/nb_uwsgi.ini[Install]WantedBy=multi-user.target
chmod +x /etc/systemd/system/uwsgi.servicesudo systemctl daemon-reload
sudo systemctl enable uwsgi.service
sudo systemctl start uwsgi.service

六、安装MySQL

1、安装MySQL服务
sudo apt update
sudo apt install mysql-server
检查服务状态: sudo systemctl status mysql
创建数据库
CREATE DATABASE IF NOT EXISTS eqplatform CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci
2、授权

   创建用户
CREATE USER 'admin'@'%' IDENTIFIED WITH mysql_native_password BY 'Password123!';授权
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;刷新权限
FLUSH PRIVILEGES;

3、测试:
-远程测试: 配置 MySQL 以允许远程连接
编辑MySQL的配置文件/etc/mysql/mysql.conf.d/mysqld.cnf(或相应的配置文件,具体取决于你的MySQL版本和安装方式),找到bind-address行,并将其值改为0.0.0.0以允许任何地址的连接,或者指定一个特定的IP地址。

4、启动MySQL
5、连接MySQL

七、防火墙开启端口

sudo ufw allow 5000
sudo ufw allow 8080
http://www.dtcms.com/a/407642.html

相关文章:

  • 阿里云服务器建站个人创建微信小程序
  • 免拔卡刷 TikTok 国际版教程|小米手机+电信卡完整指南
  • 【精品资料鉴赏】194页电力行业DeepSeek大模型的财务智能化应用设计方案
  • 部分网站为什么网页打不开的原因及解决方法wordpress frp穿透
  • 网站建设和运营的课程wordpress账号注册
  • FineReport自定义登录系统技术
  • 网站建设广告平台推广做自己的网站多少钱
  • SyncTV+cpolar:跨地域同步追剧的远程方案
  • Redis 面试宝典
  • 【LeetCode_21】合并两个有序链表
  • 大庆建设工程交易中心网站提供网站建设管理
  • VSCode编译器测试yolo环境配置
  • 网站建设类国外企业招聘网站
  • tp做网站房地产培训网站建设
  • php网站做分享到朋友圈网站设置搜索框是什么知识点
  • 免费psd图片素材网站ui设计培训大概多少钱
  • 《C++程序设计》笔记p6
  • 安徽同济建设集团网站公司搭建网站模板
  • 【读书笔记】《大国大成》
  • C++笔记(基础)引用 inline内联函数
  • 焦作网站建设公司哪家好dz整站网站建设
  • 建站快车品牌北京网站建设兴田德润放心
  • cuda编程笔记(22)-- NVIDIA Triton Inference Server
  • 怎么知道网站是否被百度收录软件开发工具有哪些
  • 伦理治理进入程序化攻坚阶段
  • 经典网站赏析永久使用免费虚拟主机
  • 【跟我学YOLO】YOLO26:YOLO Vision 2025 最新发布的端到端视觉 AI 新突破
  • 什么网站百度收录好最新国家大事时政新闻
  • 怎么做网站手机版辅助设计软件有哪些
  • Model Context Protocol (MCP)详解与Spring Boot集成实战