This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Sentora Panel redirecting to a hosted website
#1
Sentora Panel redirecting to a hosted website
Hello.
I recently installed Sentora v1.0.3 on my sub domain say :- panel01.myhost.com

As I installed a SSL certificate for my Sentora Panel it works great over here https://panel01.myhost.com

But when I type the Non https link say panel01.myhost.com it redirects me to a website hosted inside in my Sentora panel. [It Opens the website that I have added first to my Sentora Panel]

I tried to add the below rule to .htaccess file located here /etc/sentora/panel/ which didnt help as well.
Code:
#Enforce
SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


a2enmod rewrite is Enabled and I did restart apache2 service after applying changes.

It would be great if some help me to automatically redirect the panel01.myhost.com to https://panel01.myhost.com

Thank You & Regards.
Reply
Thanks given by:
#2
RE: Sentora Panel redirecting to a hosted website
Looks like you didn't 'turn on' the rewrite engine also make sure it is first entry in .htaccess.
Code:
# Force SSL - Always first!
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#3
RE: Sentora Panel redirecting to a hosted website
@TGates, Thank You for your reply. But it still doesn't redirect to https link.

Please have a look at my .htaccess file here :- http://s23.postimg.org/b5fi086e3/Sentora...s_file.png

I did try to copy paste the code as you posted including the - Always first! in first line, but no luck.

The Non-https link takes me to a website hosted inside the Sentora Panel.

Thank You & Regards.
Reply
Thanks given by:
#4
RE: Sentora Panel redirecting to a hosted website
Any Help, I still did not figure this out. rest all things are going all good.
Reply
Thanks given by:
#5
RE: Sentora Panel redirecting to a hosted website
Hmm.
Here is my complete .htaccess:
)in the panel/ folder):

Code:
RewriteEngine on

# Force SSL - Always first!
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://cp.domain.com/$1 [R,L]

# Standard Sentora Rewrite Ruleset
RewriteRule ^api/([^/\.]+)/?$ bin/api.php?m=$1 [L]
RewriteRule ^apps/([^/\.]+)/?$ etc/apps/$1 [L]

# Optionally you can uncomment the below line and configure your domain to only allow access from the FQDN.
#RewriteCond
%{SERVER_NAME} !^cp\.domain\.com$
#RewriteRule
^ - [F]

# Deny access to some file types/directories
RewriteRule ^/?(\.git|\.tx|SQL|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F]
RewriteRule ^(etc/tmp|etc/zppy-cache|/etc/lib/pChart2/cache|etc/build) - [F,L,NC]

# Disable index listing
Options -Indexes
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#6
RE: Sentora Panel redirecting to a hosted website
I modified the code in my .htaccess file same as yours, but No luck.

Let me explain you in more detail. I face 2 issues right now.

Case 1: I have installed LetsEncrypt SSL for the control panel (https://panel.domain.com). When I visit the control panel page via https it works perfect.
 
But when I visit the the page via only http it says This site can’t be reached.

What I want is that http should automatically get redirect to https

Case2:  After setting up my Sentora installation when I add my 1st domain say mydomain.com everything works good, but again when I visit my Sentora panel via http (http://panel.domain.com), it opens up my 1st added domain i.e mydomain.com which is very weird.

Thanks & Regards. Really appreciate it.
Reply
Thanks given by:
#7
RE: Sentora Panel redirecting to a hosted website
Ok, let me check my configs for Lets Encrypt and see how I configured it. I'll get back to you.

OK... Did you use the internal custom vhosts entry or the external manual config file setup?

(I MIGHT reconfigure Cer_Manager to use Let's Encrypt certificates depending on my free time.)
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#8
RE: Sentora Panel redirecting to a hosted website
What exactly I have done.

1. Global Sentora Entry: Added it from Home > Server Admin > Module Admin > Apache Config.


Code:
SSLEngine on
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder On
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
SSLCertificateFile /etc/letsencrypt/live/panel.domain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/panel.domain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/panel.domain.com/chain.pem

2. I have changed Sentora Apache Port from 80 to 443 from here:- Home > Server Admin > Sentora Config

Thank You.
Reply
Thanks given by:
#9
RE: Sentora Panel redirecting to a hosted website
You also need to forward http (80) traffic to https (443). If there is no vhost for port 80 for your panel, you will get the problem you have Sad

Basically you need an http and https virtualhost entry for your panel. Right now, your server does not know what to do with requests to your panel url when called with http.

Checking on how to do it using the custom vhost entry.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#10
RE: Sentora Panel redirecting to a hosted website
UPDATE : to redirect http to https go at /etc/sentora/panel open .htaccess and write this
Code:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
like this
[Image: 0bcf1376b028435288d61e6e987c481f.png]
isn't needed to write 2 times rewriteengine on.
--
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
Is Sentora dead? rajeevrrs 2 3 ,979 12-17-2022, 09:20 AM
Last Post: TGates
Sentora debug and error files johnnyp 0 1 ,594 10-27-2022, 06:16 PM
Last Post: johnnyp
Transfer Account to another Sentora BenI 1 3 ,348 07-21-2022, 07:19 PM
Last Post: Nigel

Forum Jump:


Users browsing this thread: 1 Guest(s)