CentOS How to bind a domain name under Apache

Source: Internet
Author: User
This article mainly describes the Apache binding domain name under CentOS and Apache binding multiple domain names, first of all to find Apache configuration file httpd.conf location. CentOS operating systems are typically under/etc/httpd/conf, and some Linux operating system versions are in/etc/apache2/conf or/usr/local/etc/apache folders, All that remains to be done is to modify the configuration file httpd.conf, which has the following binding domain name description at the bottom of the general configuration file:
# VirtualHost Example: # Almost any Apache directive could go into a virtualhost container. # the ' The ' the ' I VirtualHost ' used for requests without a known # server name. # #<virtualhost *:80> # ServerAdmin webmaster@dummy-host.example.com # documentroot/www/docs/ dummy-host.example.com # ServerName Dummy-host.example.com # ErrorLog Logs/dummy-host.example.com-error_log # Customlog Logs/dummy-host.example.com-access_log Common #</virtualhost>

We can according to gourd painting gourd, can also be combined with the relevant syntax to add their own configuration instructions, the following is my worry-free program profile: 1, * asterisk modified to its own web site IP address 2, serveradmin Administrator mailbox (optional) 3, DocumentRoot Web site files Specify log file storage paths on the server's directory path 4, servername bound corresponding domain name 5, Serveralias domain resolution binding subdomain 6, errorlog, and Customlog.

<virtualhost 175.102.8.117:80> adddefaultcharset gbk documentroot/chengxu ServerName 66php.com ServerAlias *. 66php.com Errorlog/sym/logs/66php.com-error_log Customlog/sym/logs/66php.com-access_log Common </VirtualHost >

If a server binds multiple domain names instead of adding multiple domain names in ServerName, ServerName can only add one domain name after the other, you need to add more virtualhost modules to repeat the binding.

Reprint: http://www.66php.com/66.html

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.