Redirecting the internal path to the virtual host

I worked on the drupal test site for a while, which has a bunch of virtual hosts configured as follows:

<VirtualHost *:80>
ServerAdmin email@example.com
DocumentRoot "/path/to/root"
ServerName testsite1.example.com
</VirtualHost>

I am using a modified host file to view each of these test sites according to:

12.0.0.1 localhost
02.20.2.22 testsite1.example.com
02.20.2.22 testsite2.example.com
02.20.2.22 testsite3.example.com

This worked fine, but now I need to send the sites to some people remotely who are not technical enough to modify their own host files and see it like I do.

Is there a way to configure Apache so that the URL " http://20.02.2.22/testsite1 " goes to testsite1.example.com internally? I am using Drupal, and the site setting should see "testsite1.example.com" so that it can select the instance for selection correctly. I'm browsing apache rewrite, but I'm a little new to this, so any help is much appreciated.

+3
source share
3 answers

testsite1.example.com will only be allowed on your computer, so you cannot redirect. You can configure proxies using mod_proxy. Hope this works for you:

<VirtualHost *:80>
  ServerAdmin email@example.com
  DocumentRoot "/path/to/root"
  ServerName testsite1.example.com
  ServerAlias 20.02.2.22
  <Location /testsite1/>
    ProxyPass http://testsite1.example.com/ 
  </Location>
</VirtualHost>
+3
source

, , DNS .

Drupal [ ip] localhost.

DNS IP-, , [ ip]

, .dyndns.com, .

0

IP- ... , :

http://www.dot.tk/en/index.html?lang=en
or
http://dyn.com/dns/

, , : http://server2.elite7hackers.us/recommend.php?site=godaddy

0
source

Source: https://habr.com/ru/post/1704337/


All Articles