DNS (Domain Name System) allows us to reference computers by easy-to-remember domain names, like example.com
instead of IP addresses. DNS records define which IP addresses map to which domain names and how to handle other kinds of requests a domain might receive.
To set up a domain name, you need to do two things. First, you need to purchase a domain name from a domain name registrar. Second, you need to set up DNS records for your domain by using a DNS hosting service.
vim /etc/apache2/sites-available/yourDomainName.conf
<VirtualHost *:80>
ServerAdmin webmaster@yourDomainName
ServerName yourDomainName
ServerAlias yourDomainName
DocumentRoot /var/www/html/blogs/techaroha_wordpress/yourDomainName
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<Directory /var/www/html/blogs/techaroha_wordpress/yourDomainName>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
sudo a2ensite yourDomainName.conf
sudo service apache2 restart
/etc/ssl/certs/yourDomainName/yourDomainName.key /etc/ssl/certs/yourDomainName/yourDomainName.crt /etc/ssl/certs/yourDomainName/yourDomainName.ca-bundle
<VirtualHost *:443>
ServerName yourDomainName
ServerAdmin webmaster@yourDomainName
ServerAlias yourDomainName
DocumentRoot /var/www/html/blogs/techaroha_wordpress/yourDomainName
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile /etc/ssl/certs/yourDomainName/yourDomainName.crt SSLCertificateKeyFile /etc/ssl/certs/yourDomainName/yourDomainName.key SSLCertificateChainFile /etc/ssl/certs/yourDomainName/yourDomainName.ca-bundle </VirtualHost>
sudo a2ensite yourDomainName.conf
sudo a2enmod rewrite sudo a2enmod ssl
sudo service apache2 restart
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourDomainName.com/$1 [R,L]
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests
sudo systemctl restart apache2
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off
ServerName yourDomainName
ServerAlias yourDomainName
ProxyPass / http://localhost:3001/
ProxyPassReverse / http://localhost:3001/
</VirtualHost>
sudo service apache2 restart