Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Main Support Categories > Server Platforms
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Server Platforms
Discussion regarding the Ubuntu Server Edition. For more information on the Ubuntu Server Team, please visit their wiki page or Launchpad page.

 
Thread Tools Display Modes
Old 3 Weeks Ago   #1
makoReactor
First Cup of Ubuntu
 
Join Date: Oct 2007
Beans: 3
Apache web server for multiple users

I am trying to make a single web-server for multiple users to be able to log in and make their own sites, but not be able to log into anyone else's webspace.

For example, having something like http://www.domain.com/~user_name

with their own FTP to access just the /var/www/user_name section

I have looked everywhere and cannot find a guide to help me!
makoReactor is offline   Reply With Quote
Old 3 Weeks Ago   #2
volkswagner
Dark Roasted Ubuntu
 
volkswagner's Avatar
 
Join Date: May 2007
Location: NY's first capitol
Beans: 1,155
Ubuntu 9.04 Jaunty Jackalope
Re: Apache web server for multiple users

You may find what you need with ISPconfig.
__________________
Nothing is ever easy, but if it is difficult you must be doing it wrong.
volkswagner is offline   Reply With Quote
Old 3 Weeks Ago   #3
BQAggie2006
A Carafe of Ubuntu
 
Join Date: Sep 2009
Location: Dallas, TX
Beans: 118
Ubuntu 9.04 Jaunty Jackalope
Re: Apache web server for multiple users

Basically, you need to configure apache to allow for per user directories :
http://httpd.apache.org/docs/2.0/howto/public_html.html
http://ubuntuforums.org/showthread.php?t=734373

And then, configure the ftp server to allow local logins and chroot the users to their home dir:
https://help.ubuntu.com/9.10/serverg...tp-server.html
__________________
"I was thinking of the immortal words of Socrates, who said, '... I drank what?'"
-----
Intel Core2 Duo E8400 3.0GHz, 4GB DDR2 RAM, 80GB System, 500GB RAID 1 Data, nVIDIA 9800GT
BQAggie2006 is offline   Reply With Quote
Old 3 Weeks Ago   #4
GCoffee
Way Too Much Ubuntu
 
Join Date: Mar 2008
Location: South West England
Beans: 264
Ubuntu 9.10 Karmic Koala
Send a message via MSN to GCoffee
Re: Apache web server for multiple users

As I was going to say, Chroot (Jailing) users to there home directories would be step 1.

Alternatively you can chroot everyone in a certain group to their home directories, but not others.

This can be done in ProFTPD - I think its something like DefaultRoot in the config.

Sorry I cant be of more help.
__________________
GCoffee.
C#/VB.net Development.
GCoffee is offline   Reply With Quote
Old 3 Weeks Ago   #5
Thirtysixway
Ubuntu Extra Shot
 
Thirtysixway's Avatar
 
Join Date: Jun 2007
Location: Michigan
Beans: 362
Ubuntu 9.10 Karmic Koala
Send a message via AIM to Thirtysixway Send a message via MSN to Thirtysixway Send a message via Skype™ to Thirtysixway
Re: Apache web server for multiple users

Quote:
Originally Posted by GCoffee View Post
As I was going to say, Chroot (Jailing) users to there home directories would be step 1.

Alternatively you can chroot everyone in a certain group to their home directories, but not others.

This can be done in ProFTPD - I think its something like DefaultRoot in the config.

Sorry I cant be of more help.
That's what I've done. I setup apache to use mod_dir so that each user has a public_html folder they can put stuff in. Then setup proftpd to jail each user to their home directory.

There may be some other security things to take into consideration such as php's ability to include another users files. There are some php settings you can mess with to disable this (I can't recall which ones...) google could probably help with that step.

Also, using phpmyadmin you'll have to play around with the settings. Have it so each user can access username_* databases only and then they have their own private databases.
__________________
Ubuntu 8.04 Server
-Xycom 1507 Industrial Node, 39GB hdd, 1.2 GHz Intel Pentium III, 512 MB ram
Ubuntu 9.10 Desktop
-Dell Dimension B110, 52GB hdd / 18GB hdd, 2.53 GHz Intel Celeron D, 1.28 GB ram
Thirtysixway is offline   Reply With Quote
Old 3 Weeks Ago   #6
Lars Noodén
Has an Ubuntu Drip
 
Lars Noodén's Avatar
 
Join Date: Sep 2006
Beans: 737
Kubuntu 9.10 Karmic Koala
FTP is an insecure method of logging in

Quote:
Originally Posted by Thirtysixway View Post
That's what I've done. I setup apache to use mod_dir so that each user has a public_html folder they can put stuff in. Then setup proftpd to jail each user to their home directory.

There may be some other security things to take into consideration ...
Can I ask if FTP was selected on purpose? If so, why?
Was there a document online that suggested using FTP to manage web server content?

If you are interested in improving security then you can rather painlessly chroot SFTP (not FTPS) users. OpenSSH-server is probably already installed for you to manage the system administration, the sftp subsystem is built in.

You can force everyone into sftp and chroot in their home directories, and the allow a few exceptions to run wild:

Code:
# add near end of /etc/ssh/sshd_config

# all users except members of adm get chrooted
# and must use sftp, no shell access
Match Group !adm
   ChrootDirectory /var/www
   ForceCommand internal-sftp
__________________
Get a windows refund for running Ubuntu on your new computer.
Lars Noodén is offline   Reply With Quote
Old 3 Weeks Ago   #7
Thirtysixway
Ubuntu Extra Shot
 
Thirtysixway's Avatar
 
Join Date: Jun 2007
Location: Michigan
Beans: 362
Ubuntu 9.10 Karmic Koala
Send a message via AIM to Thirtysixway Send a message via MSN to Thirtysixway Send a message via Skype™ to Thirtysixway
Re: FTP is an insecure method of logging in

I selected FTP because that's what I had setup at the time. Since then I've stopped hosting for other people because of bandwidth reasons and actually I turned off port forwarding for FTP to be more secure (intranet access only for ftp.)

I may look into setting up sftp in the future, however.
__________________
Ubuntu 8.04 Server
-Xycom 1507 Industrial Node, 39GB hdd, 1.2 GHz Intel Pentium III, 512 MB ram
Ubuntu 9.10 Desktop
-Dell Dimension B110, 52GB hdd / 18GB hdd, 2.53 GHz Intel Celeron D, 1.28 GB ram
Thirtysixway is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:09 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry