Hi i want to change port in apache2. i was running owncloud on standard ports http=80 https=443. For some reasons i need to change https port from 443 to 8443. i have seen many solutions but i dont come to hundred percent result what i want. i just want that when i write my hostname "server" then i just see my owncloud page. when i write my ipadress then i no need to mention port number but when i write "server" then i need to mention port number 8443 then it works. i am using Ubuntu 16.04 LTS. i have tried everything on virtualhost and also by ports.conf. kindly tell me some solution if someone know .Thanks in advance
Browser knows default ports (80, 443).
http:// is also default. So when you write
Your browser actually makes a request
If you type in
Your browser will make a request
In fact it is a little more complicated, because you cannot access the network name directly. Browser finds out IP of the server and makes request
http://<ip of server>:80/
and tells the server that the request is for
server, because you can host also
server2,... on the same IP address.
You will not be able to make browser to request port 8443 by default. You will have to write it in the address.
The problems you are describing are not all clear to me, but it looks like they are all connected with apache configuration and the inability of browser to go to 8443 port by default.
When you have VirtualHost defined in apache, you must specify
ServerName. Clients will arrive to the IP of server, but apache needs to know which server name was requested to send back the correct pages. If you access server only with IP the name will not be sent to apache and it will send back the default pages. I suspect that is happening in your case, because you say that browsing to IP works. I would suspect it works to default port numbers.
I hope I helped to clear out the questions at least a bit.