I try to access the apache server on another machine (Even at localhost). I used
wireshark to get the port number of the packets which are random port number vs 80. This is correct.
But at the mean time, I tried to print out the port number at in the kernel myself at ip_rcv() which tcph->source and tcph->dest. It turned out that these two port numbers are also random.
Not sure what I am doing wrong, can anybody tell me where I can get the correct port number from kernel?
You can't get the port number from any kernel, to set the port number for a Linux web-server do the following if you have apache:
Apache
, then go to /etc/apache2/ports.conf
and change the 80
to a desired number of your choice service apache2 restart
http://SERVER-IP:portnumber
NOTE: If you change the port number from 80 you must enter the new port number after the url/IP.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.