apache - SSL with main domain name not working but subdomains do -
so cannot web server ssl work properly. i've googled 4 hours trying work, i've had no luck.
let's domain name example.com.
i have main site @ https://example.com , have 4 subdomains 1.example, 2.example,3.example , 4.example.
now thing is, can access subdomains fine, when try access main domain says cannot connect site. doing wrong ??.
using apache 2.4.20 stable on ubuntu 16.04.
here configuration im using virtualhosts:
<virtualhost *:443> serveradmin webmaster@localhost loadmodule headers_module modules/mod_headers.so documentroot /var/www/example.com <directory /var/www/example.com> options followsymlinks includes execcgi allowoverride require granted allow </directory> scriptalias /cgi-bin/ /usr/lib/cgi-bin/ <directory "/usr/lib/cgi-bin"> allowoverride none options +execcgi -multiviews +symlinksifownermatch order allow,deny allow </directory> errorlog ${apache_log_dir}/error.log # possible values include: debug, info, notice, warn, error, crit, # alert, emerg. loglevel warn redirectmatch 404 \.token$ customlog ${apache_log_dir}/access.log combined sslengine on sslcertificatefile /etc/apache2/certs/cert sslcertificatekeyfile /etc/apache2/certs/key servername www.example.com
serveradmin webmaster@localhost loadmodule headers_module modules/mod_headers.so documentroot /var/www/1.example.com <directory /var/www/1.example.com> options followsymlinks includes execcgi allowoverride require granted allow </directory> scriptalias /cgi-bin/ /usr/lib/cgi-bin/ <directory "/usr/lib/cgi-bin"> allowoverride none options +execcgi -multiviews +symlinksifownermatch order allow,deny allow </directory> errorlog ${apache_log_dir}/error.log # possible values include: debug, info, notice, warn, error, crit, # alert, emerg. loglevel warn redirectmatch 404 \.token$ customlog ${apache_log_dir}/access.log combined sslengine on sslcertificatefile /etc/apache2/certs/cert sslcertificatekeyfile /etc/apache2/certs/key servername www.1.example.com
... when try access main domain says cannot connect site.
since there web server running on subdomains says cannot connect main site guess main site has different ip address subdomains. in case not matter how config of web server looks because web server @ different ip address , not find one.
to check ip address host client (and matters) can use tools dig or nslookup on unix , mac or or nslookup on windows. if see subdomain resolve different ip address main domain have found cause of problem.
Comments
Post a Comment