Open site with default server ip

I have 2 ip addresses on the server. Both open the standard DocumentRoot /var/www/html/ folder. How can I reassign the opening ip to the site folder?

For example, by ip: http://111.111.111.111 open DocumentRoot /home/user/site.com/public_html

Thx.

not sure if hestia will overwrite this but take a look into /etc/nginx/conf.d there should be confs with the IPs

1 Like

Also one one thing:

  1. SSL won’t work
  2. Might cause issues for SEO / Duplicated content
  3. You have to modify the config so you are able to run php
  4. And you might folder permissions issues

This is for the internal network. The site opens by domain without any problems. It is necessary for the server ip to open the site

I think this is permissions issue. But how to do it

1.nginx - /etc/nginx/conf.d/111.111.111.111.conf added:
location / {
proxy_pass http://111.111.111.1111:8080;
location ~* ^.+.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
root /home/user/web/site.com/public_html;
access_log /var/log/apache2/domains/site.com.log combined;
access_log /var/log/apache2/domains/site.com.bytes bytes;
expires max;
try_files $uri @fallback;
}
}

and service nginx restart no effect

  1. In Apache section /etc/apache2/conf.d/111.111.111.111.conf added
    <VirtualHost 111.111.111.111:8080>
    ServerName 111.111.111.111
    #DocumentRoot /var/www/html/
    DocumentRoot /home/user/web/site.com/public_html/
    Alias /error/ /var/www/document_errors/

and service apache2 restart get Internal Server Error

Let me guess the /var/log/ said permission denied?

Ok, now it’s working. Thanks for all! After testing with apache config working with default permissions for users. Problem with .htaccess in my CMS.

Full config /etc/apache2/conf.d/111.111.111.111.conf

Summary
<VirtualHost 111.111.111.111:8080>
  ServerName 111.111.111.111
  # DocumentRoot /var/www/html/
  DocumentRoot /home/user/web/site.com/public_html/
  Alias /error/ /var/www/document_errors/

  <Directory /home/user/web/site.com/stats>
      AllowOverride All
  </Directory>
  <Directory /home/user/web/site.com/public_html>
      AllowOverride All
      Options +Includes -Indexes +ExecCGI
  </Directory>

  <FilesMatch \.php$>
      SetHandler "proxy:unix:/run/php/php7.3-fpm-site.com.sock|fcgi://localhost"
  </FilesMatch>
  SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

  IncludeOptional /home/user/conf/web/site.com/apache2.conf_*

</VirtualHost>