Magento 2 is popular open-source eCommerce software. If you lost admin password for your Magento 2 website, you can follow the instructions below to reset your password.
Find the crypt key from file
app/etc/evn.php
Once you have the key, you can run following SQL command using MySQL command line or phpMyAdmin.
UPDATE admin_user SET password = CONCAT(SHA2('CRYPTO_KEYnewPassword', 256), ':CRYPTO_KEY:1') WHERE username = 'admin';
In the SQL above, replace
CRYPTO_KEY = cyrpt key from your app/etc/evn.php file.
newPassword = replace with new password you need.
When trying to log in to Amazon Lightsail instance, I got the error
Log in failed. If this instance has just started up, try again in a minute or two.
CLIENT_UNAUTHORIZED [769]
This lightsail refused to connect error happens because when you update the system, you replaced the default /etc/ssh/sshd_config file provided by Amazon AWS.
To fix the error, connect to the Lightsail server using SSH (terminal on Linux/Mac, putty on windows), edit the file
If you can’t SSH into the server using putty or a terminal, you need to take a snapshot of the server. Create a new lightsail server based on the snapshot. During the new server creation, you have the option to reset the PEM file. You can also enter a startup script, that gets executed when the server is started the first time.
Use the following startup script
sudo sh -c "cat /var/lib/cloud/instance/user-data.txt | grep ^ssh-rsa > /etc/ssh/lightsail_instance_ca.pub"
sudo sh -c "echo >> /etc/ssh/sshd_config"
sudo sh -c "echo 'TrustedUserCAKeys /etc/ssh/lightsail_instance_ca.pub' >> /etc/ssh/sshd_config"
sudo sh -c "echo 'CASignatureAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa' >> /etc/ssh/sshd_config"
sudo systemctl restart sshd
On a default installation of the Nginx web server, the error pages show the version of Nginx software running on your server. Displaying software version is not good for security and visitors don’t need to know what version of Nginx web server you are using. For hackers, if they know the version, they can see if that particular version of the Nginx web server is vulnerable to any exploit and hack the server if there is an exploit available.
To hide the Nginx version, edit
vi /etc/nginx/nginx.conf
Under “http” section, add
server_tokens off;
Restart Nginx
systemctl restart nginx
After restart, the error page won’t show the Nginx version.
Before
boby@sok-01:~$ curl -I http://serverok.test/
HTTP/1.1 404 Not Found
Server: nginx/1.18.0 (Ubuntu)
Date: Sun, 14 Nov 2021 06:11:24 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
boby@sok-01:~$
After
boby@sok-01:~$ curl -I http://serverok.test/
HTTP/1.1 404 Not Found
Server: nginx
Date: Sun, 14 Nov 2021 06:20:54 GMT
Content-Type: text/html
Content-Length: 146
Connection: keep-alive
When using Cloudflare CDN, visitors come to the Cloudflare server and Cloudflare fetches pages from your server and sent to the visitor. Your server only sees Cloudflare’s IP address. To fix this, we can use the Apache module remoteip.
On Ubuntu (or Debian) server running Plesk control panel with Apache webserver (no Nginx) do the following to restore real visitor IP address when using Cloudflare CDN.
To remove CDN, you can delete the entries related stackpathdns with SQL command
delete from core_config_data where path = 'web/unsecure/base_static_url';
delete from core_config_data where path = 'web/unsecure/base_media_url';
delete from core_config_data where path = 'web/secure/base_static_url';
delete from core_config_data where path = 'web/secure/base_media_url';
You need to install the memcached daemon and PHP module on the server before you can configure it in PrestaSop. You can find instructions for doing this in
Jenkins is an open source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery.
Jenkins is a Java Application. So you need to install JRE (Java Runtime Environment). Install it with
sudo apt-get install default-jre
You can find instructions for installing Jenkins on Debian/Ubuntu at