nginX - public_html - multiple CMS

Hi
Can nginX have configuration like apache user’s public_html ?

I have system where I wanna implement multiple user directory where each
user can build his own site using Drupal and Wordpress… each with it’s
own clean url

maybe the result will look like this url:

mainsite.com (/home/user_drupal/public_html)
mainsite.com (/home/user_wordpress/public_html)

Thanks for any help.

Regards, Bonn

Posted at Nginx Forum:

On Fri, Dec 31, 2010 at 11:13 PM, bonn [email protected] wrote:

Hi
Can nginX have configuration like apache user’s public_html ?

I have system where I wanna implement multiple user directory where each
user can build his own site using Drupal and Wordpress… each with it’s
own clean url

You don’t want to (do this with nginx). Especially if you can’t trust
your users.

ok, thanks all ^^

Posted at Nginx Forum:

On 31 Dez 2010 16h13 WET, [email protected] wrote:

mainsite.com
(/home/user_wordpress/public_html)

Assuming that you trust your users enough to let them run PHP code
here’s a tip from the Wiki: http://wiki.nginx.org/NginxUserDir

I suggest a simpler regex (without ? in usernames and the slash out of
the 1st group).

location ~ ^/~(?.+)/(?.*)$ {
alias /home/$username/public_html/$userpath;
}

with named capture groups or just:

location ~ ^/~(.+)/(.*)$ {
alias /home/$1/public_html/$2;
}

with numeric groups.

Note that with drupal you can have multisite installs. Therefore if
you add an A record to your domain.com zone file like, e.g.,
username.domain.com and make the domain.com/~username URI a 301
redirect you can run your own core and basic modules and let your
users create a theme and add modules as they see fit. Anyway it’s your
machine, so you make the rules.

Happy New Year,
— appa