Magento admin css and js not loading after trying to change path of the admin url

Magento admin css and js not loading after trying to change path of the admin url. These type of problem comes when we trying to use custom url for admin or trying to change backend url from CLI. Here are some steps to resolve this issue. Login it to phpmyadmin or any other tool that let you access for database and select database that you use for your magento. 1) Find and remove all entries with path like ‘admin/url/custom’ in core_config_data table. SELECT * FROM `core_config_data` where 'admin/url/custom'; If any entries exist run below mentioned query. DELETE FROM `core_config_data` where 'admin/url/custom'; 2) After that find value with with below mentioned query. SELECT * FROM `core_config_data` where scope='stores' and scope_id=0 and path ='web/secure/base_url'; If any entries exist run below mentioned query. DELETE FROM `core_config_data` where scope='stores' and scope_id=0 and path ='web/secure/base_url'; And SELECT * FROM `core_config_data` where scope='stores' and scope_id=0 and path ='web/unsecure/base_url'; If any entries exist run below mentioned query. DELETE FROM `core_config_data` where scope='stores' and scope_id=0 and path ='web/unsecure/base_url'; 3) Now set value 0 for path admin/url/use_custom SELECT * FROM `core_config_data` where path='admin/url/use_custom'; If any entries exist and value is not 0 then run below mentioned query. UPDATE `core_config_data` set value=0 where path='admin/url/use_custom'; 4) Check Magento_Root/etc/env.php and look for below mentioned line here ‘admin’ is your admin url so ‘www.example.com/admin’ is your admin url now you can change this value to and use updated with with new admin path. 'backend' => [ 'frontName' => 'admin' ], 5) clean cache from CLI by running below mentioned command. And hurrah! you are all...

Install patches in magento 2

There is two bellow mentioned types of patches provided in Magento 2 1) Composer Patch2) Git Patch Composer Patch: This patch implies that your all defual magento modules are in “vendor” folder. If yes then you need to download the composer patch and place inside “vendor” folder ie. (MAGENTO_ROOT/vendor). Then open terminal connect server with ssh change directory to “MAGENTO_ROOT/vendor” and user bellow mentioned command git apply patchname.patch Git Patch: This patch implies that your all defual magento modules are in “app/code” folder. If yes then you need to download the git patch and place inside “app” folder ie. (MAGENTO_ROOT/app). Then open terminal connect server with ssh change directory to “MAGENTO_ROOT/app” and user bellow mentioned command git apply...

Get admin details Magento 2

To get magento admin details programatically you need to add below mentioned code in your class. protected $_authSession; public function __construct( ... \Magento\Backend\Model\Auth\Session $authSession, ... ) { ... $this->_authSession = $authSession; ... } public function getAdminUser(){ $user = $this->_authSession->getUser(); //You will get below mentioned admin information. $user->getUserId(); $user->getFirstname(); $user->getLastname(); $user->getEmail(); $user->getUsername(); $user->getPassword(); $user->getCreated(); $user->getModified(); $user->getLogdate(); $user->getLognum(); $user->getReloadAclFlag(); $user->getIsActive(); $user->getExtra(); $user->getRpToken(); $user->getRpTokenCreatedAt(); $user->getInterfaceLocale(); $user->getFailuresNum(); $user->getFirstFailure(); $user->getLockExpires();...
Upgrade magento 2 to latest version

Upgrade magento 2 to latest version

Upgrade magento 2 to latest version Note : Before running upgrade should have to take database and file backup. To upgrade magento 2 from UI you have to follow below mentioned document. http://devdocs.magento.com/guides/v2.0/comp-mgr/upgrader/upgrade-start.html To upgrade magento 2 with composer or command line or SSH use below mentioned command. First of all you you need to update composer. composer update After that check magento version if version is still same use below mentioned command. You have to update magento installer first so apply below mentioned command. composer require magento/magento-composer-installer composer require magento/product-community-edition '2.0.*' --no-update Now you have to run composer update command so it will upgrade php dependency and latest magento packages. composer update Now after done with upgrading all magento and php packages you have to run run below command to make sure that all database base updates are done. php bin/magento setup:upgrade Enjoy your magento 2 should upgraded in latest magento...
Install ClamAV and Scan Viruses with ClamAV

Install ClamAV and Scan Viruses with ClamAV

Installing ClamAV in UBUNTU sudo apt-get install clamav After installation you have to update ClamAV sudo freshclam For scan viruses you have to use below mentioned command. clamscan OPTIONS File/Folder Below mentioned command will check all files in root and displaying the name of each file: clamscan -r / Below mentioned command will check all files in root but only display infected files and ring a bell when found: clamscan -r --bell -i / Below mentioned command will check all files in root but only display infected files when found and have this run in the background: clamscan -r -i / & Below mentioned command will check files in the all users home directories: clamscan -r /home Below mentioned command will check files in the USER home directory and move infected files to another folder: clamscan -r --move=/home/USER/VIRUS /home/USER Below mentioned command will check files in the USER home directory and remove infected files (WARNING: Files are gone.): clamscan -r --remove /home/USER To see all available help options: clamscan --help Note: To see running background process use below mentioned command....
Install ftp on Amazon Ec2

Install ftp on Amazon Ec2

Install ftp on Amanzon Ec2 You can install ftp to your Amazon ec2 instance and able to provide access to other developer to work parallel on same in instance. sudo apt-get install proftpd Configration of ftp sudo vi /etc/proftpd/proftpd.conf Add passive port range PassivePorts 1024 1048 Add public ip MasqueradeAddress 1.1.1.1 Full configration file # # /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file. # To really apply changes reload proftpd after modifications. # # Includes DSO modules Include /etc/proftpd/modules.conf # Set off to disable IPv6 support which is annoying on IPv4 only boxes. UseIPv6 off # If set on you can experience a longer connection delay in many cases. IdentLookups off ServerName "Debian" ServerType standalone DeferWelcome off MultilineRFC2228 on DefaultServer on ShowSymlinks on TimeoutNoTransfer 600 TimeoutStalled 600 TimeoutIdle 1200 DisplayLogin welcome.msg DisplayChdir .message true ListOptions "-l" DenyFilter *.*/ # Use this to jail all users in their homes DefaultRoot ~ # Users require a valid shell listed in /etc/shells to login. # Use this directive to release that constrain. RequireValidShell on # Port 21 is the standard FTP port. Port 21 # In some cases you have to specify passive ports range to by-pass # firewall limitations. Ephemeral ports can be used for that, but # feel free to use a more narrow range. PassivePorts 1024 1048 # If your host was NATted, this option is useful in order to # allow passive tranfers to work. You have to use your public # address and opening the passive ports used on your firewall as well. MasqueradeAddress 174.129.218.53 # This is useful for masquerading address with dynamic IPs:...