Httpd

From Colettapedia
Revision as of 14:28, 17 July 2019 by Colettace (talk | contribs)
Jump to navigation Jump to search

General

Virtual Hosts

  • Virtual Host documentation
  • Virtual Host examples
  • "The term Virtual Host refers to the practice of running more than one web site (such as company1.example.com and company2.example.com) on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user."
  • VirtualHost directive
    • Contains directives that apply only to a specific hostname or IP address

<VirtualHost 10.1.2.3:80>
  ServerAdmin webmaster@host.example.com
  DocumentRoot "/www/docs/host.example.com"
  ServerName host.example.com
  ErrorLog "logs/host.example.com-error_log"
  TransferLog "logs/host.example.com-access_log"
</VirtualHost>

Configuring reverse proxy

  • mod_proxy - Multi-protocol proxy/gateway server
  • rstudio.conf

    <VirtualHost *:80>

      <Proxy *>
        Allow from localhost
      </Proxy>

      ProxyPass        /rstudio/ http://localhost:8787/
      ProxyPassReverse /rstudio/ http://localhost:8787/
      RedirectMatch permanent ^/rstudio$ /rstudio/

    </VirtualHost>