LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache, FTP and Users (https://www.linuxquestions.org/questions/linux-newbie-8/apache-ftp-and-users-158695/)

reizero 03-16-2004 07:58 PM

Apache, FTP and Users
 
I just recently installed Slackware 9.0 and succesfully set up Apache, PHP, and MySQL. The default page is showing up and everything is running smoothly. What I want to do now is be able to add users and give them webspace. Detailed things concerning this are:

1) Giving them a subfolder (ie link.com/newbie)

2) Ability to use FTP, but only letting them see their OWN folder, not any others.

3) (Extra) Subdomain. (ie newbie.link.com)

lol. Thats about it, I've road so much information on this, but can't seem to find the answer. Any help is greatly appreciated by this apache newbie. :-D

Thanks in advance,

-zero

tuxguy 03-16-2004 08:55 PM

Re: Apache, FTP and Users
 
Quote:

Originally posted by reizero
[B]I just recently installed Slackware 9.0 and succesfully set up Apache, PHP, and MySQL. The default page is showing up and everything is running smoothly. What I want to do now is be able to add users and give them webspace. Detailed things concerning this are:

1) Giving them a subfolder (ie link.com/newbie)
add public_html to the /etc/skel dir.. chmod it to 755 this places a public_html dir in every new user's dir etc. /home/newbie/public_html
apache will send all link.com/~newbie requests to newbie/public_html dir.

Quote:

2) Ability to use FTP, but only letting them see their OWN folder, not any others.
I like vsftpd install this and modify the vsftpd.conf file (in /etc dir)
anonymous_enable=NO
local_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

then create the /etc/vsftpd.chroot_list file and put the usernames you DO NOT want to be chroot'd in there (your own etc....) then restart the daemon.

Quote:


3) (Extra) Subdomain. (ie newbie.link.com)
I am not too sure if there is an easier way.. but I think using Virtualhost's in apache would suffice...

Jesse

PolyPerception 03-16-2004 08:58 PM

In your root dir you can add folders for users. The default directory for Apache is /usr/local/apache/htdocs or at least when I install from source. You can change the default directory in the config /usr/local/apache/conf/httpd.conf . Also in the config you can specify subdomains, its called "VirtualHost" in the config file, if you need help I could help with that also. Now about the FTP, you can use PureFTPd which is a really nice FTP server, which supports virtual users. Virtual users would allow for "only letting them see their OWN folder" and that is called chroot -ing. PureFTPd is at http://www.pureftpd.org

reizero 03-16-2004 10:54 PM

I added the folder to /etc/skel and I also downloaded and installed PureFTPd.

Apparently my other FTP Server Program (ProFTPd) is using the address, so I can't use PureFTPd. Is there anyway I can disable ProFTPd? or is ProFTPd better?

I think I will need some help with Apache's VirtualHost sytem. I'm sorry for being a complete newb lol. A friend of mine said "We were all newbs at least once, unless you were born into the class." lol.

Thanks for your help so far. =)

-zero

tuxguy 03-17-2004 09:48 AM

NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
#
<VirtualHost *>
ServerAdmin user1@email.com
DocumentRoot /home/newbie/public_html
ServerName newbie.link.com
ErrorLog logs/newbie.link.com-error.log
CustomLog logs/newbie.link.com-access.log common
</VirtualHost>

<VirtualHost *>
ServerAdmin user2@email.com
DocumentRoot /home/newbie2/public_html
ServerName newbie2.link.com
ErrorLog logs/newbie2.link.com-error.log
CustomLog logs/newbie2.link.com-access.log common
</VirtualHost>


etc etc etc

for proftpd find the proftpd.conf file and add DefaultRoot ~ in the file and then restart the daemon...

this will chroot all users to their home dir's....
if you want to create a "special group" that will NOT be chroot (your self).. mkgroup then add your self to that group... then add this line instead:
DefaultRoot ~ !ftp-special (were ftp-special is your group)

good luck

sirpimpsalot 03-17-2004 12:21 PM

switch to VSFTPD... jailing users works great... very secure, very fast...

PolyPerception 03-18-2004 06:53 PM

Quote:

Originally posted by reizero
Apparently my other FTP Server Program (ProFTPd) is using the address, so I can't use PureFTPd. Is there anyway I can disable ProFTPd? or is ProFTPd better?
Yes, you could stop proftpd service.

Quote:

I'm sorry for being a complete newb lol. A friend of mine said "We were all newbs at least once, unless you were born into the class."
-zero [/B]
Its just some perfer to stay there longer than others. :)


All times are GMT -5. The time now is 12:41 AM.