Jump to content

Virtual Host Port 80 And 443 Document Directory


webthinkers

Recommended Posts

What should be the document directory for

virtualhost:80

And 

virtualhost:443

should both the document root directory be same , we are getting 404 error on SSL 443 port

 

<VirtualHost *:80>
   ServerAdmin [email protected]
   ServerName www.example.com   
   ServerAlias  example.com
   DocumentRoot /var/www/html/example.com
<Directory /var/www/html/example.com>
   Options +FollowSymlinks
   AllowOverride All
   Require all granted
</Directory>
    ErrorLog /var/log/apache2/example.com-error_log
    CustomLog /var/log/apache2/example.com-access_log common
</VirtualHost>

<VirtualHost *:443>
   ServerAdmin [email protected]
   DocumentRoot /var/www/html/example.com
  <Directory /var/www/html/example.com>
        Options +FollowSymLinks
        AllowOverride none
        Require all granted
        RewriteEngine On
        </Directory>
  ServerName www.example.com
  ServerAlias example.com
  ServerAlias mail.example.com
  SSLEngine on  
  SSLCertificateFile /etc/letsencrypt/live/example.com/certificate.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/example.com/private.pem
  SSLCertificateChainFile /etc/letsencrypt/live/example.com/fullchain.pem  
                ErrorLog ${APACHE_LOG_DIR}/error.log
                #CustomLog ${APACHE_LOG_DIR}/access.log
</VirtualHost>

 

Edited by webthinkers (see edit history)
Link to comment
Share on other sites

  • webthinkers changed the title to Virtual Host Port 80 And 443 Document Directory
8 hours ago, ndiaga said:

Hi,

I  see you  are  using  the  same  URL  and  document  root   with  in  two  different  ports  ?

 

Is it not possible to to configure same URL for port 80 and same for port 443, if not it is very hard to troubleshoot which URL to use for ports, we are having only 1 URL to configure and what other document root can we use, PS is in that document root.

So that is why SSL lock is not there.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...