Differences
This shows you the differences between two versions of the page.
linux_wiki:configure_a_virtual_host [2018/04/09 22:52] billdozor [Lab Setup] |
linux_wiki:configure_a_virtual_host [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Configure A Virtual Host ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | Red Hat preferred method of configuring virtual hosts. | ||
- | |||
- | ---- | ||
- | |||
- | ====== Lab Setup ====== | ||
- | |||
- | The following virtual machines will be used: | ||
- | * server1.example.com (192.168.1.150) -> Perform all connectivity tests from here | ||
- | * server2.example.com (192.168.1.151) -> Install Apache Web Server here | ||
- | |||
- | **Previous Sections Completed** | ||
- | * [[linux_wiki: | ||
- | * Except leave listening on port 80/tcp | ||
- | |||
- | ---- | ||
- | |||
- | ====== Virtual Host Creation ====== | ||
- | |||
- | **Examples**: | ||
- | |||
- | \\ | ||
- | On server2: Create virtual host file | ||
- | <code bash> | ||
- | vim / | ||
- | |||
- | < | ||
- | ServerAdmin admin@bluesite.example.com | ||
- | DocumentRoot / | ||
- | ServerName bluesite.example.com | ||
- | ErrorLog logs/ | ||
- | CustomLog logs/ | ||
- | </ | ||
- | </ | ||
- | |||
- | \\ | ||
- | On server2: Create directory and index file for myvhost | ||
- | <code bash> | ||
- | mkdir / | ||
- | echo '< | ||
- | </ | ||
- | |||
- | \\ | ||
- | On server2: Restart httpd | ||
- | <code bash> | ||
- | systemctl restart httpd | ||
- | </ | ||
- | |||
- | \\ | ||
- | On server1: Create /etc/hosts entry for new name | ||
- | <code bash> | ||
- | vim /etc/hosts | ||
- | |||
- | 192.168.1.151 server2 bluesite.example.com | ||
- | </ | ||
- | |||
- | \\ | ||
- | On server1: Check virtual host site | ||
- | <code bash> | ||
- | elinks http:// | ||
- | </ | ||
- | |||
- | ---- | ||