usmannasir / cyberpanel

Cyber Panel - The hosting control panel for OpenLiteSpeed
GNU General Public License v3.0
1.61k stars 616 forks source link

[BUG] Switching from Apache back to OLS Whost issue #1286

Closed master3395 closed 4 months ago

master3395 commented 4 months ago

When i was trying a subdomain of mine for using Apache, i noticed that it was saying that it didn't have any SSL when i switched back to OLS.

I then noticed that it was missing the WHSSL shown below. I'm not sure why it wasn't added back, i switched to Apache using it, and now when i switched back it didn't have it. It left me with Cloudflare Invalid SSL certificate Error code 526 Until i added it back.

vhssl  {
  keyFile                 /etc/letsencrypt/live/cmstest2.newstargeted.com/privkey.pem
  certFile                /etc/letsencrypt/live/cmstest2.newstargeted.com/fullchain.pem
  certChain               1
  sslProtocol             24
  enableECDHE             1
  renegProtection         1
  sslSessionCache         1
  enableSpdy              15
  enableStapling           1
  ocspRespMaxAge           86400
}

This is the VHost file Apache makes if i make a new sub-domain with Apache included, isn't it suppose to say:

docRoot                   /home/newstargeted.com/cmstest2newstargeted.com
vhDomain                  $VH_NAME
vhAliases                 www.$VH_NAME
adminEmails               info@newstargeted.com
enableGzip                1
enableIpGeo               1

index  {
  useServer               0
  indexFiles              index.php, index.html
}

Not $VH_ROOT/public_html?

docRoot                   $VH_ROOT/public_html
vhDomain                  $VH_NAME
vhAliases                 www.$VH_NAME
adminEmails               info@newstargeted.com
enableGzip                1
enableIpGeo               1

index  {
  useServer               0
  indexFiles              index.php, index.html
}

errorlog $VH_ROOT/logs/$VH_NAME.error_log {
  useServer               0
  logLevel                WARN
  rollingSize             10M
}

accesslog $VH_ROOT/logs/$VH_NAME.access_log {
  useServer               0
  logFormat               "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i""
  logHeaders              5
  rollingSize             10M
  keepDays                10  
  compressArchive         1
}

context /.well-known/acme-challenge {
  location                /usr/local/lsws/Example/html/.well-known/acme-challenge
  allowBrowse             1

  rewrite  {
    enable                  0
  }
  addDefaultCharset       off

  phpIniOverride  {

  }
}

rewrite  {
  enable                  1
  rules                   <<<END_rules
RewriteEngine On
RewriteCond %{HTTPS}  !=on
REWRITERULE ^(.*)$ HTTP://apachebackend/$1 [P,L]
REWRITERULE ^(.*)$ HTTP://proxyApacheBackendSSL/$1 [P,L]

  END_rules
}

https://www.diffchecker.com/oTaNxkg6/)](https://www.diffchecker.com/oTaNxkg6/

usmannasir commented 4 months ago

let me check

usmannasir commented 4 months ago

can you check now

usmannasir commented 4 months ago

I've fixed the issue where you convert domain back to ols so it add ssl config.

usmannasir commented 4 months ago

I don't understand your other question. btw when apache is used, ols docroot does not matter as it proxies traffic to apache.

master3395 commented 4 months ago

I don't understand your other question. btw when apache is used, ols docroot does not matter as it proxies traffic to apache.

I made this post you can have a look at the second question there https://platform.cyberpersons.com/support/AZTIC3BR1/

usmannasir commented 4 months ago

let me check

usmannasir commented 4 months ago

As I can see apache gets installed for first time subdomains too. We will test further.

usmannasir commented 4 months ago

I think i will close this as we are working regarding other issues on ticket.