change default apache port
I have question about apache, as I know, by default apache work on port 80, I need to change this default port to another, say 8080.
actually, I have changed this port successfully, by editing on apache config开发者_运维技巧uration on the
Listen 80
to Listen 8080
but the problem is, I need to add :8080 inside url, so I request site with like this: http://localhost:8080
Is it possible to remove 8080 on the url?
because I need to off port 80, without getting down the server for public access.
It is not possible to connect a standard browser to a non-standard HTTP port without explicitly declaring the port as part of the URL, no.
try...
http://httpd.apache.org/docs/2.0/vhosts/examples.html
You have multiple domains going to the same IP and also want to serve multiple ports. By defining the ports in the "NameVirtualHost" tag, you can allow this to work. If you try using without the NameVirtualHost name:port or you try to use the Listen directive, your configuration will not work.
Server configuration
Listen 80
Listen 8080
NameVirtualHost 172.20.30.40:80
NameVirtualHost 172.20.30.40:8080
<VirtualHost 172.20.30.40:80>
ServerName www.example1.com
DocumentRoot /www/domain-80
</VirtualHost>
<VirtualHost 172.20.30.40:8080>
ServerName www.example1.com
DocumentRoot /www/domain-8080
</VirtualHost>
<VirtualHost 172.20.30.40:80>
ServerName www.example2.org
DocumentRoot /www/otherdomain-80
</VirtualHost>
<VirtualHost 172.20.30.40:8080>
ServerName www.example2.org
DocumentRoot /www/otherdomain-8080
</VirtualHost>
精彩评论