Services & Management

Associating Your Domain

Associating Your Domain with UVDesk

Overview:

To successfully associate your domain with the UVDesk hosted on an AWS instance, follow the steps outlined below. This process involves editing the Apache configuration file to link your domain with the server’s IP address and enforce HTTPS redirection.

 

Step 1: Access Your Server

1. Log in via SSH

  • Use SSH to access your AWS instance:
ssh ec2-user@<your-aws-public-ip>

2. Switch to the Root User

  • Elevate your permissions by switching to the root user:
[ec2-user@…]$ sudo -i

Step 2: Modify the Apache Configuration File

1. Edit the Configuration File

  • Open the Apache configuration file:
[root …]$ nano /etc/httpd/sites-available/uvdesk.conf

2. Update Domain Information

  • Replace the placeholder yourdomain.com with your actual domain name in the configuration. Ensure that both the non-www and www versions of your domain are included. Also, modify the RewriteRule directives to enforce HTTPS redirection.

Below is the updated configuration you need to apply:

<VirtualHost *:80>

ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /var/www/uvdesk/public
ErrorLog /var/www/uvdesk/log/error.log
CustomLog /var/www/uvdesk/log/requests.log combined

 

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?yourdomain\.com$
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [END,NE,R=permanent]

<Directory /var/www/uvdesk>

Options +FollowSymLinks
AllowOverride All
Require all granted

</Directory>

</VirtualHost>

<VirtualHost *:443>

ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /var/www/uvdesk
ErrorLog /var/www/uvdesk/log/error.log
CustomLog /var/www/uvdesk/log/requests.log combined

 

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?yourdomain\.com$
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [END,NE,R=permanent]
## Include SSL settings (for example with Let’s Encrypt)
## Uncomment the below lines if you have SSL with LetsEncrypt
# Include /etc/letsencrypt/options-ssl-apache.conf
# SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/fullchain.pem
# SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem

 <Directory /var/www/uvdesk>

Options +FollowSymlinks
AllowOverride All
Require all granted

</Directory>

 

# Enable HTTP/2 for better performance
Protocols h2 http/1.1
# Security Headers
Header always set Strict-Transport-Security “max-age=31536000; includeSubDomains; preload”
Header always set X-Content-Type-Options “nosniff”
Header always set X-Frame-Options “SAMEORIGIN”
Header always set X-XSS-Protection “1; mode=block”

</VirtualHost>

 

3. Save and Exit

  • After making the necessary changes, save the file by pressing Ctrl + O, then press Enter to confirm. Exit the editor by pressing Ctrl + X.

Step 3: Refresh Symbolic Links & Restart Apache

  • For the changes to take effect, recreate the symbolic links and then restart the Apache web server:

 

[root …]$ rm -rf /etc/httpd/sites-enabled/uvdesk.conf

[root …]$ sudo ln -sf /etc/httpd/sites-available/uvdesk.conf /etc/httpd/sites-enabled/uvdesk.conf

[root …]$ sudo systemctl restart httpd

 

Additional Notes:

  • Ensure that you have an SSL certificate installed for HTTPS to work. You may use services such as Let’s Encrypt to obtain a free SSL certificate.
  • You might need to adjust firewall rules or security group settings in AWS to allow traffic on ports 80 (HTTP) and 443 (HTTPS).
  • Important: Request AWS to lift any email sending restrictions if you’re using the application’s email features.

 

 

CONTENTS