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

What is the difference between default-ssl.conf and what is 000-default-le-ssl.conf?

· 52CE 我爱测

default-ssl.conf is quite self-explanatory. I assume it's for default values that would be used when no vhost or other config overrides it. But what exactly is 000-default-le-ssl.conf file? Why is it named the way it is? What's w…

问题原文

原帖链接 · DominicM · CC BY-SA 4.0

default-ssl.conf is quite self-explanatory. I assume it's for default values that would be used when no vhost or other config overrides it.

But what exactly is 000-default-le-ssl.conf file? Why is it named the way it is? What's with the triple zeros in front? How is it different/should be used differently from default-ssl.conf? How should either/both be used?

Regardless of which conf file I am finding very few default values I can use. With multiple domains I can't really use ServerName/ServerAlias and since each domain has it's own directory/port I can't use default DocumentRoot/Proxy either. In my case I have ssl certs generated for each domain so can't use default values there either. Even ServerAdmin could be different for each domain. Based on this use case should I just leave it almost blank or am I missing something? What is the best practice in this scenario?

I am running latest Apache Server on Ubuntu 18.04.

社区高分解答

原帖链接 · ivanivan · CC BY-SA 4.0

The 0s at the front of the file name simply force an order when a directory is scanned and the results are processed one by one.

With apache, the first virtual host read/processed is the one clients are sent to if they connect requesting a host name that your server isn't configured to serve up.

The default-le configuration sounds as if it is the one that LetsEncrypt might use for authentication/confirmation, but this is simply a wild guess based on the presence of le in the filename. To know for sure you should examine the contents, and post if you have questions.

As to defaults, etc. you can share just about all of the configuration information, or at least the parent directories of file paths, etc.

Here's a template I use, replace DOMAIN and YOURIP as appropriate.

<VirtualHost *:80>
  ServerName DOMAIN
  ServerAlias www.DOMAIN
  RewriteEngine on
  RewriteRule ^/(.*)$ https://www.DOMAIN/$1 [R,L]
</VirtualHost>
<VirtualHost YOURIP:443>
    ServerName DOMAIN
    ServerAlias www.DOMAIN
    ServerAdmin webmaster@DOMAIN
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/DOMAIN/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/DOMAIN/privkey.pem
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    CustomLog ${APACHE_LOG_DIR}/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    DocumentRoot /var/www-DOMAIN
    <directory /var/www-DOMAIN>
        Options All
                AllowOverride All
                Require all granted
    </directory>
    ErrorLog ${APACHE_LOG_DIR}/ssl-DOMAIN-error.log
    CustomLog ${APACHE_LOG_DIR}/ssl-DOMAIN-access.log combined
</VirtualHost>

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

资料来源与适用范围

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

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

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