Mobile app version of vmapp.org
Login or Join
Lengel546

: How do I use cPanel to redirect subdomain to a static IP with masking? We have a hosted website, configurable through cPanel. Content that can't be hosted there (because it requires up-to-date

@Lengel546

Posted in: #Cpanel #Masking #Subdomain

We have a hosted website, configurable through cPanel. Content that can't be hosted there (because it requires up-to-date PHP, which is "coming soon") is temporarily on another server. That server has a permanent IP address, but no URL.

What are the cPanel options we need to use to get subdomain.example.com to display content from 203.0.113.0, whilst maintaining the original URL? So e.g. if a user types subdomain.example.com/page, they get content from 203.0.113.0/page, but continue to see subdomain.example.com/page in their browser.

Edit for more info:

The original server is viewed at a URL (say example.com). It is hosted with Zen Internet, and my only editing power is through limited cPanel features. I think it's running Apache. I can add new files. I'm struggling to match cPanel documentation with my experience of e.g. hosting an Apache server from a laptop. (Which is something I've only done a couple of times.)

I can ask our admin to edit DNS records / talk to our hosting provider, but his experience is as limited as mine, so I need to pass along specific instructions.
I believe our admin has created a DNS A record which points at the IP address. Unless I add a redirect in cPanel, however, I get sent to a Zen Internet Domain Holding Page. (First I get a "the security certificate is from Zen hosting..." warning, but ignoring that...)

The subdomain server is accessed through a public IP address (say 203.0.113.0:8080). It is an IIS server. It is configured to display the subdomain content if it receives a request from subdomain.example.com, or at port :8080; viewing the site via the IP+port works fine. This server I have full access to.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Lengel546

1 Comments

Sorted by latest first Latest Oldest Best

 

@XinRu657

This isn't really a cPanel problem. This is either a problem with your IIS server, or a problem with the amount of access you have.

If your subdomain is being served on port 8080, and you want to view it without having to include the port, then your only option is to either change the port that it is listening on to be port 80, or to redirect traffic through some proxy.

My first thought would be to simply change to port on the IIS server to port 80. If it's serving HTTP content, it should be connecting to the HTTP port, which is port 80. If it's not configured to run on 80, then that host is simply not making your site available as a normal website. (Also, it is assumed that the IIS server will properly access the content by domain name, and if that's not the case, it should be done, too). The obvious answer is simply to modify the IIS server to serve the content from port 80, and then simply change the A record (a DNS record) for subdomain.example.com to be 203.0.113.0. That alone should fix your problem.

If you absolutely cannot modify the IIS server to function over the standard HTTP port, then your next option would be to create a proxy of some sort. One way of doing this is to create a reverse proxy in Apache:

ProxyPass / 203.0.113.0:8080/ ProxyPassReverse / 203.0.113.0:8080/

However, to do that, you'll probably need root access on the server as it can't be included in a .htaccess file. If you should be able to add those lines, this article will tell you where you can create the file to be added into the configuration:
documentation.cpanel.net/display/EA/Modify+Virtualhost+Containers+With+Include+Files
There's probably other ways to create a proxy as well, including perhaps checking with your domain registrar, etc. Just remember to make the A record for subdomain.example.com match the IP of the server where the redirect is created.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme