-1

Possible Duplicate:
How to redirect localhost to 127.0.0.1:8080?

Due to unidentified problem, any service pid4 is using port 80 of my Windows 7-64 bit PC's. I ultimately decided to change my default port to 8080. But how can I change the way that when I enter localhost in URL, then automatically the data from 127.0.0.1:8080 comes.

I also edited the hosts file as

127.0.0.1:8080 localhost

but it didn't work. It;s showing as Not Found. Please help me someone.

Community
  • 1
  • 1
Thompson
  • 1,954
  • 10
  • 33
  • 58

2 Answers2

1

Some reason you can't disable the service using the port?

Also, the entire 127...* block is reserved for loopback, you can try to bind the apache server to something like 127.1.1.1 instead of 127.0.0.1

Edit: Is there also some reason you can't just bookmark it, port and all?

Wug
  • 12,956
  • 4
  • 34
  • 54
0

Short answer, you cannot. The hosts file contains address-name(s) pairs, no ports.

For example, if you put

127.0.0.1 localhost mypc someothername

in your hosts file, you could use http://localhost or http://mypc or http://someothername and always end up on your local host.

For the process blocking port 80, check this blog, possible culprits include SSRS, IIS or Web Deployment Agent Service

fvu
  • 32,488
  • 6
  • 61
  • 79