Update httpd.conf IPs from DNS zones.
Here's what I'm trying to accomplish:
I have VirtualHost entries on my httpd.conf that looks similar to the following:
<VirtualHost 301.163.169.211:80> ServerName accounttest.com ServerAlias www.accounttest.com ServerAdmin firstname.lastname@example.org DocumentRoot /home/accountt/public_html <IfModule mod_suphp.c> suPHP_UserGroup accountt accountt </IfModule> <IfModule !mod_disable_suexec.c> User accountt Group accountt </IfModule> BytesLog /usr/local/apache/domlogs/accounttest.com-bytes_log CustomLog /usr/local/apache/domlogs/accounttest.com combined ScriptAlias /cgi-bin/ /home/accountt/public_html/cgi-bin/ # To customize this VirtualHost use an include file at the following locatio n # Include "/usr/local/apache/conf/userdata/accountt/accounttest.com/*.conf" </VirtualHost>
; cPanel 11.24.0-CURRENT_30944 ; Zone file for accounttest.com $TTL 14400 @ 86400 IN SOA ns5.domain.com. cpm.domain.com. ( 2008111802 ; serial, todays date+todays 86400 ; refresh, seconds 7200 ; retry, seconds 3600000 ; expire, seconds 86400 ) ; minimum, seconds accounttest.com. 86400 IN NS ns5.domain.com. accounttest.com. 86400 IN NS ns6.domain.com. accounttest.com. IN A 188.8.131.52 localhost.accounttest.com. IN A 127.0.0.1 accounttest.com. IN MX 0 accounttest.com. mail IN CNAME accounttest.com. www IN CNAME accounttest.com. ftp IN A 184.108.40.206
1) How can I grab the IP from this line: accounttest.com. IN A 220.127.116.11
In the above line, the IP would be 18.104.22.168 (so the $4 variable of the line I guess)
2) Then how can I use the variable $4 from the line above and replace the IP that's being used by the VirtualHost entry of accounttest.com? So the VirtualHost entry would look like this:
I'm sorry if this sounds confusing. I kinda have an idea of what needs to be done, but I don't know where to start. Any help will be very appreciated.
|Thread||Thread Starter||Forum||Replies||Last Post|
|httpd problem or something else||c0mrade||Other BSD and UNIX/UNIX-like||6||15th January 2009 09:19 PM|
|Apache : httpd could not be started||lalebarde||General software and network||13||13th November 2008 11:51 PM|
|difference between rc.conf and loader.conf||disappearedng||FreeBSD General||5||3rd September 2008 06:54 AM|
|httpd -DNOHTTPACCEPT||starbuck||FreeBSD General||9||23rd August 2008 01:14 PM|
|httpd.conf||Snoop1990||General software and network||5||29th July 2008 05:30 AM|