website error after change apache port - apache

I need to change the apache port to my site, I tried putting in port.conf listen 8080 (instead of 80) and NameVirtualHost *: 8010 (instead of 80), regarding the 000default.conf I set (again instead of 80) but now when I open my site: xxxx.ddns.net I get nothing and the site appears to me only if I specify the port, putting xxxx.ddns.net: 8010, how can I change the port and ensure that the site appears without the need to specify the port?
Thanks

Although I don't understand why 8010 and 8080 aren't the identical port and obviously default.conf should not be overriden...
Port Redirection is a job for your Firewall/NAT (FritzBox?). A browser will always try to connect to port 80 and the NAT will redirect it to port 8080 (8010?) in your local network.

Related

DNS record with different ports

I have a very cheap VPS with the IP 123.123.123.123 which listens on these ports: 7000, 7001, ... 7020. Apache listens on port 7010. Then I can access my website with http://123.123.123.123:7010.
As this is a shared IP, I cannot listen on port 80 myself with my VPS: I only have access to 7000 ... 7020.
I have registered a domain mydomain1.com by a domain provider and I'm using their nameservers.
How to set up the DNS records such that any user going on http://www.mydomain1.com will be transparantly directed to my website, with Apache ? (the browser will probably default to port 80, is that right?)
I initially thought about such a DNS record:
Name TTL Type Priority Content
*.mydomain1.com 3600 A 0 123.123.123.123
but then, I think I would have to access the website with http://www.mydomain1.com:7010 (which is not nice) and not http://www.mydomain1.com (which would be better).
Unfortunately you cannot specify ports on DNS records. The only way to make it work as you expect is to have a reverse proxy running elsewhere (nginx, haproxy), listening on port 80, and then forward traffic to your server.
Some useful information about HTTP proxying with nginx:
What is a reverse proxy?
Configuring nginx as a reverse proxy for apache

Apache named virtual host not working after changing port

I have a jboss server and an apache web server on the same machine. Jboss has to stay listening on port 80, so I had to switch which port apache listened on. Before, when it was listening on port 80, everything worked fine. I set up a virtual host for a website I'm working on, and I was able to use the URL for that site as a I defined it in the virtual host file and my hosts file (I'm using Windows). After I changed the port it listened on, I get the following error:
Problem loading page: Unable to connect
I've restarted the server, restarted my machine, changed the port to several different numbers that weren't being used for anything else, and I even tried changing the localhost IP address from 127.0.0.1 to 127.0.0.2 to see if that would help, but none of this has worked. I changed the port in both httpd.conf and httpd-vhosts.conf, but nothing has really worked. I checked the IP address for the site with ping, and it showed that I'm using the right one. I would really appreciate some help because nothing is working.
Likely a local firewall issue. You should only need to change Listen, ServerName and <virtualhost>. You can use lsof or netstat to confirm the listening port.

Xampp port for apache

so i installed Apache via xampp, but it kept saying the port 80 is being used and I should change the port, so I went into the config and changed the port to 81.
It was then able to start successfully, but I was wondering is there a downside to this? will anything go wrong or work differently now that I changed to port to 81?
One downside could be that you would have to access your instance by stating the port number (myserver:81). Port 80 is the default so when you access myserver, port 80 is understood.

Shorten Localhost URL

I recently changed my Apache Server's port number from 80 to 8079. Now when I need to access my localhost, I have to type http://localhost:8079. How can I access my localhost again by typing only http://localhost?
Change it back to 80. 80 is the HTTP port, 443 is the standard HTTPS port. If you want to use something different, you're going to have to include the port.

https(apache + ssl) is only available from locahost, how to configure to visit it by domain name?

apache + ssl is configured using xampp on windows server 2003. http content has no problem by domain name, but https content can only be visited from localhost. "netstat -a" shows
Proto Local Address Remote Address State
...
TCP hostname:https hostname:0 Listening
...
How to config to enable https via domain name?
Found the reason. Another program take the 443 port so apache https failed. use "netstat -a -o -n" can get the detail.
I'm assuming you can already access apache using this domain name.
Take a look in your ports.conf, usually found at
/etc/apache2/ports.conf
It should contain a line like:
NameVirtualHost *:443
and also
Listen 8443 https