Joomla + Virtualmin + correct permissions

Need help from anyone who has joomla successfully running on a virtualmin setup.

When I setup Joomla on a shared hosting account i can usually install extensions as the correct permissions .

On virtualmin when i installed joomla the directories are unwritable. I can see this via the joomla control panel. How can i install joomla with virtualmin so that the permissions are established correctly in my virtualmin setup thanks.

Are you using Virtualmin GPL or Pro?

Virtualmin GPL uses mod_php by default, which would have scripts running as the Apache user. That could be made to work, but using something like FastCGI along with suexec makes for a more secure setup without having your directories be world writable.

Details on how to set that up are available here:

http://www.virtualmin.com/node/8462

Virtualmin Pro sets up suexec for you out of the box without requiring any manual configuration – though performing the same thing in the GPL edition isn’t overly complex.

-Eric

I’m on the Virtualmin GPL.

Thanks for the tip will look at this now and see if I can make it happen.

Hi again, I could not make heads or tails out of this thread.

my apache user is www-data is there some way i can add www-data to ever usergroup created by virtual min instead?

I found this…

http://www.netadmintools.com/art560.html

Which worked for me.

this is what you need to do

Add to Apache configuration in the “public_html Directory section” (thats the virtualhost container) within the relevant VirtualServer (your domain) section:

AddHandler fcgid-script .php5
FCGIWrapper /home/example/fcgi-bin/php5.fcgi .php

So that’s webmin - servers - Apache webservers, click the domain you need - click Edit Directives, go to below section and make it look like that:
<Directory /home/yourdomain/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks ExecCGI
allow from all
AllowOverride All
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/yourdomain/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/yourdomain/fcgi-bin/php5.fcgi .php5

And just below that entry, do
<Directory /home/yourdomain/cgi-bin>
allow from all

RemoveHandler .php
RemoveHandler .php5

Create the wrapper in /home/domainname/fcgi-bin/php5.fcgi:

#!/bin/bash
PHPRC=$PWD/…/etc/php5
export PHPRC
umask 022
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
exec /usr/bin/php-cgi

So that means, log into ftp, go /home/yourdomain/ and create a folder fcgi-bin and a etc folder. In fcgi-bin folder create a file php5.fcgi and paste the above code in that file. Hit save.
go to /home/yourdomain/etc and paste the php.ini file in there (take it from /etc/php.ini).

The application files, and the fcgi wrapper must be owned by the user, and must not be world or group writable (suexec will not execute them, if they are).

Hi guys,

Thank you for your help!
I tried to do that with my virtualmin: to use suExec but it doesn’t work.
Steps:

  1. my apache config in the server template:

    SuexecUserGroup “#540” “#538
    ServerName mydomain
    […]
    <Directory /home/mydomain/public_html>
    Options -Indexes +IncludesNOEXEC ExecCGI +FollowSymLinks
    allow from all
    AllowOverride All
    AddHandler fcgid-script .php5
    FCGIWrapper /home/mydomain/fcgi-bin/php5.fcgi .php5
    […]
    <Directory /home/mydomain/cgi-bin>
    allow from all
    RemoveHandler .php
  2. the structure of the domains folder:
    cgi-bin
    etc
    fcgi-bin
    homes
    public_html
    […]
  3. in the fcgi-bin:
    -rwxr-xr-x php5.fcgi
    -rw-r–r-- php.ini

Well, did I miss something?
Thank you

Yoong

Hi guys,

Thank you for your help!
I tried to do that with my virtualmin: to use suExec but it doesn’t work.
Steps:

  1. my apache config in the server template:

    SuexecUserGroup “#540” “#538
    ServerName mydomain
    […]
    <Directory /home/mydomain/public_html>
    Options -Indexes +IncludesNOEXEC ExecCGI +FollowSymLinks
    allow from all
    AllowOverride All
    AddHandler fcgid-script .php5
    FCGIWrapper /home/mydomain/fcgi-bin/php5.fcgi .php5
    […]
    <Directory /home/mydomain/cgi-bin>
    allow from all
    RemoveHandler .php
  2. the structure of the domains folder:
    cgi-bin
    etc
    fcgi-bin
    homes
    public_html
    […]
  3. in the fcgi-bin:
    -rwxr-xr-x php5.fcgi
    -rw-r–r-- php.ini

Well, did I miss something?
Thank you

Yoong

First step before install joomla it’s to create a joomla database.
But when I create a virtual domain under virtualmin the system create an virtual domain data base.
Could I use that database for joomla? Or It’s better to crete a new data base joomla_virtualdomain.

I have 70+ Joomla sites on my VPS under Virtualmin. I just run every domain as FCGI, so that PHP executes as the domain owner. No issues, except the extra server RAM.

Good Luck,
Ken

Hi Ronald, sometime in the past I must have set my virtualmin up this way, because when I went to implement this its already exactly as you described almost. The only difference is with the php.ini file. It is set up by VM as a symlink with permissions lrwxrwxrwx.

However my joomla directories show up as not writeable via the joomla interface.

Ok I found the solution to my problem here.

http://www.virtualmin.com/documentation/installation/manual

Being on ubuntu it applied directly to me.

The answer is under the section titled
“Service Configuration” in the “Apache” section.


If installing on Ubuntu, you’ll need to edit /etc/apache2/conf.d/php5.conf, and comment out the two SetHandler lines.

Note for at least 10.04 lucid and newer php5.conf is now in /etc/apache2/mods-available and is also symlinked in /etc/apache2/mods-enabled if this mod is enabled.

So I did exactly as the above said to /etc/apache2/mods-available/php5.conf. I commented out the two SetHandler lines, restarted apache2 and looked into joomla to see the directories are now writeable.

That made me sweat.