We have an new version of php web app listening to port 80.
I am wondering if it is possible to host the new version on another port, with no code modification, while keep the old version listening to port 80.
For example, if the user visits the page www.example.com, then it goes to the old version, and if the user visits the page www.example.com:8080 then it goes to the new version.
Maybe I can achieve this with route53? or maybe I have to alter the apache configuration?
Thanks.
The way to achieve this is by tweaking the Apache configuration as you suggested, to force Apache to fetch your content from another DocumentRoot when the 8080 listener is triggered.
Route53 will not help here as a DNS system only resolves name to IP Address, and do not deal with multiple ports for the same IP address.
You can use Apache's VirtualHost to configure multiple listener. You can even have different PHP versions per host ports, as per Running two PHP versions on the same server
Related
I am trying to understand how to host different apps in server, so can server host different domain in same port.
For example, I have domain1 and domain2 both hosted at port 443. Can this be done?
I am doing this in IIS server.
A single web IIS server can host different domain in same port. However, in order IIS to distribute HTTP requests correctly, each website has to be identified with some unique value. In case of an IIS website, it consists of three attributes that make up a unique combination for each website. These are:
a TCP port number
an IP address
a host header (host name)
The information about the hosted websites is stored in the ServerBindings attribute of the IIS metabase in the following format: IP:Port:Hostname. Thus, if you want to host multiple websites on the same port and IP address, you will have to use a unique Host header. What is it? Host header is a part of an HTTP request to the server sent by a client that specifies which website it is addressed to. Accordingly, this host header must be specified on the side of the web server, and the DNS contains the correct record that matches the hostname and the IP address of the IIS web server.
Let’s suppose that you have a website running on IIS and listening 443 port. And you need to bind second website to the same port. In the IIS Manager, create another website with the name TestSite, which files will be located in c:\inetpub\TestSite (do not specify the hostname yet). After you click OK, a warning appears that you cannot use the binding *:443 for both sites.
The binding '*:443:' is assigned to another site. If you assign the same binding to this site, you will only be able to start one of the sites. Are you sure that you want to add this duplicate binding?
Agree to this warning. So you have got another site bound to port 443, you cannot start it without stopping the first site.
I have a Django project running with Nginx and Waitress on my Windows VPS. I want to make it accessible to the public with a domain name. I am completely clueless on how to go about it, although I have pointed my domain's A record to the Public IP address of the VPS. To be specific, I am running a Windows Server 2019 on the Gcloud platform.
Check and make sure your VPS firewall settings are such that it allows request from public site at Port 80.
I just found a way to do it. I edited my Windows Server 2019 VPS firewall and added a port inbound rule, enabling request from remote clients on port 80 which is the port my nginx server serves from. #AnirudhBargi i guess i didn't understand your initial question. Enabling port 80 to accept request was the solution all along. Thank you very much.
I have binded my rails thin server to a local IP. which I have given the domain name as project1. But when I am changing the hostname to project1 sometimes it goes to project1:3000. How can I remove the :3000 from the URL?
Web standards are:
http is port 80.
https is port 443.
When you go to http://stackoverflow.com, it is the same as http://stackoverflow.com:80 or https://www.google.com is the same as https://www.google.com:443
So, the :3000 at the end of the url is the port where your development server is pointing, this is normal behavior for web development. All modern frameworks will serve up the development site on a different port, 3000 being the most common. This is done for a lot of reasons, two good ones are.
Don't need to change any permission to run on port 3000, like you do if you want to run on 80, and you don't need to us an ssl certificate if you run on 443.
You can tell when you are in development.
You are trying to do something you shouldn't. If you haven't used the correct helper methods to build your links in rails you could run into some issue.
Now that you know why you shouldn't do it. You can just change the port in the rails server command like this rails server -b THEIPYOUWANTTOUSE -p 80. You will have to have the correct permissions.
First of all.You need proxy server, because rails have their app server lika thin, puma, rack and you need server that will accept requests to your IP (nginx, apache) and give them to rails server. There is a lot of guides how to deploy rails app in production mode. Try this guide or this one . This will help you run your application in production mode.
I have a website running CMSMadeSimple on an Azure Linux VM. The current URL is [website].cloudapp.net/cmsmadesimple, but now that the site is complete I need to change the it to the client's URL [website].com.
I've done this in the past by simply remoting in to the server and changing the DNS records, but since the VM is Linux, I can't just remote it. I've looked around but have yet to find a solution.
What am I missing here?
Just create a CNAME or A record. However, your application server must cooperate by redirecting the request to your new hostname to the existing application. It's likely a VirtualHost is already setup for this but if you get a 404 then you need to "remote" in.
First update the config.php files for the new domain.
Second update your vhost files on your webserver to listen to the new domain.
Final update the DNS (usually it is where you registered the domain -- like godaddy.com, namecheap.com, etc) to point to the IP or alias given to you by Azure.
I intend to run a Jetty server (for generating PDF files with PDFreactor) on a dedicated (virtual) machine; I don't want to have it on my webserver.
According to the PDFreactor documentation, the Jetty server must run on localhost to be usable by the Python API; but a port and host can be given to the PDFreactor constructor, and apparently the restriction to listen to localhost only can be lifted.
Can Jetty be configured to accept requests from some whitelist of hosts only, or is it preferable to put it in a VirtualHost and let apache httpd do the work?