How to host an apache server on the web? [closed] - apache

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have already installed apache on my computer. Now I want to know how to host my server on the web so that others can connect to my server and view my sites.

If you are able to view your websites over localhost already, you should be able to just port forward through your firewall to allow external access.

Make sure you are running your web-server on 0.0.0.0 interface. This can be checked by running the following command on linux netstat -anlpt. Inspect what ip is port 80 (or 443) listening. It should not be 127.0.0.1.
If this is your home computer :
You will need to forward port 80 on your router(or 443 if using ssl) to port 80 of your computer. Your computer's IP address can be seen in ifoncfig or ipconfig (windows) output. Generally your router interface will be available at an address like http://192.168.0.1 or http://192.168.1.1 (depends on your router manufacture and settings).
Once you have got port forwarding set up, your website should be accessible from internet when one types your ip address. Your IP address as shown by http://whatismyip.com
If this is not your home computer, then your website should be accessible via the public IP address of your server.
If you have a domain name, you'll want to update the nameserver config for that domain to put a A record pointing to your server's IP address and create a equivalent vhost entry in apache. However, a domain name is not required to view your website, just http://w.x.y.z IP suffices (where w.x.y.z is the public IP of your server/computer)

Related

How to forward a service to a different port in apache?

I have an ubuntu server with three services, one running on port 8080, one running on port 8181 and apache running on 80.
My question is, is there a way I can "view" the services web interface on port 80, depending on the URL?
Currently I have to access the services by:
service.domain.com:8080
and
service.domain.com:8181
what I want is:
service1.domain.com to access the service on 8080 without having to include the port and
service2.domain.com to access the service on 8181 without having to include the port
is something like this possible? I was thinking there was a way to do it via virtual hosts, but I cannot think of a clear way to phrase my question to be able to google it further.
Figured it out, thanks to this post:
Multiples domains pointing to differents ports in apache server
Just needed to setup a Reverse Proxy.

URL redirection in mac osx yosemite [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I need to redirect a particular url to my localhost in mac osx-yosemite. I'm able to do the port forwarding using the following.
echo "
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443
" | sudo pfctl -ef -
But can't figure out how to make a particular URL to be redirected to my localhost. Thanks for the help
Edit your hosts file - should be at:
/private/etc/hosts
Add a new line
127.0.0.1 domain.com
This will make requests for domain.com be sent to your mac. You may need to close and reopen your browser to flush any local DNS cache it may hold.

SSL Certificate for 1 Site [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Can someone help me understand if I have 1 domain
www.example.com
which runs lampp on port 80 and tomcat on port 8080 ,
do I need 1 or 2 SSL certificates?
for example the commercial site runs on www.example.com but the actually web application runs on www.example.com:80/Login/
Does that mean I need 2 separate SSL EV Certificates or can I just purchase 1 and load it on both apache and tomcat because its the same domain?
Thanks
Firstly, you're probably not running your servers using SSL on ports 80 and 8080. Port 80 is the default port for HTTP whereas port 443 is the default port for HTTPS.
Tomcat tends to use port 8080 for its HTTP service and port 8443 for its HTTPS service because it tends to be run by a non-root user on Unix boxes (which can't use port numbers under 1024), and also perhaps because ports 80 and 443 tend to be taken by other services (e.g. Apache Httpd) already.
While you could technically run an HTTPS service on port 80, it's not a good idea, since you would have to specify the port in the address every time (and possibly resort to port unification if you want to run a plain HTTP service on that port too). This would lead to unnecessary confusion.
Host name verification for HTTPS is bound to host names, not port numbers. Whichever ports you use doesn't really matter. You could run both https://www.example.com/ (implicitly on port 443) with Apache Httpd and https://www.example.com:8443/ with Apache Tomcat using the same certificate, issued for www.example.com (at least). You may have to convert the storage format for the keys and certificate (Apache Httpd would use separate key and certificate files, whereas Tomcat would use a single keystore, e.g. in PKCS#12 format), but that's just a matter of converting the files on your end once the CA has issued the certificate.
In addition, it's quite unusual to use HTTPS on both Apache Httpd and Tomcat on the same machine. Typically, you'd set up your system with Apache Httpd on port 443 to handle the SSL connections, and set up a reverse proxy to have Apache Httpd dispatch the requests to your Tomcat in plain HTTP on localhost. This allows for everything to be served on https://www.example.com/ without needing to specify a non-default port. Only the front-end (Apache Httpd) would need to be configured with the certificate.

Pound & Apache: REMOTE_HOST contains host of proxy [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have a server running Ubuntu 12.04 LTS, Pound 2.6 and Apache 2.2. I have also the apache module mod_rpaf (installed from https://github.com/gnif/mod_rpaf) installed and enabled to ensure, that in the variable REMOTE_ADDR appears the real user ip address and not the address of the proxy.
This works fine, but the variable REMOTE_HOST is not changed by mod_rpaf. This variable contains "localhost" and not the host of the given user ip address.
Can you help me, please?
Here is my mod_rpaf configuration:
root#perseus ~ # cat /etc/apache2/mods-enabled/rpaf.conf
RPAF_Enable On
RPAF_ProxyIPs 127.0.0.1
RPAF_Header X-Forwarded-For
RPAF_SetHostName On
RPAF_SetHTTPS On
RPAF_SetPort On
Thank you
Check theses answers on a previous question about a missing REMOTE_HOST:
REMOTE_HOSTS is a variable that may or may not be populated by apache (and it's better if it is not set, else it imply a DNS query by apache for every incoming request). So Nothing on your code should rely on REMOTE_HOST. No application should assume this variable will be there and correctly filled.
mod_rpaf does what it is designed for, documentation:
Sets REMOTE_ADDR, HTTPS, and HTTP_PORT to the values provided by an upstream proxy.
Now you have a working REMOTE_ADDR, which is the only variable you should trust, make a copy of it in REMOTE_HOST if you really wants that, and simply do it in your application code.
There is a bug in Ubuntu LTS 12.04 that prevents rpaf to work at all.
https://bugs.launchpad.net/ubuntu/+source/libapache2-mod-rpaf/+bug/1002571
workaround
in rpaf.conf replace
<IfModule mod_rpaf.c>
by
<IfModule mod_rpaf-2.0.c>

Apache server - not loading localhost [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I had this problem with my Apache server not starting, because port 80 was being used by some other program, I changed the 'Listen' port number to 8888 and the server got started. But now the problem is, when I try to access 'http://localhost/' from my browser its not finding it. Can anyone let me know whats the problem here, and resolution for the same ?
Your browser is defaulting to port 80 if no port is specified.
Try http://localhost:8888
If you'd like to have apache listen on a port other than the default, you can do the following:
Edit ports.conf
nano /etc/apache2/ports.conf
Add a Listen directive
Listen default port
Listen 8888
Restart Apache
/etc/init.d/apache2 restart
When you type "http://localhost/" in your webbrowser it automatically thinks you mean port 80 (default HTTP port). If you have changed the server port t o 8888 you need to mention this when typing in the URL like so: "http://localhost:8888" or alternatively "http://127.0.0.1:8888".