 |
 |
Personal Web Sharing and its port
|
 |
|
 |
|
Junior Member
Join Date: Nov 2001
Status:
Offline
|
|
How do I alter the Personal Web Sharing service's settings to use a different port?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2002
Status:
Offline
|
|
open the terminal (applications/utilities)
and type 'sudo pico /etc/httpd/httpd.conf'
then use the keyboard to control-v (next page) until you see a line that reads 'port 80' change the 80 to whatever port you want to use. then control-o to save and control-x to exit.
restart websharing in the prefs.
check the firewall settings to make sure the port your using is open.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Apr 2000
Status:
Offline
|
|
sudo pico /etc/httpd/httpd.conf
control-w, 80
(comes to the first result)
control-w, 80
(comes to port num)
Change it. Save. Exit. Restart Apache.
EDIT: beat me...
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2002
Status:
Offline
|
|
Yeah, but your way's faster.
oh, the irony. 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2001
Status:
Offline
|
|
Originally posted by Cipher13:
sudo pico /etc/httpd/httpd.conf
control-w, 80
(comes to the first result)
control-w, 80
(comes to port num)
Change it. Save. Exit. Restart Apache.
EDIT: beat me...
Question -- if you do this is the built-in firewall smart enough to realize this and will it open the correct port when you start up Apache?
Currently I find it very nice that if you turn on web sharing, it automatically opens port 80 in the firewall. And when you turn it off, it closes port 80. If you have Apache listening on port 8080 for example will you have to modify the firewall settings?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2002
Status:
Offline
|
|
Originally posted by CatOne:
Question -- if you do this is the built-in firewall smart enough to realize this and will it open the correct port when you start up Apache?
Currently I find it very nice that if you turn on web sharing, it automatically opens port 80 in the firewall. And when you turn it off, it closes port 80. If you have Apache listening on port 8080 for example will you have to modify the firewall settings?
I think it's fair to say you would need to set up and open/close the port as required. But give it a shot, you might be surprised to realise that Apple thinks of little things like this sometimes.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Nov 2001
Status:
Offline
|
|
Thank you guys!
It worked.
I changed port 80 to port 8000.
However in the URL I have to add":8000" at the end of my IP or it won't work.
Also I noticed that in the Firewall preferences it still says (80, 427).
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by alxalxnet:
However in the URL I have to add":8000" at the end of my IP or it won't work.
That is because 80 is the default port for web services. It's just like you have to specify a port for telnet if you use anything other than 23.
Of course with apache, you can listen on multiple ports, and have different pages served on different ports. You can even assign multiple IPs to the same machine and server different sites based on which IP is requested. Apache is very flexible.
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Nov 2001
Status:
Offline
|
|
Originally posted by Arkham_c:
That is because 80 is the default port for web services. It's just like you have to specify a port for telnet if you use anything other than 23.
Of course with apache, you can listen on multiple ports, and have different pages served on different ports. You can even assign multiple IPs to the same machine and server different sites based on which IP is requested. Apache is very flexible.
So how do I change the default port for web services to 8000 (or anything else)?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Nov 2001
Status:
Offline
|
|
Originally posted by alxalxnet:
So how do I change the default port for web services to 8000 (or anything else)?
I don't think you can. How is the client going to know that the server is running on a nonstandard port?
I'll give you a hint: It's not
These things all run on "well known ports." If you start moving ports around, then you're going to have to tell the client to use the nonstandard ports. And that can be done by taking the port to the end of the URL, as you've seen.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Apr 2000
Status:
Offline
|
|
Impossible. Unless you set up port mapping on your router, but that sort of defies the point of changing the port in the first place - the outside world would still hit 80.
You must add  ortnum when it is not standard, with any protocol.
As for the firewall, just chuck a rule in to open up the port (the built in firewall uses ipfw, I assume).
Personally, I'd ditch the built-in firewall. It's pretty useless, really.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|