VPS侦探论坛

 找回密码
 注册
查看: 177|回复: 6

请问如何在LNMPA下安装magento2.4?

[复制链接]
发表于 2023-2-28 11:36:39 | 显示全部楼层 |阅读模式

我想试下在LNMPA下安装magento2.4, 军哥能给个安装指导吗?目前https://www.rxsafetyglassescanada.com 是安装在lnmp下的, 感觉访问速度一般。我想试下LNMPA, 而且我也很想再用.htaccess来进行安装设置。 谢谢了!

美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2023-2-28 18:20:13 | 显示全部楼层


安装步骤lnmp和lnmpa都一样的,lnmpa可用直接用 .htaccess
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 6 天前 | 显示全部楼层

lnmpa安装magento2.4有没有其它的什么设置要求?虚拟主机是根据nginx,还是apache来设置的?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 5 天前 | 显示全部楼层



yisou 发表于 2023-3-19 21:53
lnmpa安装magento2.4有没有其它的什么设置要求?虚拟主机是根据nginx,还是apache来设置的? ...

这种需要大量修改配置文件的就lnmpa最麻烦
lnmp vhost add 添加完改nginx的配置文件,按example中的例子配置文件改,动态的内容发代到apache上
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 4 天前 | 显示全部楼层

licess 发表于 2023-3-20 20:51
这种需要大量修改配置文件的就lnmpa最麻烦
lnmp vhost add 添加完改nginx的配置文件,按example中的例子 ...

军哥, 能麻烦你有时间时结合magento2.4.6与lnmpa来一套教学吗?包括安装,配置,以及nginx, mysql, php, apache的优化?

美国VPS、VPN、域名代购:http://shop63846532.taobao.com/

发表于 3 天前 | 显示全部楼层

yisou 发表于 2023-3-21 10:50
军哥, 能麻烦你有时间时结合magento2.4.6与lnmpa来一套教学吗?包括安装,配置,以及nginx, mysql, php, ...
  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name lnmp.org www.lnmp.org;
  6.         index index.php;
  7.         set $MAGE_ROOT /home/wwwroot/lnmp.org;

  8.         #如果需要http 301跳转到 https 需要将下面行前面的 # 注释去掉,并重载nginx
  9.         #return 301 https://lnmp.org$request_uri;

  10.         root $MAGE_ROOT/pub;
  11.         autoindex off;
  12.         charset UTF-8;
  13.         error_page 404 403 = /errors/404.php;
  14.         #add_header "X-UA-Compatible" "IE=Edge";

  15.         # Deny access to sensitive files
  16.         location /.user.ini {
  17.             deny all;
  18.         }

  19.         # PHP entry point for setup application
  20.         location ~* ^/setup($|/) {
  21.             root $MAGE_ROOT;
  22.             location ~ ^/setup/index.php {
  23.                 proxy_pass http://127.0.0.1:88;
  24.                 include proxy.conf;
  25.             }

  26.             location ~ ^/setup/(?!pub/). {
  27.                 deny all;
  28.             }

  29.             location ~ ^/setup/pub/ {
  30.                 add_header X-Frame-Options "SAMEORIGIN";
  31.             }
  32.         }

  33.         # PHP entry point for update application
  34.         location ~* ^/update($|/) {
  35.             root $MAGE_ROOT;

  36.             location ~ ^/update/index.php {
  37.                 proxy_pass http://127.0.0.1:88;
  38.                 include proxy.conf;
  39.             }

  40.             # Deny everything but index.php
  41.             location ~ ^/update/(?!pub/). {
  42.                 deny all;
  43.             }

  44.             location ~ ^/update/pub/ {
  45.                 add_header X-Frame-Options "SAMEORIGIN";
  46.             }
  47.         }

  48.         location / {
  49.             try_files $uri $uri/ /index.php$is_args$args;
  50.         }

  51.         location /pub/ {
  52.             location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
  53.                 deny all;
  54.             }
  55.             alias $MAGE_ROOT/pub/;
  56.             add_header X-Frame-Options "SAMEORIGIN";
  57.         }

  58.         location /static/ {
  59.             # Uncomment the following line in production mode
  60.             # expires max;

  61.             # Remove signature of the static files that is used to overcome the browser cache
  62.             location ~ ^/static/version {
  63.                 rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
  64.             }

  65.             location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$ {
  66.                 add_header Cache-Control "public";
  67.                 add_header X-Frame-Options "SAMEORIGIN";
  68.                 expires +1y;

  69.                 if (!-f $request_filename) {
  70.                     rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
  71.                 }
  72.             }
  73.             location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
  74.                 add_header Cache-Control "no-store";
  75.                 add_header X-Frame-Options "SAMEORIGIN";
  76.                 expires    off;

  77.                 if (!-f $request_filename) {
  78.                    rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
  79.                 }
  80.             }
  81.             if (!-f $request_filename) {
  82.                 rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
  83.             }
  84.             add_header X-Frame-Options "SAMEORIGIN";
  85.         }

  86.         location /media/ {
  87.             try_files $uri $uri/ /get.php$is_args$args;

  88.             location ~ ^/media/theme_customization/.*\.xml {
  89.                 deny all;
  90.             }

  91.             location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
  92.                 add_header Cache-Control "public";
  93.                 add_header X-Frame-Options "SAMEORIGIN";
  94.                 expires +1y;
  95.                 try_files $uri $uri/ /get.php$is_args$args;
  96.             }
  97.             location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
  98.                 add_header Cache-Control "no-store";
  99.                 add_header X-Frame-Options "SAMEORIGIN";
  100.                 expires    off;
  101.                 try_files $uri $uri/ /get.php$is_args$args;
  102.             }
  103.             add_header X-Frame-Options "SAMEORIGIN";
  104.         }

  105.         location /media/customer/ {
  106.             deny all;
  107.         }

  108.         location /media/downloadable/ {
  109.             deny all;
  110.         }

  111.         location /media/import/ {
  112.             deny all;
  113.         }
  114.         location /errors/ {
  115.             location ~* \.xml$ {
  116.                 deny all;
  117.             }
  118.         }

  119.         # PHP entry point for main application
  120.         location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ {
  121.             proxy_pass http://127.0.0.1:88;
  122.             include proxy.conf;
  123.         }

  124.         gzip on;
  125.         gzip_disable "msie6";

  126.         gzip_comp_level 6;
  127.         gzip_min_length 1100;
  128.         gzip_buffers 16 8k;
  129.         gzip_proxied any;
  130.         gzip_types
  131.             text/plain
  132.             text/css
  133.             text/js
  134.             text/xml
  135.             text/javascript
  136.             application/javascript
  137.             application/x-javascript
  138.             application/json
  139.             application/xml
  140.             application/xml+rss
  141.             image/svg+xml;
  142.         gzip_vary on;

  143.         location ~ /.well-known {
  144.             allow all;
  145.         }

  146.         # Banned locations (only reached if the earlier PHP entry point regexes don't match)
  147.         location ~* (\.php$|\.phtml$|\.htaccess$|\.git) {
  148.             deny all;
  149.         }
  150.     }
复制代码

仅供参考,自行测试
 楼主| 发表于 前天 10:10 | 显示全部楼层

谢谢,我在本地测试下。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2023-3-25 21:27 , Processed in 0.083488 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表