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

自己怎么做dj 视频网站电商网站设计

自己怎么做dj 视频网站,电商网站设计,外贸先做网站还是开公司,安卓app开发技术记录一下我个人部署Linux服务器的心得 环境介绍 ESC服务器创建时默认安装LNMP,即Linux,Nginx,Mysql,Php 所以这里不讲怎么安装Nignx和Mysql 笔者使用的Linux版本为22.0.4LTS版 前端打包 运行React打包命令进行前端项目的打包…

记录一下我个人部署Linux服务器的心得

环境介绍

ESC服务器创建时默认安装LNMP,即Linux,Nginx,Mysql,Php

所以这里不讲怎么安装Nignx和Mysql

笔者使用的Linux版本为22.0.4LTS版

前端打包

运行React打包命令进行前端项目的打包

npm run build

打包后可能生成dist或者build文件夹,这取决于你构建react项目采用的方式

服务器Nginx的网页目录为/var/www/html文件夹,将上述dist或者build文件夹的内容拷贝到这里

注意:不要将整个文件夹拖入,因为dist或者build文件夹无法识别

服务器Nginx的配置目录为/etc/nginx文件夹,打开nginx.conf文件

 可以看到它包括了下面两个配置

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

我们修改下面那个里面的默认配置文件,同时解决跨域问题

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
### Default server configuration
#
server {listen 80;listen [::]:80;# SSL configuration## listen 443 ssl default_server;# listen [::]:443 ssl default_server;## Note: You should disable gzip for SSL traffic.# See: https://bugs.debian.org/773332## Read up on ssl_ciphers to ensure a secure configuration.# See: https://bugs.debian.org/765782## Self signed certs generated by the ssl-cert package# Don't use them in a production server!## include snippets/snakeoil.conf;root /var/www/html;# Add index.php to the list if you are using PHPindex index.php index.html index.htm index.nginx-debian.html;server_name 39.106.52.24;location /api/ {proxy_pass http://localhost:8081/;  # 后端服务地址proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Scheme  $scheme;      # 传递协议proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Cookie $http_cookie;}location / {# First attempt to serve request as file, then# as directory, then fall back to displaying a 404.try_files $uri $uri/ =404;}# pass PHP scripts to FastCGI server#location ~ \.php$ {include snippets/fastcgi-php.conf;##	# With php-fpm (or other unix sockets):fastcgi_pass unix:/run/php/php8.0-fpm.sock;#	# With php-cgi (or other tcp sockets):#	fastcgi_pass 127.0.0.1:9000;}#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {#	deny all;#}
}# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#	listen 80;
#	listen [::]:80;
#
#	server_name example.com;
#
#	root /var/www/example.com;
#	index index.html;
#
#	location / {
#		try_files $uri $uri/ =404;
#	}
#}

后端打包

笔者项目使用gradle创建,所以运行下面命令

gradlew build

接着把build文件夹下的libs中生成的jar文件拷贝到云服务器运行即可

java -jar Sapling-0.0.1-SNAPSHOT.jar

有一种方法可以让jar一直在服务器后台运行。方法就是用下面这行命令运行jar包

nohup java -jar /opt/tracker/Sapling-0.0.1-SNAPSHOT.jar &//注意这里还有& 不要忘记了。

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

相关文章:

  • 做网站的最终目的自己开发网站怎么盈利
  • 商丘网站建设制作大兴今日头条新闻
  • wordpress轮播插件下载汕头seo公司
  • 设计需要看的网站有哪些腾讯企业邮箱
  • 怎么从阿里巴巴做网站北京百度搜索优化
  • 做电焊加工的网站域名注册网站查询
  • 上饶网站开发网络营销百科
  • 卡通风格的宣传网站百度平台推广该怎么做
  • 网网站站建建站站网站制作教程
  • 注册网站怎么做网络营销比较常用的营销模式
  • 网站建设 管理网站如何快速推广
  • 企业品牌网站建设费用泉州关键词优化报价
  • 设计网站包含的功能模块指数基金定投技巧
  • 关于集约化建设政府网站2022知名品牌营销案例100例
  • 网站开发的公司属于什么行业市场监督管理局上班时间
  • 年轻人必备的十大网站国内新闻大事20条
  • 洛阳市城市建设网站在线外链
  • 广州营销网站制作适合交换友情链接的是
  • 鞍山网站开发it培训学校
  • 元谋网站建设百度大数据官网
  • 工厂型企业做网站学大教育培训机构怎么样
  • 怎么做网站推广图片网络营销服务的内容
  • 腾讯企业网页设计百度搜索引擎seo
  • 旅游公司网站难做吗百度网站优化工具
  • 动态效果网站建设技术智能建站abc
  • 兰溪做网站在线看crm系统
  • 什么系统做网站最安全盐城seo优化
  • 山西建站便宜软文发布系统
  • 万网如何购买网站空间郑州做网站推广资讯
  • 网站配色设计搜索引擎seo