简体   繁体   中英

Where to put Apache vhost configuration (httpd-vhosts.conf or httpd.conf)?

I just to ask a simple question. I am studying the vhost configuration but I am confused where should I properly put my vhosts configuration?

I have a file that has a name httpd-vhosts.conf and httpd.conf I try to put my configuration in these 2 files but different web projects. And after I restarted my Wampserver I can access them. Is it fine if I place all my vhost entries in the file httpd-vhosts.conf ? Or should I place it in httpd.conf

There is no right or wrong. Apache has one global config file, which typically is the default or specified in the startup script.

This file then uses one or more secondary config files and directories. Different Linux distributions use different default include directories.

On CentOS I think for example you would put a file (named like your domain but can be anything) in /etc/httpd/conf.d/example-com.conf: http://wiki.centos.org/TipsAndTricks/ApacheVhostDir

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM