Posts

Showing posts from May, 2020

How to redirect to a different domain using NGINX?

server { server_name .mydomain.com; return 301 http://www.adifferentdomain.com$request_uri; }

Could not read from socket: ECONNRESET - Connection reset by peer

firewall issue open port  21, 12000-12100 make sure open all port 21 and range port

Install Multiple PHP Versions on Ubuntu

Install PHP 5.6 Step 1: Update Apt-Get As always, we update and upgrade our package manager before beginning installation. If you are currently running PHP 7.X, after updating apt-get, continue to step 2 to downgrade to PHP 5.6. apt-get update && apt-get upgrade Step 2: Install PHP 5.6 Install the PHP5.6 repository with these two commands. apt-get install -y software-properties-common add-apt-repository ppa:ondrej/php apt-get update apt-get install -y php5.6 PHP Version for Apache Step 3: Switch PHP 7.0 to PHP 5.6 Switch from PHP 7.0 to PHP 5.6 while restarting Apache to recognize the change: a2dismod php7.0 ; a2enmod php5.6 ; service apache2 restart   Note Optionally you can switch back to PHP 7.0 with the following command: a2dismod php5.6 ; a2enmod php7.0 ; service apache2 restart   Now, let’s verify that PHP 5.6 is running on Apache by creating a PHP info page. To do so, insert the code below into a file named  phpinfo.php and upload it to the  /var/www/html  directory. <

Connect AWS RDS MySQL instance with phpMyAdmin

Follow below steps to configure: Step 1: Install Apache Web Server sudo apt-get update -y sudo apt-get install apache2 -y sudo systemctl start apache2.service Verify that Apache was installed without errors by accessing it from your local browser. Enter  http://SERVER_IP/ Step 2: Install PHP sudo apt-get install php -y sudo apt-get install -y php-{bcmath,bz2,intl,gd,mbstring,mcrypt,mysql,zip}  sudo apt-get install libapache2-mod-php  -y Step 3: Restart Apache systemctl restart apache2.service Step 4: Install and configure phpMyAdmin cd /var/www/html/ Download phpMyAdmin from an authorized website using wget command wget https://files.phpmyadmin.net/phpMyAdmin/4.7.3/phpMyAdmin-4.7.3-all-languages.zip Unzip phpMyAdmin unzip phpMyAdmin-4.7.3-all-languages.zip Rename phpMyAdmin and go to phpMyAdmin folder mv phpMyAdmin-4.7.3-all-languages phpmyadmin cd phpmyadmin Edit the configuration file for phpMyAdmin. vim config.sample.inc.php Below is a default file /* Server parameters */  $cfg['

[Ubuntu]Apache says “Forbidden You don’t have permission to access this resource.” to a specific domain

Open the apache2.conf file using the nano editor. sudo nano /etc/apache2/apache2.conf Replace the general directory settings with this. <Directory /> #Options FollowSymLinks Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order deny,allow Require all granted </Directory> <Directory /usr/share> AllowOverride None Require all granted </Directory> <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> #<Directory /srv/> # Options Indexes FollowSymLinks # AllowOverride None # Require all granted #</Directory> Ensure your virtual host configuration file in  /etc/apache2/sites-available  directory is in this manner <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port t$ # the server uses to identify itself. This is used when creating # redirection URLs. In

apache config with ssl

<VirtualHost *:80>     ServerName tcprod.sweetberries.net     ServerAlias *.tcprod.sweetberries.net tcprod.sweetberries.net     DocumentRoot /home/devops/toolbox/prod/master     ErrorLog /var/www/error.log     CustomLog /var/www/requests.log combined </VirtualHost> <VirtualHost *:443>     ServerName tcprod.sweetberries.net     ServerAlias *.tcprod.sweetberries.net tcprod.sweetberries.net     DocumentRoot /home/devops/toolbox/prod/master     ErrorLog /var/www/error.log     CustomLog /var/www/requests.log combined     SSLEngine on SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key </VirtualHost> /etc/httpd/sites-enabled /etc/httpd/conf/httpd.conf IncludeOptional conf.d/*.conf IncludeOptional sites-enabled/*.conf Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration Simply: This error likely happens on apache if your "virtual host" is trying to us

bitnami

I understand you want to move your Magento files to a new bigger disk you attached to your instance. In that case, you can use a symlink and move all the content to a new location. Stop all services /opt/bitnami/ctlscript.sh stop Move the whole Bitnami installation mv /opt/bitnami < your_new_disk > Place a symlink ln -ls <bitnami_folder_ in _your_new_disk> /opt/bitnami Restart all services /opt/bitnami/ctlscript.sh start /opt/ bitnami / apache2 / logs /error_log sudo /opt/ bitnami /ctlscript.sh  restart apache wordfence It seems as if some file paths changed in the move from one host to the other. In the future, to avoid this issue, it is important to use the ‘ Remove Extended Protection ‘ option in (Wordfence > Firewall > All Firewall Options underneath Protection Level) before migrating hosts. In this case, you will need to delete references to wordfence-waf in the .htaccess, .user.ini, and/or php.ini files. You can search these files for “wordfence-

How to Install Angular on Ubuntu

Step 1 – Install Node.js First of all, you need to install node.js on your system. If you don’t have node.js installed use the following set of commands to add node.js PPA in your Ubuntu system and install it. sudo apt install python-software-properties curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt install nodejs Make sure you have successfully installed node.js and NPM on your system node --version npm --version Step 2 – Install Angular/CLI After installation of node.js and npm on your system, use following commands to install Angular cli tool on your system. npm install -g @angular/cli The latest version of Angular CLI will be installed on your Ubuntu Linux system. You may require older Angular version on your machine. To install specific  Angular version  run command as following with version number. npm install -g @angular/cli@ 6 #Angular 6 npm install -g @angular/cli@ 7 #Angular 7 npm install -g @angular/cli@ 8 #Angular 8 npm install -g

413 Request Entity Too Large using CodeIgniter

It looks like the error is coming not from PHP but from a web server. If you're using  nginx , you could up the max allowed post size with  client_max_body_size  directive server { ... client_max_body_size 128m ... } If you're using Apache, then there are a couple of options to check for in its config file (httpd.conf). LimitRequestBody 131072000 If mod_security module is used in Apache, update limit for it as well: SecRequestBodyLimit 131072000 Don't forget to restart the server.

PHP memory limit and upload limit

To increase the PHP memory limit and upload limit, change these lines in PHP.ini memory_limit = 256M upload_max_filesize = 12M post_max_size = 13M file_uploads = On max_execution_time = 180