magenx / magento-2-server-installation Goto Github PK
View Code? Open in Web Editor NEWMagento 2 Server Installation - MagenX e-commerce stack on Ubuntu 20/22.04 | Debian 11/12
Home Page: https://magenx.sh
Magento 2 Server Installation - MagenX e-commerce stack on Ubuntu 20/22.04 | Debian 11/12
Home Page: https://magenx.sh
[!] REALTIME MALWARE MONITOR WITH E-MAIL ALERTING
[!] INFECTED FILES WILL BE MOVED TO QUARANTINE
--2021-09-26 14:52:11-- https://www.rfxn.com/downloads/maldetect-current.tar.gz
Resolving www.rfxn.com (www.rfxn.com)... 104.21.28.71, 172.67.144.156, 2606:4700:3036::ac43:909c, ...
Connecting to www.rfxn.com (www.rfxn.com)|104.21.28.71|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1549126 (1.5M) [application/x-gzip]
Saving to: ‘maldetect-current.tar.gz.1’
maldetect-current.tar.gz.1 100%[============================================================================================================================================================================>] 1.48M --.-KB/s in 0.008s
2021-09-26 14:52:11 (192 MB/s) - ‘maldetect-current.tar.gz.1’ saved [1549126/1549126]
magenx.sh: line 1649: cd: too many arguments
magenx.sh: line 1650: ./install.sh: No such file or directory
sed: can't read /usr/local/maldetect/conf.maldet: No such file or directory
sed: can't read /usr/local/maldetect/conf.maldet: No such file or directory
sed: can't read /usr/local/maldetect/conf.maldet: No such file or directory
sed: can't read /usr/local/maldetect/conf.maldet: No such file or directory
sed: can't read /usr/local/maldetect/conf.maldet: No such file or directory
sed: can't read /usr/local/maldetect/conf.maldet: No such file or directory
magenx.sh: line 1659: /usr/local/maldetect/monitor_paths: No such file or directory
magenx.sh: line 1661: maldet: command not found
MAGENTO MALWARE SCANNER
Hourly cronjob created
AUDIT MAGENTO FILES AND FOLDERS
* Reloading audit daemon auditd [ OK ]
-a never,exit -S all -F dir=/home/magento/public_html/var/ -F key=exclude
-w /home/magento/public_html -p wa -k auditmgnx
ROOT CRONJOBS
REDIS CACHE AND SESSION STORAGE
We saved default values for these options: remote-storage-prefix, remote-storage-key, remote-storage-secret, amqp-ssl, amqp-ssl-options, db-ssl-key, db-ssl-cert, db-ssl-ca, db-ssl-verify, allow-parallel-generation.
We saved default values for these options: remote-storage-prefix, remote-storage-key, remote-storage-secret, amqp-ssl, amqp-ssl-options, db-ssl-key, db-ssl-cert, db-ssl-ca, db-ssl-verify, allow-parallel-generation.
Overwrite the existing configuration for http-cache-hosts?[Y/n]y
We saved default values for these options: remote-storage-prefix, remote-storage-key, remote-storage-secret, amqp-ssl, amqp-ssl-options, db-ssl-key, db-ssl-cert, db-ssl-ca, db-ssl-verify, allow-parallel-generation.
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
- The unit packagekit.service has successfully entered the 'dead' state.
Sep 26 14:57:06 server.magento.c4.io audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=packagekit comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Sep 26 14:57:38 server.magento.c4.io systemd[1]: Starting nginx - high performance web server...
-- Subject: A start job for unit nginx.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit nginx.service has begun execution.
--
-- The job identifier is 15626.
Sep 26 14:57:38 server.magento.c4.io nginx[89549]: nginx: [emerg] invalid number of the geo parameters in /etc/nginx/conf_m2/maps.conf:37
Sep 26 14:57:38 server.magento.c4.io systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit nginx.service has exited.
## Admin location http auth
geo $authentication {
default "Authentication required";
127.0.0.1 "off";
"off";
}
When I try to install with the command in your docs there's an error:
[root@dev ~]# curl -o magenx.sh https://magenx.sh && bash magenx.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 138 100 138 0 0 2464 0 --:--:-- --:--:-- --:--:-- 2464
magenx.sh: line 1: html: No such file or directory
magenx.sh: line 2: syntax error near unexpected token <' 'agenx.sh: line 2:
<title>302 Found</title>
the path is broken
Can anyone tell me what settings should I change so that SSL works for me?
I noticed that port 443 is not listening.
And phpmyadmin is not displaying correctly
Magento-2-server-installation/magenx.install.8.sh
Line 1699 in 7b2e9e0
Hi
This repo seems to be interesting. If we do all the setups, will it be already configured for auto scaling or load balancing to handle heavy traffic on the website?
Hi
In Ubuntu (Hetzner) I had to install snap snapd goaccess python3-dev before. Otherwise, I have errors.
In Debian 10 script hangs on php-lz4 (no matter what php I choose). The solution is to add https://packages.sury.org/php/ repository. Next problem is with rabbitMq - it wont work because it needs glibc >= 2.29 and Debian gives only 2.28.
Anyway - great script! :) Thank You for grat work.
Webmin installed using port 17639. When I browse to my url using that port, nothing loads. additionally, if i browse to mydomain.com/status I cannot access kibana
I ran the script and everything is fine up the install portion. When I run install, it fails with the following:
In ResourceConnection.php line 148:
Connection "default" is not defined
This is on a fresh Linode build of Ubuntu 20.04 LTS.
Any idea how I fix it?
Hello.
I has latest MagenX stack on Ubuntu 20. When I upload the images they are correctly displayed in the magento admin. After save and refresh page in admin i see only empty squares.
When i do ls -alh
I see that permissions:
drwxrws---+ 2 php-magento php-magento 4.0K May 27 05:13 .
drwxrws---+ 4 php-magento php-magento 4.0K May 26 14:48 ..
-rwxrwx--- 1 php-magento php-magento 31K May 27 05:13 01_1.jpg
-rwxrwx--- 1 php-magento php-magento 31K May 26 14:47 01.jpg
When I try to get image directly on browser i see 502 error and 13: Permission denied
in the log file.
How I can solve it? Thank you!
Hi, on config step:
awk: fatal: cannot open file /opt/magenx/cfg/.sshport' for reading (No such file or directory) awk: fatal: cannot open file
/opt/magenx/cfg/.sshport' for reading (No such file or directory)
Thank you
[?] Install Redis 6 ? [y/n][n]:n
REPOSITORY INSTALLATION ERROR
$
Can you add script for set up server for VueStoreFront for Magento too?
https://docs.vuestorefront.io/v1/guide/installation/linux-mac.html
Hi. When i try to execute bin/magento sampledata:deploy
I see error: There are no commands defined in the "sampledata" namespace.
Ubuntu 20, latest Magento 2.4.2-p1, clear Magenx installation.
How i can solve that? Thanks!
map $http_user_agent $bad_client
in /etc/nginx/conf_m2/maps.conf
blocks Agents that match Link
, which blocks the LinkedIn in-app browser.
I got this error when I install my theme and try to open the demo import page. In another server and the same Magento version, there was no error.
Ubuntu 20.04
apt-add-repository contrib
Error: 'contrib' invalid
sed: can't read packages/venia-concept/.env: No such file or directory
yarn run v1.22.10
error Command "build" not found.
By default installing nginx v1.14
please add:
--disablerepo=rhel-8-for-x86_64-appstream-rpms
to install nginx script
Trying to generate certs happen this.
[root@server:~]$ certbot-auto renew --cert-name domain name.ext
Skipping bootstrap because certbot-auto is deprecated on this system.
Your system is not supported by certbot-auto anymore.
Certbot cannot be installed.
Please visit https://certbot.eff.org/ to check for other alternatives.
using procedures explained on https://certbot.eff.org/ all is ok
I'm trying to install the full version of Magento, i can remove the following
curl -sO ${MAGENX_MSI_REPO}composer_replace
##replace?
sed -i '/"conflict":/ {
r composer_replace
N
}' composer.json
##replace?
but not sure if this is the correct way.
Hi,
during the last step of the installation I received few errors:
sysctl: cannot stat /proc/sys/net/ipv4/tcp_tw_recycle: No such file or directory
NGINX SETTINGS
sed: can't read /etc/nginx/sites-available/magento2.conf: No such file or directory
sed: can't read /etc/nginx/sites-available/magento2.conf: No such file or directory
sed: can't read /etc/nginx/conf_m2/extra_protect.conf: No such file or directory
PHPMYADMIN INSTALLATION AND CONFIGURATION
Failed to download metadata for repo 'varnishcache_varnish64'
Error: Failed to download metadata for repo 'varnishcache_varnish64'
sed: can't read /etc/phpMyAdmin/config.inc.php: No such file or directory
sed: can't read /etc/nginx/conf_m2/phpmyadmin.conf: No such file or directory
sed: can't read /etc/nginx/conf_m2/phpmyadmin.conf: No such file or directory
I've noticed that the /etc/resolv.conf is cleared by the script (I've checked the file before installation).
When I modified /etc/resolv.conf and run the "> config" step again installation is finished without errors but the site doesn't work , phpmyadmin also doesn't work.
I can't login SSH and SFTP with magento [files owner] credentials.
Thank you
Centos 8.1 minimal
Ubuntu 20, Magento 2.4.2-p1. Trying to install Amasty Jet Theme. Doing:
composer require amasty/jet-theme
bin/magento setup:upgrade
Get error: "Class Magento\MediaGallerySynchronizationApi\Api\SynchronizeFilesInterface does not exist".
Flush cache with /usr/local/bin/cacheflush - and setup:upgrade
- same result.
Remove line "magento/module-media-content-synchronization-api": "*",
from composer.json - no effect.
Any ideas?
Hi,
I have made clean install on ubuntu, everything works perfect untill I want to switch from production to developer mode. I got this error:
1 exception(s):
Exception #0 (Magento\Framework\Exception\FileSystemException): The path "/home/defox/public_html/pub/static/frontend/Magento/luma/pl_PL/requirejs-config.js" is not writable.
I did setup:upgrade & setup:di:compile & setup:static-content:deploy -f & cache:flush and didnt help. I have changed even whole static directory to 777 but no success. When I switch it back to production mode - everything works fine again. So - where is the problem? Is it nginx issue?
Dear Magenx
My config
CPU - 8
RAM - 8
DISK - 150 SSD
I really tried your script 3-4 time for like 5-6hr each time. Multiple time rebuild the VM. Below is the issue.
Everything work till the config.
But when the config comes it goes down hill.
certbot-auto certonly --agree-tos --no-eff-email --email ${MAGE_ADMIN_EMAIL} --webroot -w ${MAGE_WEB_ROOT_PATH}/pub/
It doesn't work. Some challenges have failed error in certbot.
It fails because it points to /home/myshop/public_html/pub/ inplace it must point to /usr/share/nginx/html
certbot-auto certonly --agree-tos --no-eff-email --email ${MAGE_ADMIN_EMAIL} --webroot -w /usr/share/nginx/html
After crossing this step When everything is done. We get the issue of varnish on the frontpage
503 backend fetch failed - guru meditation
Now because of this issue it took be 3 attemp and lastly it was solved how i can't remember.
After that i got another issue. SSL is not working. So we need to change the config files manually and enable listen and ssl lines.
After that we got another issue even if somehow the page loads (LUMA) it doesn't work properly.
I mean CSS/JS files doesn't load properly. i tried deploy flush restart and everything but didn't work !
Finally gave up. Please if possible do check this.
I have tried running this setup on a new CentOS VPS with Digital Ocean 3 different times and have not had success. All installations are successful except for Let's Encrypt. I was able to run these command manually afterward with success. After reviewing the install output I noticed this error: Could not connect to Redis at 127.0.0.1:6380: Connection refused. Additionally, when I try to access my domain with my web browser I get a connection refused error on port 443. When I try to access the server on port 80, I receive this error from the Varnish Cache Server:
Error 503 Backend fetch failed
Backend fetch failed
Guru Meditation
Am I missing something basic? I have followed the instructions exactly.
When you install MAgento it asks for the ElasticSearch credentials and port but they are not automatically populated. The default port of 9200 isn't populated and the username elastic and auto generated password are not either. If you didn't save these from the earlier step, this could trip you up.
I am trying to run this setup on a fresh CentOS machine today. I amno encountering a new error when I run the database command
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Hi
For some reason certbot fails to obtain a certificate
Fresh centos 8 installation.
https://i.imgur.com/vRIDAMF.png
You are not using FastCGI Wrapper with Spawn-FCGI for perl scripts ?
Read that is much better if we use it ?
By executing the command below:
/usr/local/bin/cacheflush
nginx restarts and doesn't work again!
Settings:
AWS EC2
ARM
Ubuntu 20.04
Instace type: m6g.large
I followed the steps to setup magento 2 as bash menu described, I added my domain. Everything is done successfully but at the end I can not reach the site. When I check ngnix acces.log I see that log:
127.0.0.1 - - [15/Sep/2021:17:52:07 +0000] "GET http://localhost/health_check.php HTTP/1.1" 200 434 "-" "-" 0.017 - "18b43c5411b5c63b528e700104367c3d"
127.0.0.1 - - [15/Sep/2021:17:52:12 +0000] "GET http://localhost/health_check.php HTTP/1.1" 200 434 "-" "-" 0.017 - "45a123be32e42e190198a0297a9b566f"
127.0.0.1 - - [15/Sep/2021:17:52:17 +0000] "GET http://localhost/health_check.php HTTP/1.1" 200 434 "-" "-" 0.017 - "8b8e69110a367967460614db6edb7e42"
why I can not reach the website thank you.
How i can enable correct redirect from http to https? Should i add new server directive for that?
Now when i try to access site over http i see error "...by the server unenspectedly drop connection".
Hi, I am trying to setup server on my aws instance and getting below error on the Magento installation step.
Problem 1
- Root composer.json requires magento/composer-root-update-plugin ~1.0 -> satisfiable by magento/composer-root-update-plugin[1.0.0].
- magento/composer-root-update-plugin 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 2
- Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
- dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 3
- laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4] require composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- magento/product-community-edition 2.4.1 requires laminas/laminas-dependency-plugin ^1.0 -> satisfiable by laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4].
- Root composer.json requires magento/product-community-edition 2.4.1 -> satisfiable by magento/product-community-edition[2.4.1].
You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.
Hi,
my Contabo VPS allow installation only Centos 8 Stream but the script not support it.
Will you add support of the Stream?
Thank you
Could not connect to the Amqp Server.
In InstallCommand.php line 274:
Parameter validation failed
even tho rabitmq is running
Listeners
Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: 127.0.0.1, port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0
ubuntu 20, ARM
I noticed that there was a RabbitMQ update recently.
Which has some conflict with your script.
I have a message in my rabbitmq log "Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping unregistration."
Maybe you have some solution to this problem.
I installed several times on centos stream 8, with varnish installed every time I get a 503 error Backend fetch failed, if I don't install varnish then 502 Bad Gateway nginx, the certbot installation also failed because of this, is this a bug or my fault?
Magento-2-server-installation/default.vcl
Line 18 in 40ec178
The default magento configuration adds a couple of extra lines to prevent 503 error. (See below link)
https://github.com/magento/magento2/issues/24353#issuecomment-592038624
sub vcl_recv {
if (req.restarts > 0) {
set req.hash_always_miss = true;
}
I've executed the script until the end of
[-] Post-Install configuration : config
The new Magento 2.4 start with 2FA activated but I can't receive the mail that Magento send when I try to sign in the Admin Backoffice.
The server have not mail services activated to send approval email.
Magento claims Composer 2.0 is incompatible with Magento 2.4.1
The error when running a composer update is:
The "magento/magento-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "dealerdirect/phpcodesniffer-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "laminas/laminas-dependency-plugin" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "magento/composer-root-update-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Problem 1
- Root composer.json requires magento/composer-root-update-plugin ~1.0 -> satisfiable by magento/composer-root-update-plugin[1.0.0].
- magento/composer-root-update-plugin 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 2
- Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
- dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 3
- laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4] require composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- magento/product-community-edition 2.4.1 requires laminas/laminas-dependency-plugin ^1.0 -> satisfiable by laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4].
- Root composer.json requires magento/product-community-edition 2.4.1 -> satisfiable by magento/product-community-edition[2.4.1].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.
When running a composer self-update --1 to downgrade to version 1 the error is:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "self-update" is not defined.
Script installs Composer 2.0.7
Please change line 1410 in magenx.install.8.sh for pm.max_children setting to be updated.
from
sed -i 's/pm.max_children = 50/pm.max_children = 1000/' ${php_fpm_pool}
to
sed -i 's/pm.max_children = 5/pm.max_children = 1000/' ${php_fpm_pool}
Hi,
While installing your stack, all goes well
Letsencrypt registers ssl with the domain name that is inputted
Domain is hosting on cloudflare DNS with "Full" encryption setting on cloudflare
Still no traffic is being directed either to 80 nor 443
What config changes do we need to do in NGINX to solve this issue
Hi,
with version 1.8.240.0 on >magento step (Magento minimal) I receive an error:
[InvalidArgumentException]
Package is not installed: magento/project-community-edition-2.4.0.0
Thank you
During installation I've changed admin username with my own but at 2Fa configuration the script use "admin"
See this:
Magento-2-server-installation/magenx.install.8.sh
Line 1777 in dd22866
Hi,
server settings issue:
[root@server:~]$ wget https://uchmag.com
--2020-08-29 01:51:17-- https://uchmag.com/
Resolving uchmag.com (uchmag.com)... 94.155.47.111
Connecting to uchmag.com (uchmag.com)|94.155.47.111|:443... connected.
GnuTLS: The Diffie-Hellman prime sent by the server is not acceptable (not long enough).
Unable to establish SSL connection.
Can you check why?
I can access this from other servers and I can access others sites.
Hi,
after installing I can't upgrade the server:
[root@server:dev]$ dnf upgrade
varnishcache_varnish64 320 B/s | 833 B 00:02
varnishcache_varnish64-source 436 B/s | 833 B 00:01
Error:
Problem: package varnish-6.4.0-1.el8.x86_64 requires libjemalloc.so.2()(64bit), but none of the providers can be installed
If I'm using "--allowerasing" Varnish is deleted.
"--skip-broken" - doesn't work.
Thank you
I am getting this error in the browser:
This site can’t be reached
www.domain.com refused to connect.
I have followed the instructions to the letter:
I managed to get the script to work earlier before you made the changes to fix the cerbot issue but I can not figure out what is wrong now.
Thanks
Any help would be most appreciated
We want to have a Magenxserver like cPanel server where we can host multiple domains with individual login to utilize the server, so by any chance you have a script to host mutiple domains in Magenx ?
I have added the following line to /etc/rabbitmq/rabbitmq-env.conf file and it was successfully connected.
NODENAME=rabbit@localhost
But, now i am getting "Could not connect to the Amqp Server." error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.