简体   繁体   中英

Website with dedicated IP Address, still uses shared server IP

Using cPanel WHM I have created a website hosting with Dedicated IP Address,

I'm planning to use it with the IP Address instead of a domain (eg http://1.2.3.4/script.php )

It opens, script also works fine.

The only issue is the IP address it uses isn't dedicated, it still uses server's shared IP.

I checked by CURL equivalent file_get_contents(' http://myip.is ') , the IP is the shared IP of server not the IP is use in URL or dedicated to it.

After a lot of tries, I realized the issue is because of CURL, apparently it still uses the server's main IP Address.

I managed to fixed this by adding the following to my CURL function

// Changing 1.2.3.4 with websites real IP
$website_ip = '1.2.3.4';
curl_setopt($curl, CURLOPT_INTERFACE, $website_ip);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM