Fix wordrpess permalink not working issue in Linux OS – Install mod_rewrite module on server

Step 1: Use below comment to install 
sudo a2enmod rewrite

Step 2: After successful install, restart the apache using below comment.
service apache2 restart
or
sudo /etc/init.d/apache2 restart

Step 3: Check the site to confirm 404 error fixed or not.

Step 4: To fix the issue, go to “/etc/apache2/apache2.conf ” and edit apache2.conf using below comment.
vi apache2.conf

Step 5:  Replace the “AllowOverride None” with “AllowOverride All”. So, it will be look like below image.

Step 6: Use “Esc” and type  “:wq” comment to save and quit after completed the changes.

Step 7: Reload apache using below comment.
apache2 reload

OR

systemctl restart apache2

Step 8: I hope your issue fixed now.

Step 9: Still you have the issue! Please follow the below reference image instruction. I hope, this is more helpful for you. (Click below image to view)

Port Forwarding – Binatone port forward settings – Access local xampp using static IP

Step 1: Open your system comment and type “ipconfig”.

Step 2: Check your system “Default Gateway” and “IPv4 Address” using comment “ipconfig” as like below image.

Step 3: Open your router settings page using Default Gateway. As per my case, use “192.168.1.1” in browser to access the settings page.

Step 4: Go to Port Forwarding settings page and forward the required post to your system. We could use the port based on your need.

Step 5: I need to post the 80, Because I need to access the xampp from remote or through internet. So, my local system xampp running under  port 80.

Step 6: Also, Port Forwarding settings will change based on router. As per my case please find the below image.

Binatone port forward settings
Go to -> Advanced -> NTA -> Virtual Server and follow below settings.

Step 7: All settings DONE. Now testing, Check your system IP. Just type “What is my IP” in Google.

Step 8: For example your IP is 77.777.77.88. While I access through 77.777.77.88:80 OR 77.777.77.88, it will post to local system xampp.

Database export Error – Input variables exceeded in phpmyadmin

Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini.

Step1:  xampp -> open php folder and select ‘php.ini’  file

Step2:  find this lines  ‘;max_input_vars = 1000‘  

Step3:  Remove the semi-colon 

like the  ‘max_input_vars = 1000‘  

Step4:  and Update the value 1000 to 10000

Step5: Update the file size 

Step6: Restart Your xampp server

 

 

Update client_max_body_size value in NGINX SERVER

   1. Login to SSH through putty as root user.

   2. Redirect to site nginx config file as like below. 
          cd etc/nginx/conf.d/

   3. List all domain config file in above folder using below comment.
          ls -a

   4. Edit respective domain config file using below comment
          vi domain.com.conf

   5. Use “i” letter in windows to change the comment view files into edit mode. To know more about file edit
 
    6. Add below line if its not exist in the config file. OR update values based on your need. 
         client_max_body_size 500m;

    7. Finally restart Nginx using below comments.
          service nginx reload
 
    8. DONE.

Nginx server settings update for memory limit

  1. Update Memory limit in Ngnix server 

    1. Login to SSH through putty

    2. Redirect to PHP config file as like below.
     cd /etc/php-fpm.d   

     3. List all files from  “php-fpm.d”    directory using below comment
         ls -a

    4. Edit respective domain config file using below comment
         vi domainname.conf

    5. Use “i” letter in windows to change the comment view files into edit mode.

    6. Add below line if its not exist in the config file. OR update values based on your need.
          php_admin_value[memory_limit] = 500M
          php_admin_value[post_max_size] = 500M should be larger than upload_max_filesize and smaller than memory_limit.
          php_admin_value[upload_max_filesize] = 450M    (Important: This value should be low compare to other value)
          php_admin_value[max_input_time] = 3000
          php_admin_value[max_execution_time] = 3000

    7. user “Esc” and type “:wq” to save and quit. Also, please refer more file edit comment options below.
         vi filename — Edit file
         i to insert
         a to append
         x to delete
         dd to delete a line
         : to begin a command sequence
         :w to save
         :q to quit
         :q! to quit without saving
         :wq to save and quit

    8. Finally restart the PHP using below comments.

          In order to restart php-fpm, the correct command is
    # systemctl restart php-fpm

          To check the state of php-fpm following a restart you can         run:
    # systemctl status php-fpm

  2.   Still its not working! Please follow this post to increase  client_max_body_size value.

How to Disable directory Listing Directory browsing in apache Web Server

  1. Go to “/etc/apache2/apache2.conf”
  2. Change the following code 
    <Directory /var/www/>
     Options Indexes FollowSymLinks
     AllowOverride None
     Require all granted
    </Directory>

    Change above code as like below. Removed Indexes from first line.

    <Directory /var/www/>
    Options FollowSymLinks
    AllowOverride None
    Require all granted
    </Directory>

    Please follow the below video instruction:

  3. Restart Apache 2 web server, enter:

    # /etc/init.d/apache2 restart
    OR
    $ sudo /etc/init.d/apache2 restart
    OR
    $ sudo service apache2 restart

Update Cron file in Magento and Server

Update Cron file in Magento and Server:

1. Setting up the Magento cronjob using shell access

It is strongly recommended not to run the cronjob under the

crontab -e
root/superuser account. If you are logged in as root, please switch (su) to a non-privileged account.
Before setting up a new cronjob, please make sure the Magento cronjob (a cron running cron.php) hasn’t been set up yet. Use the following command to get the currently installed cronjobs:

If the cronjob hasn’t been set up yet, you will need to open the crontab file to set up the cronjob. The crontab manages which and when cronjobs are run on the server.

crontab -l

Now, go to the end of the last line in the cron tab file and press enter to create a new line.

Enter the following line and replace YOURDOMAIN.com and PATH_TO_MAGENTO with the URL of the root directory of your Magento installation:

*/5 * * * * wget -O /dev/null -q http://www.YOURDOMAIN.com/PATH_TO_MAGENTO/cron.php > /dev/null
 
OR
 
*/5 * * * * /bin/php /var/www/vhosts/YOURDOMAIN/htdocs/cron.php > /dev/null
 
OR
 
*/5 * * * * wget -O /dev/null -q /var/www/vhosts/YOURDOMAIN/htdocs/cron.php > /dev/null
 
OR
 
*/5 * * * * /bin/php -q /var/www/vhosts/YOURDOMAIN/htdocs/cron.php   (Its working for us)

 

It is very important that the cron.php file of Magento gets executed every five minutes. Do not change this to a longer interval.

Please try to call the URL you’ve entered into the cron tab using your browser. A blank page should be returned. If the page can’t be found (404), that means the URL to the cronjob manager of Magento (cron.php) is wrong. This means the cron job won’t execute and hasn’t been set up properly. It is really important you enter the correct URL – it is always the URL to the cron.php file sitting inside the root directory of your Magento installation.

Save the cron tab using CTRL+X, enter y to save the changes and press enter. The following message should be displayed:

crontab: installing new crontab

 

 

Nginx Server Comments Putty Comment

nginx server comments: putty comment :

https://varvy.com/pagespeed/cache-control.html
i to insert
a to append
x to delete
dd to delete a line
: to begin a command sequence
:w to save
:q to quit
:q! to quit without saving
:wq to save and quit

Unstall / install webmin
Sudo apt-get install webmin
Sudo apt-get purge webmin

Unzip Comment
unzip file.zip

Use the following syntax if you want to extract/unzip to a particular destination directory:
unzip -d /dest/directory/ file.zip

Install unzip on Debian/Ubuntu Linux
sudo apt-get install unzip
OR
sudo apt install unzip

Copy the file and Save it in different name. Backup the files using below comment.
How to perform basic copy operation?
cp file1 ~/Desktop

How to make cp prompt before overwriting?
cp -i file1 ~/Desktop/

How to force cp to not overwrite existing file?
cp -n file1 ~/Desktop/

 

Windows server web.config file to redirect all URLS into HTTPS

Used below code to redirect all URLs into HTTPS in windows server using web.config file.

 

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite> 
<rules>
 
 
<rule name="Force HTTPS" enabled="true" stopProcessing="true">>
<match url="(.*)" /> 
<conditions logicalGrouping="MatchAll">
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
<add input="{REQUEST_URI}" pattern="^(.*)/ccadmin(.*)" ignoreCase="true" negate="true" /> 
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
 
 
 
<rule name="Remove index.php Rule" stopProcessing="true"> 
<match url=".*" ignoreCase="false" /> 
<conditions> 
<add input="{URL}" pattern="^/(media|skin|js)/" ignoreCase="false" negate="true" /> 
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> 
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> 
</conditions> 
<action type="Rewrite" url="index.php" /> 
</rule>
 
 
 
</rules>
</rewrite>
</system.webServer>
<system.net>
<mailSettings>
<smtp>
<network host="localhost" />
</smtp>
</mailSettings>
</system.net>
</configuration>

Only below code worked for HTTPS redirection:

<rule name="Force HTTPS" enabled="true" stopProcessing="true">>
<match url="(.*)" /> 
<conditions logicalGrouping="MatchAll">
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
<add input="{REQUEST_URI}" pattern="^(.*)/admin(.*)" ignoreCase="true" negate="true" />  <!-- Restrict the admin URLS from HTTPS redirection -->
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>

 

 

Used below code to restrict particular URL from HTTPS redirection based on URL slug.

From the above code “MatchAll” value allow to work the HTTPS redirection once all the condition success within the <conditions> tag

logicalGrouping="MatchAll"

 

So, I have added two conditions like below within <conditions> tag.

  1. Check the loading URL is HTTPS or Not
  2. Check the loading URL slug
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
<add input="{REQUEST_URI}" pattern="^(.*)/admin(.*)" ignoreCase="true" negate="true" />  <!-- Restrict the admin URLS from HTTPS redirection -->

 

So, above code restrict the admin URL from HTTPS redirection.