Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Could anyone possible post a virtual host sample from a working httpd server, if possible with the most features enabled (like suPHP, suExec, php directives such as engine on off and others) ?

The reason is that i wanted to see how it is formarted, and built per vhost... it's been a long time i dont use cPanel nor have it available so i can't really get it, i've been googling for it but havent found it at all.

Much appreciated.

Edit, related to the last comment:

<Directory /home/*/www>
   AllowOverride FileInfo AuthConfig Limit
   Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI
   <Limit GET POST OPTIONS PROPFIND>
      Order allow,deny
      Allow from all
   </Limit>
   <LimitExcept GET POST OPTIONS PROPFIND>
      Order deny,allow
      Deny from all
   </LimitExcept>
</Directory>
share|improve this question

1 Answer 1

up vote 0 down vote accepted

The virtualhost section that my installation of cPanel creates looks like this:

<VirtualHost 10.0.0.100:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /home/example/public_html
    ServerAdmin webmaster@example.com
    ## User example # Needed for Cpanel::ApacheConf
        <IfModule mod_suphp.c>
        suPHP_UserGroup example example
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup example example
    </IfModule>
    CustomLog /usr/local/apache/domlogs/example.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    CustomLog /usr/local/apache/domlogs/example.com combined
    ScriptAlias /cgi-bin/ /home/example/public_html/cgi-bin/
</VirtualHost>

The PHP configuration is in /usr/local/apache/conf/php.conf:

# SuPHP configuration for PHP5
LoadModule suphp_module modules/mod_suphp.so
suPHP_Engine on
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
<Directory />
    suPHP_AddHandler application/x-httpd-php5
</Directory>

I'm not seeing anything like the section you posted, though there is this:

<Directory "/">
    Options All
    AllowOverride All
</Directory>
share|improve this answer
    
thank you very much, that is what i was looking for, now i was wondering if you could possible be able to post about your directory read/executing directive to allow public_html to not only display pages but execute codes etc... i have posted a sample on the top at my question... once again thanks. –  Prix Jun 11 '10 at 1:50
    
No problem! I don't think that WHM's apache configuration is very limiting, by the way. –  jrod Jun 11 '10 at 3:49
    
Thanks. well you dont need all those limitations it really depends on what youre doing i just wanted to make sure what one of the most used tools out there were doing ... if i am not mistaken by default a httpd installation comes with it with lines to deny all access for instance :) –  Prix Jun 11 '10 at 5:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.