[HELP] Custom Settings for a Specific Subdomain VirtualHost

enkrypt

Verified User
Joined
Feb 3, 2011
Messages
38
Hello,

I have been manually editing the httpd.conf file for the reseller accounts httpd.conf file each time it gets overwritten. I was wanting to add this to the template, so that it will keep it there each time. I am having a hard time doing it. This is what I have written so far in the Httpd.conf Customization page:

Code:
|*if DOMAIN="mysub.mydomain.com"|
ProxyPass / http://127.0.0.1:7777/
ProxyPassReverse / http://127.0.0.1:7777/

<Proxy *>
 Order deny,allow
 Allow from all
</Proxy>
|*endif|

However, when I issue:
Code:
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

And wait a few minutes, the changes to my subdomain do not occur.

I am obviously not understanding the correct way to accomplish this. Can you use subdomains in the if DOMAIN="" statement?

Thanks!
 
If you are trying to apply that for a subdomain mysub.mydomain.com, I'd recommend using "Custom HTTPd Configuration" feature under DA admin level, and adding the following there:
Code:
|*if [B]SUB[/B]="[B]mysub[/B]"|
ProxyPass / http://127.0.0.1:7777/
ProxyPassReverse / http://127.0.0.1:7777/

<Proxy *>
 Order deny,allow
 Allow from all
</Proxy>
|*endif|
 
Great! That worked, I figured I was using the wrong syntax.

Now, one last question in regards to this - let's say I want to forward anything coming in on port 22 (ssh) to a remote IP and anything on port 80 to go to a different port on the same IP.

Example:

test.mydomain.com:80 -> someip:8080
test.mydomain:22 -> someip:2022

How would you accomplish this? Something like a SSH proxy via Apache?
 
Last edited:
Back
Top