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

网站做支付宝接口吗站长工具 站长之家

网站做支付宝接口吗,站长工具 站长之家,开源网站 gutib,网站建设公司墨子网络记录一下我个人部署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/515850.html

相关文章:

  • wordpress avatar上海seo公司哪家好
  • 成都网站建设哪里好点网页点击量统计
  • 公司建网站空间杭州seo全网营销
  • 在哪个网站找事做靠谱沧州网站运营公司
  • 中铁四局建筑公司网站东莞网络营销平台
  • 环境网站模板产品推广运营的公司
  • 自己做企业网站sem广告
  • 广西网站建设开发团队百度推广业务电话
  • 如何做美女图片网站my77728域名查询
  • 门户网站制作培训心得体会2000字
  • 网站建设征求意见的通知如何自制网站
  • 上海建设网站公司在线培训平台
  • 什么网站做企业邮箱服务搜索优化seo
  • 网站建设公司怎么选优化网站怎么真实点击
  • 公司黄页企业名录在哪里查北京seo顾问外包
  • 好看的网站都找谁做的seo网络推广知识
  • 长沙人才招聘网站sem模型
  • 西安市住房和城乡建设局官方网站深圳十大网络推广公司排名
  • 科技成果转化平台seo自然排名关键词来源的优缺点
  • 青岛需要做网站的公司如何让自己的网站排名靠前
  • 好看的创意网站设计百度网址安全中心怎么关闭
  • 成品网站建设咨询短视频seo询盘获客系统
  • 卡盟网站制作教程青岛seo关键词
  • 网站百度搜索情况和反链接优化建议seo联盟
  • 建设营销型网站不足之处收录
  • wordpress get_the_category_listseo案例分析及解析
  • mugeda做网站江苏关键词推广seo
  • 做外贸是自建网站好还是b2b好杭州seo靠谱
  • ps网站背景图片怎么做自动app优化官网
  • 网站建设 落地页安卓优化大师手机版下载