【问题标题】:ubuntu apache set https errorubuntu apache设置https错误
【发布时间】:2018-06-14 23:57:30
【问题描述】:

这是“000-default”文件的内容:

 <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName myServeName
    DocumentRoot /var/www/test
    #<Directory "/var/www">
     #   Options Indexes FollowSymLinks
      #  AllowOverride None
       # Order allow,deny
       # Allow from all
    #</Directory>
    ErrorLog /var/www/test/judianer-error.log
    CustomLog /var/www/test/judianer-access.log common
</VirtualHost>

和apache可以使用,浏览器可以访问http:(myserveName),但是当我在底部添加内容时:

<VirtualHost *:443>
    SSLEngine on
        SSLCertificateFile /etc/apache2/ssl/214399318900951.pem
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/test
        ServerName myserveName
        #<Directory />
         # Options FollowSymLinks
          #AllowOverride All
#       </Directory>
#       <Directory /var/www/>
#       Options FollowSymLinks MultiViews
#       AllowOverride None
#       Order allow,deny
#       allow from all
        # This directive allows us to have apache2's default start page
        # in /apache2-default/, but still have / go to the right place
        #RedirectMatch ^/$ /apache2-default/
#       </Directory>
</VirtualHost>

我的 apache 无法启动。如何解决。

【问题讨论】:

    标签: apache ubuntu https


    【解决方案1】:

    您需要一个 SSLCertificateKeyFile

    并检查 LoadModule ssl_module /usr/lib64/apache2-prefork/mod_ssl.so

    如果要使用目录 www/test,请使用:

    <Directory /var/www/test> 
    Options FollowSymLinks 
    AllowOverride None
    Require all granted
    </Directory>
    

    【讨论】:

    • hello.i 编辑 conf.but https:myserveName 仍然转到 'www'(dictionary) ,我想设置为 'www/test'(dictionary)。如何编辑?现在我的conf是
    • apache现在启动了吗?
    • 是的。现在我的配置是: #SSLEngine on #SSLCertificateFile /etc/apache2/ssl/214399318900951.pem ServerAdmin webmaster@localhost DocumentRoot /var/www/test ServerName www.wenjunlin.xyz # # Options FollowSymLinks #AllowOverride All #
    • 我知道我的错误。我应该在 'default-ssl.conf' 中编辑 443 中继的 conf,而不是在 '000-default.conf' 中。仍然非常感谢您
    猜你喜欢
    • 2015-08-15
    • 1970-01-01
    • 2011-05-01
    • 2018-11-11
    • 2022-12-30
    • 2014-02-11
    • 2020-11-18
    • 2018-04-17
    相关资源
    最近更新 更多