Score:0

Debian web access apache2 for mail server

bo flag

i am responsible for my mail server i am new to Debian and mail server aswell i am facing issue after install the ssl certificate the page still shows http:// not https:// i use to see this command root@mail:/# apachectl -S

the output comes like this

*VirtualHost configuration:

*:80                   mail.12345.com (/etc/apache2/sites-enabled/000-default.conf:1)
*:443                  mail.12345.com (/etc/apache2/sites-enabled/000-default.conf:31)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex ssl-stapling-refresh: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33*

enter image description here

my (/etc/apache2/sites-enabled/000-default.conf)

<VirtualHost *:80>
        
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        Redirect  / https://webmaster@localhost

    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

      
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

SSLEngine On
SSLCertificatefile /etc/ssl/1/1.pem
                SSLCertificateChainfile /etc/ssl/1/1.ca-bundle
                SSLCertificatekeyfile /etc/ssl/1/1.key

RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteRule ^/?(.*) https://%{}/$1 [R,L]

</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

why i cant redirect the https page?

Score:0
in flag

RewriteCond %{HTTPS} !=on will match on HTTP-Connections. You have accidentally put the 'HTTP -> HTTPS'-Rule in the HTTPS-Part of the Server. Just move the three Lines in the upper VirtualHost.

Ana Mal avatar
bo flag
hi Thanks for your comment still facing the same issue after move to upper side any idea
crpb avatar
in flag
Oh, didn't even think that far :-). `a2enmod rewrite`
Ana Mal avatar
bo flag
After this command restart the apache2 but still i have facing same issue even with new browser
Ana Mal avatar
bo flag
any one well known & skilled in apache2 web server, kindly help me out
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.