HenryMehta

Member
Dec 4, 2017
7
0
1
Wales
cPanel Access Level
Root Administrator
Hi

I generally manage my Linux servers by logging in as root and doing everything from the command line (because I just do small stuff) but I've been asked to take over a WHM/CPanel Service with multiple accounts and I need to get them moved onto SSL. For the most part I've managed this with the Wordpress sites but I have a Ruby on Rails site running, with an auto SSL installed but when going to https://mysite it gives a list of the files/directories. Where in WHM can I amend the virtual host so it directs the server correctly?

Thank you
 

HenryMehta

Member
Dec 4, 2017
7
0
1
Wales
cPanel Access Level
Root Administrator
I think I've worked out the issue, but don't know how to fix.

The issue is httpd.conf has the line `DocumentRoot /home/mysite/public_html` but it should be `DocumentRoot /var/www/mysite/production/current/public`

Plastered around httpd.conf it says not to edit it because changes will be overwritten, so I need to know where to make the changes so they aren't. Any help most welcome
 

HenryMehta

Member
Dec 4, 2017
7
0
1
Wales
cPanel Access Level
Root Administrator
So I've created the ssl conf file in the directory as per: `/etc/apache2/conf.d/userdata/ssl/2_4/user/domain/includename.conf ` and restarted the server but the file isn't being included (or is being overwritten by what was originally there). Could you advise what may be happening?
 

rpvw

Well-Known Member
Jul 18, 2013
1,100
475
113
UK
cPanel Access Level
Root Administrator
v68 - ea4

I can't help thinking there is an easier way of achieving what you are trying to do

Application Manager - Version 68 Documentation - cPanel Documentation

Would the environment variable config.force_ssl = true be what you are looking for ?

(Make sure you have ALL the ea modules required for rubi, passenger and mod_env)

For reference purposes, you may also like to see:

Guide to Ruby Installations - cPanel Knowledge Base - cPanel Documentation
Ruby on Rails - Version 68 Documentation - cPanel Documentation
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello,

The previous post offers the better approach. However, to answer your question, you won't see the names of the custom include files in the Apache configuration file. Apache is configured to automatically detect the custom includes from the appropriate directories when they are added.

Thank you.
 

HenryMehta

Member
Dec 4, 2017
7
0
1
Wales
cPanel Access Level
Root Administrator
Hello,

The previous post offers the better approach. However, to answer your question, you won't see the names of the custom include files in the Apache configuration file. Apache is configured to automatically detect the custom includes from the appropriate directories when they are added.

Thank you.
Hi, I don't understand why it is not working if this is the case. If I edit the httpd.conf file directly then the sites use the HTTPS. When I leave the same code in the include files it does not. I am missing something but I do not know what
Henry
 

HenryMehta

Member
Dec 4, 2017
7
0
1
Wales
cPanel Access Level
Root Administrator
I've followed this instruction, mostly, and in particular where it says for the SSL add the conf file here: `/etc/apache2/conf.d/userdata/ssl/2_4/user/domain/includename.conf`

The thing is I do not have a `/etc/apache2` directory and the relevant files seem to be in `/etc/httpd/` so I created my conf files in `/etc/httpd/conf.d/userdata/2_4/myusername/mysite.com/mysite.conf`
 

rpvw

Well-Known Member
Jul 18, 2013
1,100
475
113
UK
cPanel Access Level
Root Administrator