(01-16-2019, 05:54 AM)rockford Wrote: Hi All,
I am new at forum, I was using Sentora without issues , unless we needed SSL enabled:
I followed 'http://docs.sentora.org/?node=102' tutorial for lets encrypt and used 'certbot' to install.
Everything was fine, but I missed a step:
Step 1. (I missed)
Changing Sentora port:
On Sentora Panel go to Admin -> Sentora Config -> Sentora Apache Port change to 443 and Save
and performed next step:
Step 2.Adding a Custom Entry to the Sentora Virtual Host
On Sentora Panel go to Admin -> Module Admin -> Apache Config > Global Sentora Entry
Is there a way to perform the missed step (to change Sentora config to 443) from command line? all the sites under hosting are effected due to the issue.
Sentora login is giving below error:
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
I can see and confirm that redirect is happening to port 443
PS* in /etc/sentora/configs/apache/jttpd-vhosts.config is reflecting step 2 changes.
There are two ways that I can think of.
One is to wait until the daemon has just run, then quickly edit the appropriate apache config file, save it and restart apache, which will make Sentora work, and then change the port setting as you should have done in the config... all within 5 minutes without the daemon running.
The other is to change the settings manually using mysql commands, then wait until the daemon runs.
Although the first might take a few attempts - because the daemon might run whilst you're making the changes that will allow you to get back into Sentora - but that shouldn't be a problem. The reason I'm not recommending using a mysql command is because I'm not 100% without checking that the daemon will pick up the change just by changing the value in mysql - there may need to be another flag changed too to trigger the daemon to then use the value you've changed.
So, as quickly as possible - to beat that daemon! - do this:
(Note that I'm using CentOS so you might have to adjust paths and commands for your server)
Edit the vhosts file:
Code:
vi /etc/sentora/configs/apache/httpd-vhosts.conf
Change the line near the top (press "i" to edit the file):
Code:
Listen 80
to:
Code:
Listen 443
unless there's another line near it that already lists port 443.
A couple of lines below that, change:
Code:
<VirtualHost *:80>
to:
Code:
<VirtualHost *:443>
Now save (ESC and type ":wq" then press enter).
Restart Apache:
Code:
systemctl restart httpd.service
Now go to your control panel with HTTPS, log in and change that config setting you missed and get it saved as quickly as you can!
If it doesn't seem to work, give it another try from the top as the daemon may have beaten you to it and changed your config back to port 80 - but I don't think the daemon will actually mess it up - again because the appropriate flag was not set that tells the daemon "there's a setting to update in the apache vhost file".
Let us know how it goes!
Keith.