简体   繁体   English

我如何删除网址中的端口号

[英]How i can remove port number in url

I am using laravel framework in ubunto system and I want to remove port number from my url 我在ubunto系统中使用laravel框架,我想从网址中删除端口号

write now I can access my web-project with this url 现在写,我可以用这个URL访问我的web项目

http://localhost:8000

and I want this url 我想要这个网址

http://localhost/

How can I do this? 我怎样才能做到这一点?

80是http的默认端口号,因此您必须使用以下命令省略端口号:

sudo php artisan serve --host=localhost --port=80

If nothing else (eg Apache oder Nginx) uses port 80 you COULD start the development webserver like this 如果没有其他东西(例如Apache oder Nginx)使用端口80,则可以像这样启动开发Web服务器

 sudo php artisan serve --port 80

You can access the app via http://localhost/ afterwards 之后您可以通过http:// localhost /访问该应用程序

Note that this is ONLY for development and some kind of hack. 请注意,这仅用于开发和某种破解。 Install a dedicated webserver (Apache, Nginx) for production :-) 安装专用的Web服务器(Apache,Nginx)进行生产:-)

你可以试试

sudo php artisan serve --port=80

请勿在命令行中使用php artisan服务器,并在浏览器地址栏中使用完整的URL路径,如下所示

http://localhost/projectname/public

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

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