Skip to main content

Mass Change VirtualHost IP via CLI/SSH

Comments

3 comments

  • jefferyw18

    root@server [~]# strace -F /scripts/rebuildhttpdconf 2>&1 | grep 192.168. read(3, "pst0\5\t\2\0\0\0\1\n\f192.168.2.10", 8192) = 25 read(3, "192.168.2.10\n", 8192) = 13 stat("/var/cpanel/userdata/nobody/192.168.0.10", {st_mode=S_IFREG|0644, st_size=293, ...}) = 0 stat("/var/cpanel/userdata/nobody/192.168.0.10", {st_mode=S_IFREG|0644, st_size=293, ...}) = 0 stat("/var/cpanel/userdata/nobody/192.168.0.10", {st_mode=S_IFREG|0644, st_size=293, ...}) = 0 open("/var/cpanel/userdata/nobody/192.168.0.10.cache", O_RDONLY) = 3 stat("/var/cpanel/userdata/nobody/192.168.0.10_SSL", 0x7f09f5889880) = -1 ENOENT (No such file or directory) [pid 11374] read(5, "#\n#"..., 4096) = 4096
    0
  • jefferyw18
    Solved the problem with this method
    root@server [~]# sed -i 's/192.168.0.10/192.168.2.10/g' /usr/local/apache/conf/httpd.conf root@server [~]# /usr/local/cpanel/bin/userdata_update root@server [~]# /scripts/rebuildhttpdconf info [rebuildhttpdconf] Missing owner for domain , force lookup to root info [rebuildhttpdconf] Missing group for domain , using nobody Built /usr/local/apache/conf/httpd.conf OK

    root@server [~]# cat /usr/local/apache/conf/httpd.conf | grep '
    0
  • cPanelMichael
    Hello :) Note that you may also find this command helpful in the future:
    # /usr/local/cpanel/bin/setsiteip --help Usage: /usr/local/cpanel/bin/setsiteip [-u user | domain] ip Usage: /usr/local/cpanel/bin/setsiteip --help
    Thank you.
    0

Please sign in to leave a comment.