问题原文
原帖链接 · lacton · CC BY-SA 3.0
I'm running Apache 2.4 on Ubuntu. I'm trying to renamedefault-ssl.conf, but I can't get it to work.
Here is what works.
If I enable the SSL module
a2enmod ssl
and the site configuration file
a2ensite default-ssl.conf
and start httpd
service apache2 start
then httpd serves on port 443 SSL-encrypted contents from /var/www/html, exactly as expected. So far so good.
Here is what doesn't work.
If I rename the default configuration file
mv /etc/apache2/sites-enabled/{default-ssl.conf,foobar}
service apache2 restart
then httpd sends clear text responses on port 443, and responds to "GET /" with an index of /var/www.
What makes the name default-ssl.conf so special? How can I rename it without breaking everything?
社区高分解答
原帖链接 · andrekeller · CC BY-SA 3.0
You need to make sure the new configuration name ends with .conf
As this is only a symlink created by the a2ensite command, you probably want to rename to actual configuration file:
a2dissite default-ssl
mv /etc/apache2/sites-available/default-ssl.conf \
/etc/apache2/sites-available/foobar.conf
a2ensite foobar
service apache2 reload
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
