PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, September 22, 2022

[FIXED] where should i define my virtual hosts? conf/httpd.conf or conf.d/user.conf

 September 22, 2022     apache, apache-config, apache2, virtualhost     No comments   

Issue

i have seen more than one tutorial that i have been using trying to get suPHP running on my centos 6.5 box.

first off, standard lamp virtual hosts tutorials always add virtual hosts into /etc/httpd/conf/httpd.conf however, a different tutorial that i was looking at (http://invision-web.net/web/install-configure-apache-php-suphp-virtual-hosts-centos/) puts the virtual hosts into /etc/httpd/conf.d/user.conf

is there a right or wrong way to do this? is one better than another?

also, i understand that httpd.conf is the main apache config file, but what exactly is the user.conf file?


Solution

The virtual host configurations should normally go in main Apache configuration file httpd.conf. In the article link you posted above the configuration

creates a virtual host for user invision on domains n1.invision-web.net and www.invision-web.net

. Unless you have multiple site users which require configuration at a per-user level, this is not necessary. The article does not make this clear at all.

user.conf is for per-user configuration. For example, where sites have multiple users (e.g. access to http://www.mysite.com/~pedro (delivering content from the home directory or sub-directory of user pedro) can be configured in the users.conf file. More details in Apache docs.



Answered By - suspectus
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing