【问题标题】:how can I shorten my local url to just localhost?如何将我的本地 URL 缩短为 localhost?
【发布时间】:2015-06-13 18:53:55
【问题描述】:

我在 Mac 上,我使用 MAMP 加载我的 Laravel 应用程序。

当前网址:http://localhost:8000/

我想将我的网址更改为:http://localhost/

我尝试将服务器名称更改为localhost,但似乎没有生效。

httpd.conf

#Listen 12.34.56.78:80
Listen 8000

.
.
.
.
.
ServerName localhost

有人可以教我怎么做吗?有可能吗?

【问题讨论】:

  • http://localhost/http://localhost:80/ 相同这一事实可能会为您指明正确的方向。
  • 但是当我输入http://localhost/ .. 没有任何效果。
  • 那是因为您将 Apache 配置为侦听端口 8000。
  • 那么我需要设置我的Apache configured 以使其仅适用于:localhost

标签: apache laravel localhost mamp httpd.conf


【解决方案1】:

你可以通过php artisan serve --port=80在端口80上启动服务器

【讨论】:

  • 我收到了Failed to listen on localhost:80 (reason: Permission denied)
【解决方案2】:

在您的 httpd.conf 中将 Listen 8000 更改为 Listen 80

【讨论】:

    猜你喜欢
    • 2013-12-26
    • 1970-01-01
    • 1970-01-01
    • 2018-05-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-08
    • 2010-09-25
    相关资源
    最近更新 更多