Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
According to my documentation, since version 2.0, the User configuration command, which would be used to make this happen, is only valid in the global context, meaning that it applies to all virtual servers that run on a single machine. The only way that I can see to get the effect you want is to have your system respond to several IP addresses, and configure a separate httpd instance (with its own configuration file specifying the IP address to listen on) for each user.
This is less efficient, and (probably) more costly, but could produce the result you said you wanted. Otherwise, you are stuck with all virtual servers using the same User/Group spec. This may not be too bad if you use the default protections (755 or 750), since you can establish each user's webspace with them as owner, and a group that includes apache as a legal member. The only other problem is script privileges; for that there is a separate facility called suExec; I recommend a good read of the manual for that if script execution is what you are trying to control.
I imagine the reason you want to do this is for serving pages out of the users' home directories? Is this correct?
In any case, this isn't usually done. Standard practice is to assign those users to the apache group rather than have apache run as those users.
What is it that you are trying to achieve?
The reason I'm trying to do this is as follows. I'm currently hosting 3 websites, two of them are mine, and one is my buddy's. I set it up, which might be wrong, by creating 3 different users, and serving the web docs out of public_html in their directories.
Now the problem occurs when I use Joomla. When I first copy all the files and folders into the directory, everything is good. Ownership is "james:users" on all files and folders. But when I am using Joomla, and I install a third party component, that components folder, and files, are now "www:users". And sometimes, when I am using the administrator panel, and want to remove that component, it fails, becuase of ownership problems.
So I'm trying to figure out a way, that is consistent throughout.
Suexec will enable you to run the cgi (I presume joomla is a cgi) as different users providing you set a User and Group in the respective virtualhost sections.
If you are running Joomla via something like mod_perl or mod_php you are going to have a headache... Because this will execute the scripts as the user & group apache runs as without the possibility of suexec wrapping.
The files and directories created by Joomla will have ownership reflecting the process' user and group. This is why if suexec is used it will be a better fit for your home-directory seperation, this creates new processes and switches to the appropriate user and group.
The mod_perl/mod_php approach runs the dynamic parts in the apache process context, largely incompatible with traditional apache-based virtual hosting.