This solution applied to my hostgator VPS.
Consider:
ACCOUNT_NAME to be your account name;
DOMAIN_NAME to be your domain name. It can also be a subdomain;
- Backup your apache settings:
cp -vp /etc/apache2/conf/httpd.conf{,-BKP}
- Uncomment the lines of include in the vhost of the domain. Do it for the HTTP(std) and for the HTTPS(ssl):
vim /etc/apache2/conf/httpd.conf
- Once you accessed the file, search the following lines and remove the #
Include
"/etc/apache2/conf.d/userdata/std/2_4/ACCOUNT_NAME/DOMAIN_NAME/.conf"
Include "/etc/apache2/conf.d/userdata/ssl/2_4/ACCOUNT_NAME/DOMAIN_NAME/.conf"
- Create the following directories:
mkdir -p /etc/apache2/conf.d/userdata/std/2_4/ACCOUNT_NAME/DOMAIN_NAME
mkdir -p /etc/apache2/conf.d/userdata/ssl/2_4/ACCOUNT_NAME/DOMAIN_NAME
- Create a .conf for std and ssl.
vim /etc/apache2/conf.d/userdata/std/2_4/ACCOUNT_NAME/DOMAIN_NAME/ACCOUNT_NAME.conf
vim /etc/apache2/conf.d/userdata/ssl/2_4/ACCOUNT_NAME/DOMAIN_NAME/ACCOUNT_NAME.conf
/etc/apache2/conf.d/userdata/std/2_4/ACCOUNT_NAME/DOMAIN_NAME/ACCOUNT_NAME.conf
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
ProxyPass "/" "http://DOMAIN_NAME:10002/"
/etc/apache2/conf.d/userdata/ssl/2_4/ACCOUNT_NAME/DOMAIN_NAME/ACCOUNT_NAME.conf
ProxyPass "/" "http://DOMAIN_NAME:10002/"
- Once you are done, restart the httpd service.
service httpd restart