WWW.CLOUDMINISTER.COM How to install Joomla with LEMP stack on CentOS 7 VPS (Part 2)
5. INSTALL NGINX Nginx, pronounced as “Engine X” and is a very fast and lightweight web server, that can be used to support static files, used as a reverse proxy and also for load balancing. Firstlly, update all the software packages by typing the following command: # yum -y update After that install EPEL repository that is required for Nginx packages by using command: # yum -y install epel-release Now install Nginx by typing the command: # yum -y install nginx After the installation is completed you must Enable and Start Nginx server by typing command: # systemctl start nginx www.cloudminister.com
And enable it with the command: # systemctl enable nginx Also check its status with # systemctl status nginx 6.CONFIGURE FIREWALL AFTER COMPLETED WITH INSTALLATION PART, CONFIGURE THE FIREWALL SETTINGS WITH THE FOLLOWING COMMAND: OPEN HTTP PORT BY TYPING COMMAND WITH: # FIREWALL-CMD –PERMANENT –ZONE=PUBLIC –ADD-SERVICE=HTTP IF FIREWALLD PACKAGE IS NOT AVAILABLE THEN YOU CAN INSTALL IT WITH COMMAND: # YUM -Y INSTALL FIREWALLD www.cloudminister.com
AND START FIREWALLD SERVICE WITH COMMAND: # SYSTEMCTL START FIREWALLD NOW RELOAD FIREWALL CONFIGURATION FILE BY TYPING: # FIREWALL-CMD –RELOAD NOW VERIFY YOUR INSTALLATION OF NGINX BY VISITING THE FOLLOWING URL ON ANY BROWSER YOU LIKE WITH HTTP://IP_ADDRESS www.cloudminister.com
7. CONFIGURE NGINX FILE AN NGINX SERVER CONFIGURATION FILE PLAYS AN IMPORTANT ROLE, SO YOU SHOULD BE MORE CAREFUL WHEN SETTING UP THIS FILE. FOR CONFIGURING NGINX FILE GO INSIDE THE FOLLOWING PATH WITH THE FOLLOWING COMMAND: # CD /ETC/NGINX/CONF.D # VI DEFAULT.CONF (CREATING NEW FILE) AND WRITE THE FOLLOWING CODE IN THE ABOVE FILE I.E. DEFAULT.CONF. ALSO CHANGE YOUR DOMAIN IN PLACE OF IP_ADDRESS SERVER { LISTEN 80; SERVER_NAME 3.95.30.147; www.cloudminister.com
root /usr/share/nginx/html/joomla; www.cloudminister.com index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; location = /40x.html { root /usr/share/nginx/html/joomla; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html/joomla; } location ~* \\.php$ { try_files $uri =404; fastcgi_pass unix: /var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}root /usr/share/nginx/html/joomla; www.cloudminister.com }index index.php index.html index.htm; AND SAVE IT WITH :WQ COMMAND, AFTER THAT EDIT THE CONFIGURATION FILE OF location / { PHP-FPM WITH THE FOLLOWING COMMAND: try_files $uri $uri/ =404; } # vi /etc/php-fpm.d/www.conf error_page 404 /404.html; OPloEcNatTioHnE=F/IL4E0xW.hItTmHl {A B O V E COMMAND AND EDIT THE FOLLOWING LINES I.E. root /usr/share/nginx/html/joomla; } U S E R = NGINX GROUP = NGINX error_page 500 502 503 504 /50x.html; ADlDocNatEioWn L=I/S5T0ExN.htUmNl D{ E R L ISTEN = 127.0.0.1:9000 root /usr/share/nginx/html/joomla; } L I S TEN = /VAR/RUN/PHP-FPM/PHP-FPM.SOCK location ~* \\.php$ { AND ALSO ADD try_files $uri =404; fLaI Ss tTcEg iN_.pOaWs sNuEnRi x :=/Nv aGr /I Nr uXn / p h p - f p m / p h p - f p m . s o c k ; fLaISstTcEgiN_.iGndReOx UinPde=xN.pGhpIN; X include fastcgi_params; fRaEstMcOgiV_EpaCraOmMSMCERNIPTT_(;F) IFLERNOAMMETH$dEoAcBumOeVnEt_TrWooOt$LfaINstEcSgi_AsNcDripStA_nVaEmIeT; WITH :WQ.
8. Install Joomla File You can easily download Joomla archive file from the link I provided in this blog. First go inside /tmp directory by typing below command: # cd /usr/share/nginx/html Make one directory i.e. joomla, # mkdir joomlaCome inside the joomla directory: # cd joomla/Download the latest Joomla setup by using wget command: # wget https://downloads.joomla.org/cms/joomla3/3-7-5/Joomla_3-7.5-Stable-Full_Package.zip ?format=zip And if wget command not work then you can download it with the following command: # yum -y install wget WWW.CLOUDMINISTER .COM
Now unzip the downloaded file using below command: # unzip Joomla_3-7.5-Stable-Full_Package.zip If unzip command is not work then install it first with the following command: # yum -y install unzip Also change the ownership of /var/www/html directory by using the following command: # chown -R nginx: /usr/share/nginx/html # chmod -R 755 /usr/share/nginx/html Note: Also change the ownership of group of /var/lib/php/session i.e. by default it is set as apache, so now change it’s ownership with: # ls -al /var/lib/php/session (It is used to check the ownership) # chown root:nginx /var/lib/php/session (It is used to change the ownership)
9. Test Joomla Now for testing the server of Joomla you should restart the server for that follow the command: # nginx -t (If the command shows ‘successfully’ message then the changes in file are correct and else the changes are wrong in the nginx configuration file.) # systemctl restart php-fpm # systemctl restart nginx Then open any browser and type inside URL i.e http://ip_address/ After then configuration page i.e. http://ip_address/installation/ is open and then configure the following settings
CONCLUSION AFTER THE ABOVE INSTALLATION, YOU WILL BE ABLE TO MANAGE YOUR WEBSITE BY JOOMLA CMS IN CENTOS VPS BY USING NGINX WEB SERVER.
Search
Read the Text Version
- 1 - 12
Pages: