PDA

View Full Version : Concept Question



blackholesun
30th January 2006, 11:55 AM
Hi,

i would like to install a Server for the following purposes:

Hosting different Homepage in subfolders ( simple HTML Pages, PHP-Gallery)
I have different Users ( 1 for each page) which should connect and upload
their content via FTP.

My questions are:

Should i user virtual Users?
Which homedirectory should they get to upload their content?
Wich root-directory should i choose for apache or vsftp, so that
the ftp-users can put their content to /var/www/html/page1...page 4
or to some subdirectories under /var/ftp/page1...page4???

I´m a newbie :-) and using FC4

Thanks in advance

bob
30th January 2006, 01:34 PM
(moved to Servers)

foobar47
30th January 2006, 02:49 PM
Hi,

If you correctly add users, you should put a specific directory...
Example :

useradd -d /var/www/html/myfirstuser myfirstuser
useradd -d /var/www/html/myseconduser myseconduser

After, you can edit your httpd.conf file to make /var/www/html/myseconduser and /var/www/html/myfirstuser available on the internet...

You should chroot these users too !
Easy with vsftpd...

Example :
/etc/vsftpd.conf file :

chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

and create a file named vsftpd.chroot_list in the /etc dir and put your users into :

/etc/vsftpd.chroot_list file :

myseconduser
myfirstuser
Like that, when they will connect to your server with ftp, they will be in THEI directory and can't move in others...

Just for example !
Simply modify with what you need ... ;)

ask for more help...

blackholesun
30th January 2006, 04:03 PM
Hi again,

how di I make the directories /var/www/html/myseconduser and /var/www/html/myfirstuser available on the internet?

I know that i have to edit /etc/httpd/conf/httpd.conf, but where do i have to add the directories?

foobar47
30th January 2006, 04:55 PM
At the end by example !

like this :

<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>Put the options you want ! it's just an example !

No matter where you put this directive !

You can same create a new file in /etc/httpd/conf.d/my-conf-file.conf
which will be read by apache when starting or reloading...

In fact you have, in /etc/httpd/conf/httpd.conf a line which load all file with .conf extension :

Include conf.d/*.conf

By this way, you keep your httpd.conf file clean and if you want have some changes, go directly in files you create...

That's the best way to not be confuse... ;)

blackholesun
30th January 2006, 04:59 PM
Hi,

ich have configured Virtual Hosts with the directories /var/www/html/user1
.........../user2
Then I configured the chroot_list, I created the file and added the usernames

I was not able to connect to the ftp server because the following errormessage appeared:

500 Oops could not open chroot () list file: /etc/vsftpd.chroot_list

I checked if the file is really there and it is.... it is owned by root.root

what´s wrong?

foobar47
30th January 2006, 05:33 PM
Are you sure these lines are uncommented ?


chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

Did you restart vsftpd ?


service vsftpd restart

blackholesun
31st January 2006, 05:00 AM
Good morning,

yes i restarted the vsftpd service, and these lines in the vsftpd.conf
are uncommented.

Temporarily, i took the other method:

chroot_local_user=YES and i made the following changes
chroot_list_enable=NO
chroot_list_file=/etc/vsftpd.chroot_list

This worked....

Another question is:

I made the changes in the httpd.conf

<Directory "/var/www/html/user1">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

But when checking this from a browser, the failure 404 (Not found) appears....

foobar47
31st January 2006, 09:45 AM
Hi,
good morning... ;)

I don't think you enable chroot !!

Try to connect with user1 and try to go to in another directory than /var/www/html/user1

I think user1 can go up of user1 dir !!!

Check your link to the chroot.list file !

here is the end of my /etc/vsftpd.conf file :

# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list
#Securise la commande ls et notamment l'option -R
ls_recurse_enable=YES
pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YESHere is my /etc/vsftpd.ftpusers file :

# Users that are not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobodyHere is my /etc/vsftpd.user_list file :

# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd.ftpusers
# for users that are denied.
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

For the httpd.conf file, try this in the proper order :
<Directory "/var/www/html/user1">
AllowOverride None
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>

Perhaps, it may change...
Did you have any index.html file into this directory ??