简体   繁体   English

本地Apache2实例的ServerName

[英]ServerName for local Apache2 instance

I wanted to create my own self signed SSL certificate and add it to the local Apache2 instance (ie changing http://localhost/ to https://localhost/ ). 我想创建自己的自签名SSL证书并将其添加到本地Apache2实例(即,将http:// localhost /更改为https:// localhost / )。 However, I'm stuck at the part on what to put under the server IP in default-ssl.conf file. 但是,我在default-ssl.conf文件中的服务器IP下放置了什么内容。 I'm referring to this resource to create the SSL certificate. 我指的是此资源来创建SSL证书。 I tried putting "127.0.0.1", "localhost" and the private IP address (in this case it's 10.0.2.15) under the "ServerName" part. 我尝试将“ 127.0.0.1”,“ localhost”和专用IP地址(在本例中为10.0.2.15)放在“ ServerName”部分下。 However, it's still failing with the following error. 但是,它仍然失败,并显示以下错误。

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
(13) Permission denied: make_sock: could not bind to addres 0.0.0.0:80
no listening sockets available, shutting down

Can anyone please give some hints on what went wrong? 任何人都可以对发生问题的地方提供一些提示吗? I'm running out of ideas (or things to google) why the server name is wrong... 我的想法(或Google的事情)用光了,为什么服务器名称错误...

The first few lines of my default-ssl file: 我的default-ssl文件的前几行:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
    ServerAdmin temp@temp.com
    ServerName localhost

Ironically the issue seems to have resolved by itself... Not too sure what happened but now I'm facing another issue (which I posted on Unable to change the document root of https://localhost/ ) 具有讽刺意味的是,这个问题似乎已经自行解决了……不太确定发生了什么,但是现在我遇到了另一个问题(我在无法更改https:// localhost /的文档根目录上发布了此问题)

I kept the code as it is: 我将代码保持原样:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
    ServerAdmin temp@temp.com
    ServerName localhost

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM