{"id":1950,"date":"2017-06-13T00:55:34","date_gmt":"2017-06-13T05:55:34","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=1950"},"modified":"2022-06-03T03:42:08","modified_gmt":"2022-06-03T08:42:08","slug":"script-install-joomla-3-7-on-a-centosfedora-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/script-install-joomla-3-7-on-a-centosfedora-vps\/","title":{"rendered":"Script: Install Joomla 3.7 on CentOS"},"content":{"rendered":"
<\/p>\n
In one of our previous posts, we explained how to install Joomla 3 on Ubuntu 14.04<\/a>. Joomla is a Content Management System (CMS for short) – this is user-friendly software that allows you to build websites and manage the content on your websites easier than ever before.<\/p>\n <\/p>\n In this tutorial, unlike the previous Joomla install guide, we wrote a script for you to help make the installation of Joomla 3.7 on a CentOS\/Fedora VPS<\/a>\u00a0even faster and easier. This script will automatically do everything that should be done on your server, including the creation of a MySQL database<\/a> while also creating an Apache virtual host<\/a> for your Joomla website. All you need to do is to create a file on your server containing the script below, then simply execute the script and enter your details when prompted to.<\/p>\n (Note: You will need to have MySQL and Apache installed on your server in order for this script to work correctly.<\/p>\n You will also need to point your domain to your server\u2019s IP address by editing your DNS server information. )<\/p>\n Create a file on your server with your favorite text editor and copy this script into your file:<\/p>\n Make the script executable, then execute the script:<\/p>\n (Replace <script name> with the name that you have given to your file)<\/p>\n After running the script, you will have successfully installed Joomla 3.7 on your CentOS or Fedora VPS! All that is left to do is to set up the remainder of Joomla at your web domain.<\/p>\n Of course, you don\u2019t have to do any of this if you use one of our Joomla VPS hosting<\/a> services, in which case you can simply ask our expert Linux admins to install Joomla for you. They are available 24\/7 and will take care of your request immediately.<\/p>\n PS<\/span>.<\/strong> If you liked this post, please share it with your friends through social networks by using the buttons below, or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In one of our previous posts, we explained how to install Joomla 3 on Ubuntu 14.04. Joomla is a Content … <\/p>\n#!\/bin\/bash\r\n# Install Joomla on a CentoOS\/Fedora VPS\r\n#\r\n\r\n# Create MySQL database\r\nread -p \"Enter your MySQL root password: \" rootpass\r\nread -p \"Database name: \" dbname\r\nread -p \"Database username: \" dbuser\r\nread -p \"Enter a password for user $dbuser: \" userpass\r\nread -p \"Enter your server's public IP address: \" address\r\nmysql -uroot <<MYSQL_SCRIPT\r\nCREATE DATABASE $dbname;\r\ndelete from mysql.user\r\nwhere user='$dbuser'\r\nand host = 'localhost';\r\nflush privileges;\r\nCREATE USER $dbuser@localhost;\r\nGRANT ALL PRIVILEGES ON $dbname.* TO $dbuser@localhost IDENTIFIED BY '$userpass';\r\nFLUSH PRIVILEGES;\r\nMYSQL_SCRIPT\r\necho \"New MySQL database has been successfully created\"\r\nsleep 2\r\n\r\n# Download, unpack and configure Joomla\r\nread -r -p \"Enter your Joomla URL? [e.g. mydomain.com]: \" joomlaurl\r\nmkdir -p \/var\/www\/html\/$joomlaurl && \\\r\nwget -P \/var\/www\/html\/$joomlaurl \\\r\nhttps:\/\/downloads.joomla.org\/cms\/joomla3\/3-7-2\/Joomla_3-7.2-Stable-Full_Package.zip && \\\r\ncd \/var\/www\/html\/$joomlaurl\r\necho \"Installing unzip package if necessary...\" && yum -yq install unzip\r\nsleep 3\r\nunzip Joomla*.zip && rm -f Joomla_*.zip && \\\r\nchown apache: -R \/var\/www\/html\/$joomlaurl\r\nkillall httpd\r\n\r\n# Create the Apache virtual host\r\necho \"\r\n\r\n<VirtualHost $address:80>\r\n ServerName www.$joomlaurl\r\n DocumentRoot \"\/var\/www\/html\/$joomlaurl\"\r\n DirectoryIndex index.php\r\n Options FollowSymLinks\r\n ErrorLog logs\/$joomlaurl-error_log\r\n CustomLog logs\/$joomlaurl-access_log common\r\n<\/VirtualHost>\r\n\r\n\" >> \/etc\/httpd\/conf\/httpd.conf\r\nservice httpd restart\r\n\r\necho -en \"\\aPlease go to http:\/\/www.$joomlaurl and finish the installation\\n\"\r\n\r\n#End of script<\/pre>\n
chmod +x <script name> && .\/<script name><\/pre>\n