i am facing an issue with my vHost setup which I rly can’t figure out how to fix
First my vhost config:
<VirtualHost *:80>
ServerName dnsmaster.*****.com:80
DocumentRoot /var/www/dns
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/dns>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName chat.*****.com:443
DocumentRoot /var/www/chat
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/chat>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
</VirtualHost>
Both vHost are located in the default file (000-default)
The first vHost works fine, and are also working with SSL/HTTPS but when I try to go to second vHost, then it redirects me to the first one.
I’ve never faced this problem before, and have been setting a few vHosts up in the past.
But never 2 vHost where one is HTTPS and the other is HTTP
also this is the ports.conf: (default)
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
NameVirtualHost *:443
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello Pablo, <br> <br>I’ve tried editing the NameVirtualHost *:443 to both IP and FQDN, didn’t work either. <br>They are saved in /etc/apache2/ssl/ <br>
The problem isn’t the HTTPS/SSL Site, the problem is the non-sll/HTTP site, if I go to that one, it redirects me to the HTPPS/SSL site
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.