Note that there are some explanatory texts on larger screens.

plurals
  1. POapache mass virtual hosting with suexec and mod_fcgid
    primarykey
    data
    text
    <p>I followed <a href="http://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-ubuntu-11.10" rel="nofollow">Falco's tutorial</a> and everything now works as expected for 2 users (e.g. john and alice) with their relevant directories (<code>/var/www/john</code> and <code>/var/ww/alice</code>).</p> <p>Now, I want to go to the next level: instead of defining different vhosts at <code>/etc/apache2/sites-available/&lt;username&gt;</code> and restarting Apache, I need <a href="http://httpd.apache.org/docs/2.2/vhosts/mass.html" rel="nofollow">dynamically configured mass virtual hosting</a>. Say, my DNS server has records for: <code>another.site.example.com</code>, I want it's home directory to be at <code>/var/www/another.site/web</code>.</p> <p>The problem is all these configuration settings for suexec and mod_fcgid. I ended to this draft of my <code>httpd.conf</code> (or should I create a file like <code>/etc/apache2/sites-available/mass_virtual</code> ?):</p> <pre><code>NameVirtualHost *:80 #default virtual host &lt;VirtualHost *:80&gt; ServerName www.example.com ServerAlias example.com ServerAdmin webmaster@example.com DocumentRoot /var/www/root/web/ &lt;IfModule mod_fcgid.c&gt; SuexecUserGroup web-admin web-admin &lt;Directory /var/www/root/web/&gt; Options +ExecCGI Options -Indexes AllowOverride All AddHandler fcgid-script .php FCGIWrapper /var/www/php-fcgi-scripts/root/php-fcgi-starter .php Order allow,deny Allow from all &lt;/Directory&gt; &lt;/IfModule&gt; # ErrorLog /var/log/apache2/error.log # CustomLog /var/log/apache2/access.log combined ServerSignature Off &lt;/VirtualHost&gt; #3rd-level subdomain virtual hosts &lt;VirtualHost *:80&gt; UseCanonicalName Off ServerAlias *.example.com #problematic email! ServerAdmin webmaster@example.com #is this /var/www/another.site/web or /var/www/www.another.site/web for #a request for www.another.site.example.com ? VirtualDocumentRoot /var/www/%-3+/web &lt;IfModule mod_fcgid.c&gt; #problematic group and user! SuexecUserGroup web1 web1 &lt;Directory /var/www/*/web/&gt; Options +ExecCGI Options -Indexes AllowOverride All AddHandler fcgid-script .php FCGIWrapper /var/www/php-fcgi-scripts/*/php-fcgi-starter .php Order allow,deny Allow from all &lt;/Directory&gt; &lt;/IfModule&gt; # ErrorLog /var/log/apache2/error.log # CustomLog /var/log/apache2/access.log combined ServerSignature Off &lt;/VirtualHost&gt; </code></pre> <ol> <li><p>As you can see from the comments I have a problematic <code>ServerAdmin webmaster@example.com</code>, a <code>SuexecUserGroup web1 web1</code> and a <code>VirtualDocumentRoot /var/www/%-3+/web</code> configuration!</p></li> <li><p>Moreover, to ensure security I think <code>IfModule</code> shouldn't exist-if <code>mod_fcgid</code> can't load then neither should the server and,</p></li> <li><p>instead of <code>Alow from all</code>, I think I should have <code>Deny from all</code> and open-up a php-library directory instead!</p></li> </ol> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload