How to open a new port in apache - apache

I want to open a new port in apache so that i can accept http requests on the port with http://ip:port

Check Binding to Addresses and Ports:
For example, to make the server accept connections on both port 80 and
port 8000, on all interfaces, use:
Listen 80
Listen 8000
To make the server accept connections on port 80 for one interface,
and port 8000 on another, use
Listen 192.0.2.1:80
Listen 192.0.2.5:8000
IPv6 addresses must be enclosed in square brackets, as in the
following example:
Listen [2001:db8::a00:20ff:fea7:ccea]:80

Related

Stopping https port on wsubdomain

I would like to set a server on port 443 to handle safari web notifications. So I would like to disable port 443 from Apache for that subdomain. I tried doing it by removing the web domain from ssl.conf or setting SSLEngine off after putting the domain on port 80, but in all cases when I execute nmap on the domain port 443 always pops up, and when I execute the other service on port 443 I get an error.
How do I manage it?

Running Apache and NGINX at the same time

I currently have Apache configured and serving content over port 80 and 443.
I wish to serve content over port 8000 using NGINX. I've followed this guide.
in /etc/nginx/sites-available/default I changed
server {
listen 80 default_server;
....
to
server {
listen 8000 default_server;
....
According to the guide, this show allow me to access both
http://my_ip_or_domain:8000
http://my_ip_or_domain:80
at the same time. However, I can access it via port 80, but going over port 8000 returns a ERR_CONNECTION_TIMED_OUT. There's no output in /var/log/nginx/error.log. How can I access it using port 8000?
You have to open the specified port
$ sudo ufw allow 8000
This command would open the 8000 port

Apache port changed but still have to http://localhost:81/dashboard/

I changed Apache port from 80 to 81 because 80 is used by skype.
(I did this
Locate the following lines :
#Listen 12.34.56.78:80
Listen 80
ServerName localhost:80
Replace them by :
#Listen 12.34.56.78:81
Listen 81
ServerName localhost:81)
Long story short, if I do http://localhost:81/dashboard/ it works but I want to only use http://localhost/dashboard/.
I did Xampp -> Config -> Service and Port Settings -> Main port changed from 80 to 81 and SSL port still 443
I'd like to know where's the mistake and how can I repair it.
If you want to open http://localhost/dashboard/ your apache should work on port 80, this is default http port.
So you have to open skype and go to Tools->Options->Advanced->Connection and uncheck "Use port 80 and 443 for additional incoming connections"
The HTTP protocol is set to port 80 by the IANA standards. If you want to use connect to an HTTP server on another port, you must add the port to the URI, as in http://localhost:81/
Now, you can edit /etc/services on a linux box and change 'http' to 81, but this is not recommended, as any other HTTP connections from that host to all servers will all try to connect to port 81, which will break all HTTP clients. (Seriously, this will probably break all kinds of things you don't expect. Just use the port in the URI.)
You can change skype's default port as follow...
Go to Tools -> Options -> Advanced -> Connection and uncheck the box "use port 80 and 443 as alternatives for incoming connections"
Anyway your apache must work on port 80 in order to access http://localhost/dashboard without mentioning a port.

What is correct way of forwarding Standard HTTP and HTTPS ports to another

I have a SSL server started on port 8080.
I want to redirect all browser requests to this port
from 80 (http://...) and from 443 (https://...)
Should I do
1) 80 forward to 8080; 443 forward to 8080 or
2) 80 forward to 443; 443 forward to 8080
Is there any difference in these approaches and what is correct?
Thanks!

WAMP apache httpd.config and hosts - how to alias localhost to port 8080?

Ok so I configured my apache installation on Windows 7 such that it listens on port 8080 by changing the respective entry in httpd.config.
I was too stupid to realize that now I have to access localhost with :8080 at the end.
Question: is there a way to have my box automagically resolve localhost to 127.0.0.1:8080 ? I don't like haviog to type :8080, and NO I CANNOT change the port to 80, I need that one for firewall.
Thanks
no. hostnames have nothing to do with ports. You'll have to specify the port yourself, or set up a proxy on the usual port 80 that will do the 8080 requests on your behalf. ... or bite the bullet and use port 80 directly and move your firewall elsewhere.