This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
我建议检查您的 WordPress 的站点/主页 URL。确保更改站点/主页 URL 以匹配端口,例如,如果您的 URL 当前为“http://localhost”(默认为 80 HTTP 端口),那么当您尝试访问时看到重定向发生绝对是正常行为访问“http://localhost:81”。
请尝试在 WordPress URL 末尾添加“:81”,看看效果如何。
I would recommend checking the Site/Home URL of your WordPress. Make sure to change the Site/Home URLs to match the port, for example, if your URL is currently "http://localhost" ( 80 HTTP port by default ) it is absolutely normal behavior to see a redirection occur when you attempt to visit "http://localhost:81".
Please try adding ":81" at the end of your WordPress URL and see how it goes.
我不知道它是如何工作的,但它确实有效。我删除了所做的所有更改,然后重新开始。
现在我没有触及 000-default.conf 文件,我只是添加了 wordpress.conf 文件并在其中编写了下面提到的 vhost 代码。
让我通过运行
$apache2ctl configtest
命令来测试 Apache 语法,它显示 syntax ok。然后我通过运行 $service apache2 reload 重新加载 apache 服务器;
最后,我打开 172.20.xy:81,上面写着“您无权访问”,此时我取消了 apache2.conf 文件上的某些代码部分的注释在/etc/apache2/。
就像
更改为
再次重新加载 Apache 服务器一样。最后,它可以正常工作了。
I do not know how it works, but it works. I erased all the changes I had made and started doing it all over again.
Now I did not touch the 000-default.conf file, I just added the wordpress.conf file and wrote vhost code mentioned below in it.
Let me test the Apache syntax by running the
$apache2ctl configtest
command, it shows syntax ok.Then I reload the apache server by running
$service apache2 reload
;Finally, I open 172.20.x.y:81, which says "You do not have permission to access", At which point I uncommnent some parts of code on apache2.conf file at /etc/apache2/.
It was like
Changed to
Again I reload the Apache server. Finally, it works properly.