How do I access the specified server by the domain name I purchased? First, the domain name to pass the record.
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/8F/7E/wKiom1jg4pHStDpIAABEZRyvcxE610.png "title=" 1.png "alt=" Wkiom1jg4phstdpiaabezryvcxe610.png "/>
You can set the domain name's resolution (set sub-domain, bind public IP, etc.) on the URL of the purchase domain name.
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/8F/7E/wKiom1jg4AWiCOD8AABw2J5M90k939.png "style=" float : none; "title=" 2.png "alt=" Wkiom1jg4awicod8aabw2j5m90k939.png "/>
The Apache version I used is 2.4.6, edit Apache config file: (# vim/etc/httpd/conf/httpd.conf)
The subdomain access server specifies the path:
<virtualhost *:80> documentroot "/www/html" ServerName www.512430.net</virtualhost>
The subdomain access server specifies the path:
<virtualhost *:80> documentroot "/www/html/blog/public" ServerName blog.512430.net</virtualhost>
Prohibit public IP access:
<virtualhost *:80> documentroot "/www/error" ServerName server public network IP rewriteengine on rewriterule ^.*/400.ph P</virtualhost>
To restart the Apache service:
# systemctl Restart Httpd.service
Test Sub domain: www.512430.net
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/8F/7E/wKiom1jg5UGTk5P1AADg28HFAFs698.png "style=" float : none; "title=" 3.png "alt=" Wkiom1jg5ugtk5p1aadg28hfafs698.png "/>
Test Sub domain: blog.512430.net
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/8F/7C/wKioL1jg5UHRlykBAABTDzMhBwY582.png "style=" float : none; "title=" 4.png "alt=" Wkiol1jg5uhrlykbaabtdzmhbwy582.png "/>
This article is from the "How Big Heart" blog, please be sure to keep this source http://qq512430.blog.51cto.com/5955081/1912593
Accessing the HTTP server through domain name resolution