Another way to change my external ip to internal in httpd.conf AUTOMATICALLY? Or fix?

CrewXp

Active Member
Nov 12, 2003
43
0
156
My server is behind a NAT. To get addon domains and subdomains to work, I have to go into httpd.conf and change
<VirtualHost 61.94.131.251> to <VirtualHost 192.168.18.251> for every new thing added.

IS there any way to not do this when adding something? Anything I can change on cpanel to NOT DO THIS AT ALL or a cpanel script that does this for me each time a subdomain is added?

thanks so much
 

bijo

Well-Known Member
Aug 21, 2004
474
0
166
India
CrewXp said:
My server is behind a NAT. To get addon domains and subdomains to work, I have to go into httpd.conf and change
<VirtualHost 61.94.131.251> to <VirtualHost 192.168.18.251> for every new thing added.

IS there any way to not do this when adding something? Anything I can change on cpanel to NOT DO THIS AT ALL or a cpanel script that does this for me each time a subdomain is added?

thanks so much
Hello,

I hope with the help of the replace command you can do it. Create a cron and run it.

replace 61.94.131.251 192.168.18.251 -- /usr/local/apache/conf/httpd.conf
But it will change all occurence of the ip 61.94.131.251
 
Last edited:

CrewXp

Active Member
Nov 12, 2003
43
0
156
I read sparek's post and it seems the most useful in this situation (that way a cron won't be needed every so often)

But I have a question.

I posted a topic about it here:
http://forums.cpanel.net/showthread.php?t=52157

Or if you want the post text, here "I want to put a

If %ip% = 69.62.234.12 Then %ip%=192.168.1.12
If %ip% = 69.62.234.13 Then %ip%=192.168.1.13
If %ip% = 69.62.234.14 Then %ip%=192.168.1.14
If %ip% = 69.62.234.15 Then %ip%=192.168.1.15

in the /usr/local/cpanel/etc/httptemplates/apache1/default

file

I know, that's not how to do it, but its just an example. Is there any way to put that in there? So I can call <VirtualHost %ip>, it will put that instead?

Or use a replace command on %ip% to replace "69.62.234" with "192.168.1"???

thanks!!"
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
An alternative could be to use bijo's idea together with your last one and put the replace lines in /scripts/postwwwacct - the substitute will then be automatically done whenever you create a new account.
 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
Melbourne, Australia
cPanel Access Level
Root Administrator
I have a standard .php template, installed from /home/reseller/cpanel3skel/public_html/index.php - that alters it's behaviour depending on who the reseller is. If the account reseller changes, the script behaviour changes.
 

CrewXp

Active Member
Nov 12, 2003
43
0
156
aww!! I went through and typed the replace command in my wwwacct file for every ip I have, and I just read your msg. "It will take effect on new account creations". Well, if I'm just adding a subdomain, that's not creating a new account right, therefore won't do anything.
 

intel352

Well-Known Member
Nov 25, 2003
55
0
156
NC, USA