简体   繁体   English

如何使用Apache服务器从URL中删除端口号?

[英]How to remove port number from url using apache server?

I have installed Apache, PHP, Mysql in ubuntu system. 我已经在ubuntu系统中安装了Apache,PHP,Mysql。 I have changed the port of apache server 80 to 802 in httpd.conf file. 我在httpd.conf文件中将apache服务器80的端口更改为802

I am accessing localhost from the below URL successfully. 我正在从下面的URL成功访问localhost。

http://localhost:802/ HTTP://本地主机:802 /

But the thing I want to access the localhost without using port number in the URL. 但是我想在不使用URL中的端口号的情况下访问localhost的事情。 Where I need to change for this. 我需要为此更改的地方。

Please suggest. 请提出建议。

Where I need to change for this. 我需要为此更改的地方。

In httpd.conf where you set the port number to 802 , set it back to 80 . 在将端口号设置为802 httpd.conf中,将其设置回80

HTTP operates on port 80 by default, and web browsers use that default by convention. HTTP默认在端口80上运行,并且Web浏览器按照约定使用该默认值。 Since you have changed that default, you need to specify the port in the address. 由于更改了默认设置,因此需要在地址中指定端口。 Otherwise the web browser will attempt to connect to port 80 and won't find your server. 否则,Web浏览器将尝试连接到端口80,并且找不到您的服务器。

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

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