Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Why does SSL work when the ports.conf file is setup this way:
Code:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *
Listen 80
<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
<VirtualHost *:443>
ServerName 75.71.130.52
DocumentRoot /var/www-ssl/
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
</VirtualHost>
</IfModule>
and not work when it is setup this way:
Code:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *
Listen 80
<VirtualHost *:80>
ServerName 75.71.130.52:80
DocumentRoot /var/www/
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
<VirtualHost *:443>
ServerName 75.71.130.52
DocumentRoot /var/www-ssl/
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
</VirtualHost>
</IfModule>
The above returns the following error:
Code:
ssl_error_rx_record_too_long
Can I not run both non-ssl virtual hosts and ssl virtual host together?
Thanks for the response. I tried that, and it didn't work.
Here's what it looks like now:
Code:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:80
NameVirtualHost *:443
Listen 80
<VirtualHost *:80>
ServerName 75.71.130.52
DocumentRoot /var/www/
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
<VirtualHost *:443>
ServerName 75.71.130.52
DocumentRoot /var/www-ssl/
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
</VirtualHost>
</IfModule>
SSL still returns
Code:
An error occurred during a connection to localhost:443.
SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)
From the config file you've posted it looks like you're running apache on debian. If that's the case, take a look at this guide to see how to enable SSL for apache on debian.
From the config file you've posted it looks like you're running apache on debian. If that's the case, take a look at this guide to see how to enable SSL for apache on debian.
Followed that guide to the letter, and it still doesn't work. That's how I set it up to begin with.
Code:
root@eric-desktop:~# sudo /etc/init.d/apache2 restart
* Restarting web server apache2 [Mon Aug 17 00:20:15 2009] [error] VirtualHost _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Aug 17 00:20:15 2009] [error] VirtualHost *:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Aug 17 00:20:15 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Aug 17 00:20:15 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[Mon Aug 17 00:20:15 2009] [warn] NameVirtualHost *:443 has no VirtualHosts
... waiting [Mon Aug 17 00:20:17 2009] [error] VirtualHost _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Aug 17 00:20:17 2009] [error] VirtualHost *:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Aug 17 00:20:17 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Aug 17 00:20:17 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[Mon Aug 17 00:20:17 2009] [warn] NameVirtualHost *:443 has no VirtualHosts
Code:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
Listen 80
<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
</IfModule>
NameVirtualHost *:443
NameVirtualHost *:80
<VirtualHost *:80>
ServerName 75.71.130.52
DocumentRoot /var/www/
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName 75.71.130.52
DocumentRoot /var/www-ssl/
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
</VirtualHost>
Running apache in debian could be a little tricky. There are different config files that you have to edit to make it work.
The 2 Listen directives go in ports.conf. If you want to use ssl you have to enable the ssl module. If you want to create a ssl vhost you have to put its config in sites-available and enable vhost. I hope this could be helpful.
Running apache in debian could be a little tricky. There are different config files that you have to edit to make it work.
The 2 Listen directives go in ports.conf. If you want to use ssl you have to enable the ssl module. If you want to create a ssl vhost you have to put its config in sites-available and enable vhost. I hope this could be helpful.
Regards
I've tried everything, and I still cannot get it to work. Any other ideas?
You problem looks like the one in post 48 in the 1st link I gave you. Take a look at the reply next to it to see if it helps.
Another idea is to uninstall apache and all its config files and then reinstall apache and configure it from scratch using a good howto. Use either one of the previous posts, or maybe this and pay attention to the comments.
You problem looks like the one in post 48 in the 1st link I gave you. Take a look at the reply next to it to see if it helps.
Another idea is to uninstall apache and all its config files and then reinstall apache and configure it from scratch using a good howto. Use either one of the previous posts, or maybe this and pay attention to the comments.
Regards
Thanks for all of the help, but I just can't get it to work.
According to post 49, I should delete 000-default file?
Anything else I can try, as I really have read these guides, but it just doesn't want to handle both ssl and non-ssl connections.
According to post 49, I should delete 000-default file?
This is a symlink to /etc/apache2/sites-available/default. I guess you can delete it, but I suggest you to do a recursive search on all these config files and make sure that you use "NameVirtualHost *:80" and "NameVirtualHost *:443" in all of them. Something like that:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.