apache| Server | Advanced as a system administrator, if you have only one IP address, but there are several domain names, but also require access to each domain name to see different content, then how to do? There is no one server for each domain. This will take the virtual host technology, and fortunately Apache supports this functionality. There are two ways to have a virtual host: ip-based (ip-based), name-based (based on domain name). Ip-based refers to a domain name corresponding to an IP address, and name-based refers to multiple domain names corresponding to an IP address.
The setup of the virtual host is not complex, just add the appropriate command to the httpd.conf file.
The following is an example of a name-based (httpd.conf) virtual host (Editor's note: For space reasons, we only give the relevant part, the full text see www.swm.com.cn). IP: 192.168.188.20, two domain names are long.com.cn, short.com.cn respectively.
httpd.conf: Make specific settings for each host in the VirtualHost command.
The serveradmin command is to set the e-mail sent to the browser when the WWW server executes a problem, so that the user can contact the system administrator with the e-mail serveradmin.
The servername command is to set the WWW server's domain name.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.