Deploying Joomla: Difference between revisions
Jump to navigation
Jump to search
how to deploy joomla |
mNo edit summary |
||
Line 5: | Line 5: | ||
<pre> | <pre> | ||
hostname: infrabase1 | hostname: infrabase1 | ||
Network: | Network: 10.1.65.0/24 | ||
IP Address : | IP Address : 10.1.65.11 | ||
Subnet Mask: 255.255.255. | Subnet Mask: 255.255.255.0 | ||
Gateway: | Gateway: 10.1.65.1 | ||
DNS: 8.8.8.8 | DNS: 8.8.8.8 | ||
sudo user: kedar | sudo user: kedar | ||
Container: webserver | Container: webserver | ||
Network: 10.0. | Network: 10.1.65.0/24 | ||
IP Address : 10. | IP Address : 10.1.65.107 | ||
Subnet Mask: 255.255.255.0 | |||
Gateway: 10.1.65.1 | |||
DNS: 8.8.8.8 | |||
sudo user: kedar | |||
Container: db1 | |||
Network: 10.1.65.0/24 | |||
IP Address : 10.1.65.108 | |||
Subnet Mask: 255.255.255.0 | Subnet Mask: 255.255.255.0 | ||
Gateway: 10. | Gateway: 10.1.65.1 | ||
DNS: 8.8.8.8 | DNS: 8.8.8.8 | ||
sudo user: kedar | sudo user: kedar | ||
Line 23: | Line 31: | ||
PC type: Desktop | PC type: Desktop | ||
OS: Ubuntu Desktop | OS: Ubuntu Desktop | ||
IP Address: | IP Address: 10.1.65.160 | ||
</pre> | </pre> | ||
|} | |} | ||
=Before you proceed= | =Before you proceed= | ||
The domain used here is '''networked.com'''. This is | The domain used here is '''networked.com'''. This is used only for demonstration and required dns entries for this domain have already been done to the host file to make the domain and any subdomains reachable on the network. This domain may be owned by someone else and we do not know who it is and we are not linked to them. Wordpress configured for this domain in this howto is not reachable on public IP. If you try networked.com and find any material that may be suitable / unsuitable to you, we are not the owners of the same and we are not responsible for the content. | ||
=Introduction= | |||
*We shall be creating a website using joomla with FQDN as: https://joomla.networked.net | |||
*We shall be hosting the site on port number: 443 | |||
*We shall be using a self signed SSL certificate | |||
*Host entry to ensure this website is reachable is done in the user PC, in absence of a DNS | |||
=Pre-requisites installation= | =Pre-requisites installation= | ||
* Log into the webserver | * Log into the webserver and run the below commands | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
ssh kedar@ | ssh kedar@10.1.65.107 | ||
sudo apt install apache2 php7.2 php7.2-curl php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-mysql php7.2-soap php7.2-xml | sudo apt install apache2 php7.2 php7.2-curl php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-mysql php7.2-soap php7.2-xml php7.2-zip libapache2-mod-php7.2 | ||
sudo apt install rsync nano openssl | sudo apt install rsync nano openssl | ||
sudo a2enmod ssl | sudo a2enmod ssl | ||
Line 54: | Line 53: | ||
sudo systemctl status apache2 | sudo systemctl status apache2 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=Database Creation= | =Database Creation= | ||
*Database will be created in a mariadb server which is installed into a container created on the host server (infrabase1) | *Database will be created in a mariadb server which is installed into a container created on the host server (infrabase1). Latest mariadb server has been installed and run the below commands after an ssh into the mariadb server. | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo mysql -u root -p | sudo mysql -u root -p | ||
CREATE DATABASE joomla; | CREATE DATABASE joomla; | ||
GRANT ALL PRIVILEGES ON joomla.* TO " | GRANT ALL PRIVILEGES ON joomla.* TO "joomla"@"%" IDENTIFIED BY "123456"; | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
quit; | quit; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* | =Create self signed certificates= | ||
* Log into the webserver and run the below commands | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/joomla.key -out /etc/ssl/certs/joomla.crt | |||
</syntaxhighlight> | </syntaxhighlight> | ||
* You can use a commercial self signed certificate if you have one or can also use free Lets Encrypt certificate | |||
=Download Joomla= | |||
* Log into the webserver and run the below commands | |||
* | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cd /var/www/html | cd /var/www/html | ||
sudo mkdir joomla | sudo mkdir joomla | ||
cd /home/kedar | cd /home/kedar | ||
wget https://downloads.joomla.org/cms/joomla3/3-9-14/Joomla_3-9- | wget https://downloads.joomla.org/cms/joomla3/3-9-14/Joomla_3-9-16-Stable-Full_Package.zip?format=zip | ||
mv Joomla_3-9-14-Stable-Full_Package.zip?format=zip joomla.zip | mv Joomla_3-9-14-Stable-Full_Package.zip?format=zip joomla.zip | ||
</syntaxhighlight> | |||
=Deploy Joomla= | |||
<syntaxhighlight lang="bash"> | |||
cd /home/kedar | |||
mkdir joomlainstaller | mkdir joomlainstaller | ||
cp joomla.zip joomlainstaller/ | cp joomla.zip joomlainstaller/ | ||
Line 92: | Line 88: | ||
rm -rf joomla.zip | rm -rf joomla.zip | ||
sudo rsync -avz . /var/www/html/joomla | sudo rsync -avz . /var/www/html/joomla | ||
</syntaxhighlight> | |||
* Change the ownership of the joomla folder to apache user | |||
<syntaxhighlight lang="bash"> | |||
cd /var/www/html | cd /var/www/html | ||
sudo chown -R www-data:www-data joomla/ | sudo chown -R www-data:www-data joomla/ | ||
sudo ystemctl restart apache2 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
* Create virtual host for the website | |||
*Create | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
< | cd /etc/apache2/sites-available | ||
sudo a2dissite 000-default.conf | |||
sudo a2dissite default-ssl.conf | |||
sudo nano joomla.conf | |||
DocumentRoot | </syntaxhighlight> | ||
* Add the below configuration in the joomla.conf file | |||
<syntaxhighlight lang="apacheconf"> | |||
<IfModule mod_ssl.c> | |||
<VirtualHost _default_:443> | |||
ServerName joomla.networked.net | |||
ServerAlias joomla | |||
ServerAdmin admin@networked.net | |||
DocumentRoot /var/www/html/joomla | |||
ErrorLog ${APACHE_LOG_DIR}/error.log | |||
CustomLog ${APACHE_LOG_DIR}/access.log combined | |||
</VirtualHost> | SSLEngine on | ||
SSLCertificateFile /etc/ssl/certs/joomla.crt | |||
SSLCertificateKeyFile /etc/ssl/private/joomla.key | |||
<FilesMatch "\.(cgi|shtml|phtml|php)$"> | |||
SSLOptions +StdEnvVars | |||
</FilesMatch> | |||
<Directory /usr/lib/cgi-bin> | |||
SSLOptions +StdEnvVars | |||
</Directory> | |||
</VirtualHost> | |||
</IfModule> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
* | * Enable the site and Restart apache service | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo a2ensite joomla.conf | sudo a2ensite joomla.conf | ||
sudo | sudo sysemctl restart apache2 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* Using a browser navigate to https://joomla.networked.com | |||
** Answer various questions based on some of the steps we have done above like db name, db user, db server etc. | |||
** Login to joomla using the admin credentials | |||
= | =Conclusion= | ||
* | * We have a working joomla website hosted on an apache web server. Explore the plugins and extensions and create a website or a corporate intranet | ||
[[Category: Intranet Applications]] | [[Category: Intranet Applications]] |
Revision as of 03:42, 19 April 2020
Setup Details |
hostname: infrabase1 Network: 10.1.65.0/24 IP Address : 10.1.65.11 Subnet Mask: 255.255.255.0 Gateway: 10.1.65.1 DNS: 8.8.8.8 sudo user: kedar Container: webserver Network: 10.1.65.0/24 IP Address : 10.1.65.107 Subnet Mask: 255.255.255.0 Gateway: 10.1.65.1 DNS: 8.8.8.8 sudo user: kedar Container: db1 Network: 10.1.65.0/24 IP Address : 10.1.65.108 Subnet Mask: 255.255.255.0 Gateway: 10.1.65.1 DNS: 8.8.8.8 sudo user: kedar User PC Details PC type: Desktop OS: Ubuntu Desktop IP Address: 10.1.65.160 |
Before you proceed
The domain used here is networked.com. This is used only for demonstration and required dns entries for this domain have already been done to the host file to make the domain and any subdomains reachable on the network. This domain may be owned by someone else and we do not know who it is and we are not linked to them. Wordpress configured for this domain in this howto is not reachable on public IP. If you try networked.com and find any material that may be suitable / unsuitable to you, we are not the owners of the same and we are not responsible for the content.
Introduction
- We shall be creating a website using joomla with FQDN as: https://joomla.networked.net
- We shall be hosting the site on port number: 443
- We shall be using a self signed SSL certificate
- Host entry to ensure this website is reachable is done in the user PC, in absence of a DNS
Pre-requisites installation
- Log into the webserver and run the below commands
ssh kedar@10.1.65.107
sudo apt install apache2 php7.2 php7.2-curl php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-mysql php7.2-soap php7.2-xml php7.2-zip libapache2-mod-php7.2
sudo apt install rsync nano openssl
sudo a2enmod ssl
sudo a2enmod rewrite
sudo systemctl restart apache2
sudo systemctl status apache2
Database Creation
- Database will be created in a mariadb server which is installed into a container created on the host server (infrabase1). Latest mariadb server has been installed and run the below commands after an ssh into the mariadb server.
sudo mysql -u root -p
CREATE DATABASE joomla;
GRANT ALL PRIVILEGES ON joomla.* TO "joomla"@"%" IDENTIFIED BY "123456";
FLUSH PRIVILEGES;
quit;
Create self signed certificates
- Log into the webserver and run the below commands
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/joomla.key -out /etc/ssl/certs/joomla.crt
- You can use a commercial self signed certificate if you have one or can also use free Lets Encrypt certificate
Download Joomla
- Log into the webserver and run the below commands
cd /var/www/html
sudo mkdir joomla
cd /home/kedar
wget https://downloads.joomla.org/cms/joomla3/3-9-14/Joomla_3-9-16-Stable-Full_Package.zip?format=zip
mv Joomla_3-9-14-Stable-Full_Package.zip?format=zip joomla.zip
Deploy Joomla
cd /home/kedar
mkdir joomlainstaller
cp joomla.zip joomlainstaller/
cd joomlainstaller
unzip joomla.zip
cd joomlainstaller
rm -rf joomla.zip
sudo rsync -avz . /var/www/html/joomla
- Change the ownership of the joomla folder to apache user
cd /var/www/html
sudo chown -R www-data:www-data joomla/
sudo ystemctl restart apache2
- Create virtual host for the website
cd /etc/apache2/sites-available
sudo a2dissite 000-default.conf
sudo a2dissite default-ssl.conf
sudo nano joomla.conf
- Add the below configuration in the joomla.conf file
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName joomla.networked.net
ServerAlias joomla
ServerAdmin admin@networked.net
DocumentRoot /var/www/html/joomla
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/joomla.crt
SSLCertificateKeyFile /etc/ssl/private/joomla.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
- Enable the site and Restart apache service
sudo a2ensite joomla.conf
sudo sysemctl restart apache2
- Using a browser navigate to https://joomla.networked.com
- Answer various questions based on some of the steps we have done above like db name, db user, db server etc.
- Login to joomla using the admin credentials
Conclusion
- We have a working joomla website hosted on an apache web server. Explore the plugins and extensions and create a website or a corporate intranet