Skip to main content

Comments

15 comments

  • cPRex Jurassic Moderator
    Hey there! Yes, in that example, that's what I would expect to work. We have some additional details on this process here that you might find helpful:
    0
  • Brady.Gunn_Anishinabek
    For some reason this makes the main domain point to the port as well. For clarify we have a domain and subdomain on the same account. I am trying to make a specific port go to subdomain.ca but when I do the following in the Pre Virtualhost include it makes the main domain point to it " ProxyPass /.well-known ! ProxyPass / "
    0
  • cPRex Jurassic Moderator
    If they are both sharing the same vhost, that won't work. If the subdomain was created in cPanel, we should also have created a separate Apache vhost for the subdomain, which typically looks like this: ServerName subdomain.domain.com ServerAlias www.subdomain.domain.com DocumentRoot /home/username/home/subdomaindirectory ServerAdmin webmaster@subdomain.domain.com
    Do you not see a separate vhost for your subdomain?
    0
  • Brady.Gunn_Anishinabek
    If they are both sharing the same vhost, that won't work. If the subdomain was created in cPanel, we should also have created a separate Apache vhost for the subdomain, which typically looks like this: ServerName subdomain.domain.com ServerAlias www.subdomain.domain.com DocumentRoot /home/username/home/subdomaindirectory ServerAdmin webmaster@subdomain.domain.com
    Do you not see a separate vhost for your subdomain?

    In in the include file? It is blank, there is nothing in there
    0
  • cPRex Jurassic Moderator
    Not in the include file, but in Apache itself. If the include file applies to the entire domain, that is why it would be redirecting all content.
    0
  • Brady.Gunn_Anishinabek
    Where would I look to check for the subdomain vhost? How would I only redirect with the specific subdomain
    0
  • cPRex Jurassic Moderator
    You would just want to check the main Apache configuration to ensure a separate vhost exists. That's at /etc/apache2/conf/httpd.conf. To only redirect the one specific subdomain, you would use the include file specific to that subdomain's vhost.
    0
  • Brady.Gunn_Anishinabek
    I am having issues finding the apache2 folder, There is an /etc/ folder in the root of the server, but it doesn't have a sub-directory of apache2.
    0
  • cPRex Jurassic Moderator
    That's definitely odd. Could you submit a ticket to our team so we can check this out?
    0
  • Brady.Gunn_Anishinabek
    Wait nevermind I found the file. The subdomain does have the code you specified in the httpd.conf file for the subdomain. Now that I've confirmed there is a seperate vhost what do I need to do? It states the location for an include file: " # To customize this VirtualHost use an include file at the following location # Include "/etc/apache2/conf.d/userdata/std/2_4/[USERNAME]/[SUBDOMAIN]/*.conf" " So I would need to create a file at the specified location then add the the ProxyPassReverse?
    0
  • cPRex Jurassic Moderator
    At the bottom of each vhost you'll see this message: # To customize this VirtualHost use an include file at the following location # Include "/etc/apache2/conf.d/userdata/std/2_4/username/sub.domain.com/*.conf"
    so that is where you'd want to create your custom include file. You may not have anything deeper than /etc/apache2/conf.d/userdata/std/2_4/ so the other directories may need to be created before you can place your conf file there. You can name the conf file anything you wish - as long as it ends in .conf it can be read by the system.
    0
  • Brady.Gunn_Anishinabek
    Ok so once I make that file I write to it: " ProxyPass /.well-known ! ProxyPass / " Then do I need to restart the server?
    0
  • cPRex Jurassic Moderator
    Yes, you'll just want to restart Apache after creating that include file so it will be read into the system.
    0
  • Brady.Gunn_Anishinabek
    That did it, thanks for all the help!
    0
  • cPRex Jurassic Moderator
    I'm glad that worked well!!!
    0

Please sign in to leave a comment.