大网数据广告活动
服务器运维问答

How to rename default-ssl.conf in Apache 2.4

· 52CE 我爱测

I'm running Apache 2.4 on Ubuntu. I'm trying to rename default-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 …

问题原文

原帖链接 · 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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-04-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。