Zoneminder in HTTS only

Forum for questions and support relating to the 1.30.x releases only.
Locked
pat2
Posts: 156
Joined: Fri Sep 16, 2016 6:35 pm

Zoneminder in HTTS only

Post by pat2 »

Hi,

I want to publish the Zoneminder service in HTTPS mode only:

https://serverip/zm

I was able to do publish in HTTPs through the following statements:

make-ssl-cert generate-default-snakeoil --force-overwrite
a2enmod ssl
a2ensite default-ssl

and then:

service apache2 restart


but, trhough this way, i have the ZM service in http too:

http://serverip/zm

Is there a way to publish the service in https only? please, write down the statements.
thanks
---------------------------------------------------------------------------
ZM 1.36.34 - 14 cameras on Orange Pi 5 (arm64) - Ubuntu Jammy 22.04
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Zoneminder in HTTS only

Post by bbunge »

No. Zoneminder depends on your web browser settings. Suggest you look up how to remove Apache port 80 server. Or if you are getting to the server through a router just port forward port 443.
pat2
Posts: 156
Joined: Fri Sep 16, 2016 6:35 pm

Re: Zoneminder in HTTS only

Post by pat2 »

if i cancel port 80 in ports.conf, it works. all traffic on port 80 is blocked and so ZM is visible only in https.

the issue is that i have on the same server a website that works on 80 port. so I cannot close the port 80 (or apply the port forwarding only for 443)...

i need a selective behaviour:

for source in /var/www: to be opened port 80 only

for source /usr/share/zoneminder: to be opened port 443 only
---------------------------------------------------------------------------
ZM 1.36.34 - 14 cameras on Orange Pi 5 (arm64) - Ubuntu Jammy 22.04
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Zoneminder in HTTS only

Post by rockedge »

can you try a reverse proxy?
vox

Re: Zoneminder in HTTS only

Post by vox »

  1. Enable apache2 mod_rewrite
  2. Edit your apache2 vhost files in /etc/apache2/sites-enabled/
    • Code: Select all

      sudo nano /etc/apache2/sites-enabled/yourVhostFile.conf
  3. Add the following lines behind <VirtualHost *:80> and </VirtualHost>
    • Code: Select all

              RewriteEngine On
              RewriteCond %{HTTPS} off
              RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  4. Restart apache2
After that, all client come from http are redirect to https.
pat2
Posts: 156
Joined: Fri Sep 16, 2016 6:35 pm

Re: Zoneminder in HTTS only

Post by pat2 »

thanks.I will try.

Only a question: i understand the rule you are suggesting is for all the web pages managed on my server (on my server I'm managing a website and ZM).

Is it possible to apply a rule only in case the web address is //serverip/zm or //serverip/zm/...?

thanks
---------------------------------------------------------------------------
ZM 1.36.34 - 14 cameras on Orange Pi 5 (arm64) - Ubuntu Jammy 22.04
vox

Re: Zoneminder in HTTS only

Post by vox »

I think it's possible if you add the lines in
  • Code: Select all

    <Directory /var/www/html/zm>
                                   # HERE
    </Directory>
Need to be try ;)


If it's not working you can try to use a dedicated VirtualHost for your ZoneMinder and use ServerName yourZoneMinderHostname
Locked