{"id":7390,"date":"2020-11-24T03:24:24","date_gmt":"2020-11-24T03:24:24","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=7390"},"modified":"2020-11-24T14:46:13","modified_gmt":"2020-11-24T14:46:13","slug":"install-magento-2-4-0-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2020\/11\/24\/install-magento-2-4-0-on-ubuntu-18-04\/","title":{"rendered":"Install Magento 2.4.0 on Ubuntu 18.04"},"content":{"rendered":"<p>Ref: https:\/\/www.rosehosting.com\/blog\/how-to-install-magento-2-4-with-lemp-stack-on-ubuntu-20-04\/<\/p>\n<p>Requirements: PHP7.4, Nginx\/Apache2, MySQL, ElasticSearch<\/p>\n<p>CHECK PHP VERSION. IF NOT PHP7.4, INSTALL\/CHANGE IT TO 7.4<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ php -v\r\nPHP Warning:  Module 'curl' already loaded in Unknown on line 0\r\nPHP 7.2.33-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Aug  7 2020 14:44:29) ( NTS )\r\nCopyright (c) 1997-2018 The PHP Group\r\nZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies\r\n    with Zend OPcache v7.2.33-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies\r\n    with blackfire v1.34.3~linux-x64-non_zts72, https:\/\/blackfire.io, by Blackfire<\/pre>\n<p>FIND OUT IF THERE IS PHP7.4 INSTALLED OR NOT<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo update-alternatives --config php\r\nThere are 5 choices for the alternative php (providing \/usr\/bin\/php).\r\n\r\n  Selection    Path             Priority   Status\r\n------------------------------------------------------------\r\n  0            \/usr\/bin\/php7.3   73        auto mode\r\n  1            \/usr\/bin\/php5.6   56        manual mode\r\n  2            \/usr\/bin\/php7.0   70        manual mode\r\n  3            \/usr\/bin\/php7.1   71        manual mode\r\n* 4            \/usr\/bin\/php7.2   72        manual mode\r\n  5            \/usr\/bin\/php7.3   73        manual mode\r\n\r\nPress &lt;enter&gt; to keep the current choice[*], or type selection number:<\/pre>\n<p>IT SEEMS I HAVEN&#8217;T INSTALLED PHP7.4 YET (BUT I FOUND IT ON \/etc\/php\/7.4). IT MEANS IT ALREADY INSTALLED BUT IT DIDN&#8217;T HAVE THE OTHERS MODULES (PHP-FPM, ETC). SO INSTALL THEM<\/p>\n<pre class=\"lang:default decode:true\">sudo apt-get install php7.4-common php7.4-mysql php7.4-curl php7.4-cgi php7.4-mbstring php7.4-zip php7.4-fpm php7.4-xml php7.4-xmlrpc php7.4-xdebug php7.4-intl php7.4-gmp php7.4-gd php7.4-bcmath php-soap<\/pre>\n<p>NOTE: I HAVE TO INSTALL THEM VIA TELKOMSEL FLASH BECAUSE INDIHOME CAN&#8217;T INSTALL THEM!<br \/>\nCHECK AGAIN THE AVAILABLE PHP AND MAKE SURE PHP7.4 IS INSTALLED THEN SELECT IT<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo update-alternatives --config php\r\n[sudo] password for teddy: \r\nThere are 6 choices for the alternative php (providing \/usr\/bin\/php).\r\n\r\n  Selection    Path             Priority   Status\r\n------------------------------------------------------------\r\n  0            \/usr\/bin\/php7.4   74        auto mode\r\n  1            \/usr\/bin\/php5.6   56        manual mode\r\n  2            \/usr\/bin\/php7.0   70        manual mode\r\n  3            \/usr\/bin\/php7.1   71        manual mode\r\n* 4            \/usr\/bin\/php7.2   72        manual mode\r\n  5            \/usr\/bin\/php7.3   73        manual mode\r\n  6            \/usr\/bin\/php7.4   74        manual mode\r\n\r\nPress &lt;enter&gt; to keep the current choice[*], or type selection number: 6\r\nupdate-alternatives: using \/usr\/bin\/php7.4 to provide \/usr\/bin\/php (php) in manual mode<\/pre>\n<p>NOW<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ php -v\r\nPHP 7.4.12 (cli) (built: Oct 31 2020 17:04:09) ( NTS )\r\nCopyright (c) The PHP Group\r\nZend Engine v3.4.0, Copyright (c) Zend Technologies\r\n    with Zend OPcache v7.4.12, Copyright (c), by Zend Technologies\r\n    with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans<\/pre>\n<p>THEN CHANGE PHP7.4-FPM SETTING:<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/php\/7.4\/fpm\/php.ini<\/pre>\n<p>CHANGE THE CONTENT:<\/p>\n<pre class=\"lang:default decode:true\">cgi.fix_pathinfo=0\r\nupload_max_filesize = 2000M -&gt; (default 2M) \r\nmax_file_uploads = 2000 -&gt; (default 20) \r\npost_max_size = 2000M -&gt; (default 8M) \r\nmax_execution_time = 6000 -&gt; (default 30) in second \r\nmax_input_time = 600 -&gt; (default 60) in second \r\nmemory_limit = 2560M -&gt; (default 128M)<\/pre>\n<p>THEN RESTART PHP7.4-FPM SERVICE:<\/p>\n<pre class=\"lang:default decode:true\">sudo systemctl restart php7.4-fpm<\/pre>\n<p>CHECK NGINX SYNTAX: sudo nginx -t<br \/>\nRESTART NGINX: sudo systemctl restart nginx<br \/>\nOPEN IT: http:\/\/localhost\/phpinfo.php (NEED TO CLEAR THE BROWSER CACHE FIRST)<br \/>\nIF YOU CAN&#8217;T OPEN http:\/\/localhost\/phpinfo.php PROPERLY, PLS MAKE SURE THE NGINX CONFIGURATION FILE IS CORRECT<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo gedit \/etc\/nginx\/sites-available\/default<\/pre>\n<p>MAKE SURE THE &#8216;DEFAULT&#8217; PORT IS 80 NOT 8080 AND THE PHP-FPM POINT TO PHP7.4<\/p>\n<pre class=\"lang:default decode:true\"># Default server configuration\r\n#\r\nserver {\r\n\tlisten 80 default_server;\r\n\tlisten [::]:80 default_server;\r\n\r\n\t...\r\n\r\n\troot \/var\/www\/html;\r\n\r\n\t# Add index.php to the list if you are using PHP\r\n\tindex index.html index.htm index.nginx-debian.html;\r\n\r\n\tserver_name _;\r\n\r\n\tlocation \/ {\r\n\t\t# First attempt to serve request as file, then\r\n\t\t# as directory, then fall back to displaying a 404.\r\n\t\ttry_files $uri $uri\/ =404;\r\n\t}\r\n\r\n\t# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\r\n\t#\r\n\tlocation ~ \\.php$ {\r\n\t\tinclude snippets\/fastcgi-php.conf;\r\n\t#\r\n\t#\t# With php7.0-cgi alone:\r\n\t#\tfastcgi_pass 127.0.0.1:9000;\r\n\t#\t# With php7.0-fpm:\r\n\t\tfastcgi_pass unix:\/run\/php\/php7.4-fpm.sock; #USE PHP7.4-FPM\r\n\t#\tfastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\r\n\t#\tfastcgi_pass unix:\/run\/php\/php7.2-fpm.sock;\r\n\t#\tfastcgi_pass unix:\/run\/php\/php7.0-fpm.sock;\r\n\t#\tfastcgi_pass unix:\/run\/php\/php5.6-fpm.sock;\r\n\t}\r\n\r\n\t# deny access to .htaccess files, if Apache's document root\r\n\t# concurs with nginx's one\r\n\t#\r\n\tlocation ~ \/\\.ht {\r\n\t\tdeny all;\r\n\t}\r\n}<\/pre>\n<p>OKAY. DON&#8217;T FORGET TO RESTART NGINX SERVICE<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo systemctl restart nginx<\/pre>\n<p>THE CURRENT PHP VERSION FOR FPM IS 7.4.12<\/p>\n<p>CHECK STATUS ELASTICSEARCH<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo systemctl status elasticsearch<\/pre>\n<p>IF IT&#8217;S NOT ACTIVE OR DISABLED, THE START THE SERVICE<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~$ sudo systemctl start elasticsearch<\/pre>\n<p>THEN CHECK THE ELASTICSEARCH VERSION BY OPENING THE PORT 9200 ON THE BROWSER: http:\/\/localhost:9200\/<br \/>\nHERE IS THE FINE RESULT<\/p>\n<pre class=\"lang:default decode:true \">{\r\n  \"name\" : \"teddy\",\r\n  \"cluster_name\" : \"elasticsearch\",\r\n  \"cluster_uuid\" : \"naHr_JQ-RaK7dDx1CAdiDw\",\r\n  \"version\" : {\r\n    \"number\" : \"7.8.0\",\r\n    \"build_flavor\" : \"default\",\r\n    \"build_type\" : \"deb\",\r\n    \"build_hash\" : \"757314695644ea9a1dc2fecd26d1a43856725e65\",\r\n    \"build_date\" : \"2020-06-14T19:35:50.234439Z\",\r\n    \"build_snapshot\" : false,\r\n    \"lucene_version\" : \"8.5.1\",\r\n    \"minimum_wire_compatibility_version\" : \"6.8.0\",\r\n    \"minimum_index_compatibility_version\" : \"6.0.0-beta1\"\r\n  },\r\n  \"tagline\" : \"You Know, for Search\"\r\n}<\/pre>\n<p>INSTALL MAGENTO 2.4 VIA COMMAND LINE &#8212; AVOID THIS BECAUSE SOMEHOW I GOT THE &#8216;DEV&#8217; VERSION NOT STABLE VERSION. SO IT&#8217;D BE BETTER TO DOWNLOAD THE ARCHIVE HERE https:\/\/magento.com\/tech-resources\/download<br \/>\nCREATE A NEW DIR &#8216;magento24&#8217; THEN USE GIT CLONE TO GET THE MAGENTO CODE (NOTE: IT TOOK A WHILE)<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy:~$ cd Documents\/works\/magento24\/\r\n\r\nteddy@teddy:~\/Documents\/works\/magento24$ git clone https:\/\/github.com\/magento\/magento2.git \/home\/teddy\/Documents\/works\/magento24\/<\/pre>\n<p>RUN &#8216;composer install&#8217;<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/magento24$ composer install<\/pre>\n<p>BUT I GOT THIS ERROR<\/p>\n<pre class=\"lang:default decode:true \">Problem 1\r\n    - The requested PHP extension ext-soap * is missing from your system. Install or enable PHP's soap extension.\r\n  Problem 2\r\n    - Installation request for laminas\/laminas-soap 2.8.0 -&gt; satisfiable by laminas\/laminas-soap[2.8.0].\r\n    - laminas\/laminas-soap 2.8.0 requires ext-soap * -&gt; the requested PHP extension soap is missing from your system.<\/pre>\n<p>IT SEEMED I FORGOT TO INSTALL php-soap (THERE IS NO php7.4-soap). INSTALL IT<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/magento24$ sudo apt-get install php-soap<\/pre>\n<p>THEN ENABLE IT IN &#8216;\/etc\/php\/7.4\/cli\/php.ini&#8217; AND &#8216;\/etc\/php\/7.4\/fpm\/php.ini&#8217;. FOR EXAMPLE<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/magento24$ sudo gedit \/etc\/php\/7.4\/cli\/php.ini<\/pre>\n<p>THEN UNCOMMENT<\/p>\n<pre class=\"lang:default decode:true\">extension=soap<\/pre>\n<p>DON&#8217;T FORGET TO RESTART NGINX<br \/>\nCHECK IT<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy:~\/Documents\/works\/magento24$ php -i | grep -i soap\r\nPHP Warning:  Module 'soap' already loaded in Unknown on line 0\r\n\/etc\/php\/7.4\/cli\/conf.d\/20-soap.ini,\r\nsoap\r\nSoap Client =&gt; enabled\r\nSoap Server =&gt; enabled\r\nsoap.wsdl_cache =&gt; 1 =&gt; 1\r\nsoap.wsdl_cache_dir =&gt; \/tmp =&gt; \/tmp\r\nsoap.wsdl_cache_enabled =&gt; 1 =&gt; 1\r\nsoap.wsdl_cache_limit =&gt; 5 =&gt; 5\r\nsoap.wsdl_cache_ttl =&gt; 86400 =&gt; 86400<\/pre>\n<p>ALSO CHECK IT ON http:\/\/localhost\/phpinfo.php<br \/>\nIF EVERYTHING ALRIGHT, RERUN &#8216;composer install&#8217;<br \/>\nIF EVERYTHING ALRIGHT, THEN CREATE A NEW DATABASE &#8216;magento24&#8217; WITH COLLATION &#8216;utf8mb4_unicode_520_ci&#8217; THEN RUN THIS:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/magento24$ php bin\/magento setup:install --base-url=http:\/\/magento24.test\/ --db-host=localhost --db-name=magento24 --db-user=root --db-password=teddy --admin-firstname=Satria --admin-lastname=Faestha --admin-email=advcha@yahoo.com --admin-user=madmin --admin-password=Teddy@222 --language=en_US --currency=USD --timezone=America\/Chicago --use-rewrites=1<\/pre>\n<p>MAKE SURE EVEYTHING IS FINE<\/p>\n<pre class=\"lang:default decode:true\">Starting Magento installation:\r\nFile permissions check...\r\n[Progress: 1 \/ 834]\r\nRequired extensions check...\r\n[Progress: 2 \/ 834]\r\nEnabling Maintenance Mode...\r\n[Progress: 3 \/ 834]\r\nInstalling deployment configuration...\r\n[Progress: 4 \/ 834]\r\nInstalling database schema:\r\nSchema creation\/updates:\r\nModule 'Magento_AdminAnalytics':\r\n[Progress: 5 \/ 834]\r\nModule 'Magento_Store':\r\n...\r\n[Progress: 832 \/ 834]\r\nPost installation file permissions check...\r\nFor security, remove write permissions from these directories: '\/home\/teddy\/Documents\/works\/magento24\/app\/etc'\r\n[Progress: 833 \/ 834]\r\nWrite installation date...\r\n[Progress: 834 \/ 834]\r\n[SUCCESS]: Magento installation complete.\r\n[SUCCESS]: Magento Admin URI: \/admin_h6y3c2\r\nNothing to import.<\/pre>\n<p>Change the ownership of the\u00a0magento2\u00a0directory to\u00a0www-data\u00a0with the following command:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/magento24$ sudo chown -R www-data:www-data \/home\/teddy\/Documents\/works\/magento24\/<\/pre>\n<p>THEN CREATE NGINX CONFIG FILE<\/p>\n<pre class=\"lang:default decode:true \">sudo gedit \/etc\/nginx\/sites-available\/magento24.test<\/pre>\n<p>The content:<\/p>\n<pre class=\"lang:default decode:true \">server {\r\n    listen 80;\r\n    server_name magento24.test;\r\n    set $MAGE_ROOT \/home\/teddy\/Documents\/works\/magento24;\r\n\r\n    root $MAGE_ROOT;\r\n\r\n    index index.php;\r\n    autoindex off;\r\n    charset UTF-8;\r\n    error_page 404 403 = \/errors\/404.php;\r\n    #add_header \"X-UA-Compatible\" \"IE=Edge\";\r\n    client_max_body_size 100M;\r\n\r\n    # PHP entry point for setup application\r\n    location ~* ^\/setup($|\/) {\r\n        root $MAGE_ROOT;\r\n        location ~ ^\/setup\/index.php {\r\n            fastcgi_split_path_info ^(.+?\\.php)(\/.*)$;\r\n            fastcgi_buffers 1024 4k; \r\n            fastcgi_read_timeout 600s; \r\n            fastcgi_connect_timeout 600s;\r\n            fastcgi_pass unix:\/run\/php\/php7.4-fpm.sock; #FOR AWS SERVER\r\n            #fastcgi_pass 127.0.0.1:9000;\r\n            #fastcgi_index index.php;\r\n            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n            include fastcgi_params;\r\n        }\r\n\r\n        location ~ ^\/setup\/(?!pub\/). {\r\n            deny all;\r\n        }\r\n\r\n        location ~ ^\/setup\/pub\/ {\r\n            add_header X-Frame-Options \"SAMEORIGIN\";\r\n        }\r\n    }\r\n\r\n    # PHP entry point for update application\r\n    location ~* ^\/update($|\/) {\r\n        root $MAGE_ROOT;\r\n\r\n        location ~ ^\/update\/index.php {\r\n            fastcgi_split_path_info ^(\/update\/index.php)(\/.+)$;\r\n            fastcgi_pass unix:\/run\/php\/php7.4-fpm.sock; #FOR AWS SERVER\r\n            #fastcgi_pass 127.0.0.1:9000;\r\n            fastcgi_index index.php;\r\n            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n            fastcgi_param PATH_INFO $fastcgi_path_info;\r\n            include fastcgi_params;\r\n        }\r\n\r\n        # Deny everything but index.php\r\n        location ~ ^\/update\/(?!pub\/). {\r\n            deny all;\r\n        }\r\n\r\n        location ~ ^\/update\/pub\/ {\r\n            add_header X-Frame-Options \"SAMEORIGIN\";\r\n        }\r\n    }\r\n\r\n    location \/ {\r\n        try_files $uri $uri\/ \/index.php?$args;\r\n    }\r\n\r\n    location \/pub\/ {\r\n        location ~ ^\/pub\/media\/(downloadable|customer|import|theme_customization\/.*\\.xml) {\r\n            deny all;\r\n        }\r\n        alias $MAGE_ROOT\/pub\/;\r\n        add_header X-Frame-Options \"SAMEORIGIN\";\r\n    }\r\n\r\n\r\n    location ~ ^\/pub\/static\/version {\r\n        rewrite ^\/pub\/static\/(version\\d*\/)?(.*)$ \/pub\/static\/$2 last;\r\n    }\r\n\r\n    location \/static\/ {\r\n        # Uncomment the following line in production mode\r\n        # expires max;\r\n\r\n        # Remove signature of the static files that is used to overcome the browser cache\r\n        location ~ ^\/static\/version {\r\n            rewrite ^\/static\/(version\\d*\/)?(.*)$ \/static\/$2 last;\r\n        }\r\n\r\n        location ~* \\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {\r\n            add_header Cache-Control \"public\";\r\n            add_header X-Frame-Options \"SAMEORIGIN\";\r\n            expires +1y;\r\n\r\n            if (!-f $request_filename) {\r\n                rewrite ^\/static\/(version\\d*\/)?(.*)$ \/static.php?resource=$2 last;\r\n            }\r\n        }\r\n\r\n        location ~* \\.(zip|gz|gzip|bz2|csv|xml)$ {\r\n            add_header Cache-Control \"no-store\";\r\n            add_header X-Frame-Options \"SAMEORIGIN\";\r\n            expires off;\r\n\r\n            if (!-f $request_filename) {\r\n                rewrite ^\/static\/(version\\d*\/)?(.*)$ \/static.php?resource=$2 last;\r\n            }\r\n        }\r\n\r\n        if (!-f $request_filename) {\r\n            rewrite ^\/static\/(version\\d*\/)?(.*)$ \/static.php?resource=$2 last;\r\n        }\r\n\r\n        add_header X-Frame-Options \"SAMEORIGIN\";\r\n    }\r\n\r\n    location \/media\/ {\r\n        try_files $uri $uri\/ \/get.php?$args;\r\n\r\n        location ~ ^\/media\/theme_customization\/.*\\.xml {\r\n            deny all;\r\n        }\r\n\r\n        location ~* \\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {\r\n            add_header Cache-Control \"public\";\r\n            add_header X-Frame-Options \"SAMEORIGIN\";\r\n            expires +1y;\r\n            try_files $uri $uri\/ \/get.php?$args;\r\n        }\r\n\r\n        location ~* \\.(zip|gz|gzip|bz2|csv|xml)$ {\r\n            add_header Cache-Control \"no-store\";\r\n            add_header X-Frame-Options \"SAMEORIGIN\";\r\n            expires off;\r\n            try_files $uri $uri\/ \/get.php?$args;\r\n        }\r\n\r\n        add_header X-Frame-Options \"SAMEORIGIN\";\r\n    }\r\n\r\n    location \/media\/customer\/ {\r\n        deny all;\r\n    }\r\n\r\n    location \/media\/downloadable\/ {\r\n        deny all;\r\n    }\r\n\r\n    location \/media\/import\/ {\r\n        deny all;\r\n    }\r\n\r\n    # PHP entry point for main application\r\n    location ~ (index|get|static|report|404|503)\\.php$ {\r\n        try_files $uri =404;\r\n        fastcgi_pass unix:\/run\/php\/php7.4-fpm.sock; #FOR AWS SERVER\r\n        #fastcgi_pass 127.0.0.1:9000;\r\n        fastcgi_buffers 1024 4k;\r\n\r\n        fastcgi_read_timeout 600s;\r\n        fastcgi_connect_timeout 600s;\r\n        # to configure profiler in Magento 2\r\n        fastcgi_param  MAGE_PROFILER html;\r\n\r\n        fastcgi_index index.php;\r\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n        #include fastcgi_params;\r\n        #FOR DEVELOPMENT MODE ONLY - BEGIN\r\n        fastcgi_param MAGE_IS_DEVELOPER_MODE true;\r\n        fastcgi_param PHP_VALUE  display_startup_errors=on;\r\n        fastcgi_param PHP_VALUE  display_errors=on;\r\n        fastcgi_param PHP_VALUE  html_errors=on;\r\n        fastcgi_param PHP_VALUE  log_errors=on;\r\n        fastcgi_param PHP_VALUE  error_log=\/home\/teddy\/Documents\/works\/magento24\/var\/log\/system.log;\r\n        #FOR DEVELOPMENT MODE ONLY - END\r\n        include fastcgi_params;\r\n        #FOR DEBUGGING WITH XDEBUG - BEGIN\r\n        #fastcgi_read_timeout 600;\r\n        #FOR DEBUGGING WITH XDEBUG - END\r\n    }\r\n\r\n    gzip on;\r\n    gzip_disable \"msie6\";\r\n\r\n    gzip_comp_level 6;\r\n    gzip_min_length 1100;\r\n    gzip_buffers 16 8k;\r\n    gzip_proxied any;\r\n    gzip_types\r\n    text\/plain\r\n    text\/css\r\n    text\/js\r\n    text\/xml\r\n    text\/javascript\r\n    application\/javascript\r\n    application\/x-javascript\r\n    application\/json\r\n    application\/xml\r\n    application\/xml+rss\r\n    image\/svg+xml;\r\n    gzip_vary on;\r\n\r\n    # Banned locations (only reached if the earlier PHP entry point regexes don't match)\r\n    location ~* (\\.php$|\\.htaccess$|\\.git) {\r\n        deny all;\r\n    }\r\n}<\/pre>\n<p>Then<\/p>\n<pre class=\"lang:default decode:true\">sudo ln -s \/etc\/nginx\/sites-available\/magento24.test \/etc\/nginx\/sites-enabled\/magento24.test<\/pre>\n<p>Then<\/p>\n<pre class=\"lang:default decode:true \">sudo gedit \/etc\/hosts<\/pre>\n<p>Then insert<\/p>\n<pre class=\"lang:default decode:true \">127.0.0.1 magento24.test<\/pre>\n<p>CHECK THE NGINX AND RESTART<\/p>\n<pre class=\"lang:default decode:true \">sudo nginx -t\r\n\r\nsudo service nginx restart<\/pre>\n<p>IF NEEDED SET THE FILE PERMISSION and ownership<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy:~\/Documents\/works\/magento24$ sudo su\r\nroot@teddy:\/home\/teddy\/Documents\/works\/magento24# find var vendor pub\/static pub\/media app\/etc -type f -exec chmod g+w {} \\;\r\nroot@teddy:\/home\/teddy\/Documents\/works\/magento24# find var vendor pub\/static pub\/media app\/etc -type d -exec chmod g+ws {} \\;\r\nroot@teddy:\/home\/teddy\/Documents\/works\/magento24# chown -R www-data:www-data .\r\nroot@teddy:\/home\/teddy\/Documents\/works\/magento24# chmod u+x bin\/magento\r\nroot@teddy:\/home\/teddy\/Documents\/works\/magento24# chmod -R 777 var\/ pub\/ app\/etc\/ setup\/ generated\/<\/pre>\n<p>COMPILE<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/magento24$ sudo su -s \/bin\/bash www-data\r\nwww-data@teddy:\/home\/teddy\/Documents\/works\/beautybeat$ php bin\/magento setup:upgrade --keep-generated &amp;&amp; php bin\/magento setup:di:compile &amp;&amp; php bin\/magento setup:static-content:deploy -f &amp;&amp; php bin\/magento indexer:reindex &amp;&amp; php bin\/magento cache:clean &amp;&amp; php bin\/magento cache:flush\r\n<\/pre>\n<p>BUT WHEN I OPENED IT ON THE BROWSER http:\/\/magento24.test\/<br \/>\nI GOT 404 ERROR.<br \/>\nFROM THE \/var\/log\/nginx\/error, I FOUND<\/p>\n<pre class=\"lang:default decode:true \">2020\/11\/24 16:47:23 [error] 10247#10247: *15 directory index of \"\/home\/teddy\/Documents\/works\/magento24\/\" is forbidden, client: 127.0.0.1, server: magento24.test, request: \"GET \/ HTTP\/1.1\", host: \"magento24.test\"<\/pre>\n<p>I TRIED TO COPY index.php FILE INTO THE magento24 DIR. IT&#8217;S WORKING BUT IT FAILED TO LOAD THE STATIC FILES (CSS, JS, ETC) SO I THINK I&#8217;LL INSTALL IT VIA FILE DOWNLOADED ON https:\/\/magento.com\/tech-resources\/download<br \/>\nIT SEEMS THE COMMAND LINE INSTALLED THE DEV VERSION<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy:~\/Documents\/works\/magento24$ sudo su -s \/bin\/bash www-data\r\nwww-data@teddy:\/home\/teddy\/Documents\/works\/magento24$ php bin\/magento --version\r\nPHP Warning:  Module 'soap' already loaded in Unknown on line 0\r\nMagento CLI dev-2.4-develop<\/pre>\n<p>&#8212;<br \/>\nINSTALL FROM THE DOWNLOADED FILE (ALSO READ http:\/\/myprojects.advchaweb.com\/index.php\/2019\/02\/26\/install-magento-2-3-on-ubuntu-16-04-and-nginx\/)<br \/>\nBUT STUCK ON http:\/\/magento24.test\/setup\/#\/landing<br \/>\nCAN&#8217;T FIND ANY BUTTON TO CONTINUE!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ref: https:\/\/www.rosehosting.com\/blog\/how-to-install-magento-2-4-with-lemp-stack-on-ubuntu-20-04\/ Requirements: PHP7.4, Nginx\/Apache2, MySQL, ElasticSearch CHECK PHP VERSION. IF NOT PHP7.4, INSTALL\/CHANGE IT TO 7.4 teddy@teddy:~$ php -v PHP Warning: Module &#8216;curl&#8217; already loaded in Unknown on line 0 PHP 7.2.33-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Aug 7 2020 14:44:29) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2020\/11\/24\/install-magento-2-4-0-on-ubuntu-18-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install Magento 2.4.0 on Ubuntu 18.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,98,48,13,116],"tags":[],"class_list":["post-7390","post","type-post","status-publish","format-standard","hentry","category-magento","category-magento-tutorial","category-php-2","category-tutorial","category-ubuntu-18-04"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/7390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=7390"}],"version-history":[{"count":22,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/7390\/revisions"}],"predecessor-version":[{"id":9177,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/7390\/revisions\/9177"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=7390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=7390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=7390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}