LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache works, now i want FTP (https://www.linuxquestions.org/questions/linux-newbie-8/apache-works-now-i-want-ftp-399158/)

AmigaSpirit 01-03-2006 02:46 PM

Apache works, now i want FTP
 
Apache works fine, and now i wanna be able to from any other computer connect and upload what ever files i wanna to my web server, but i looked almost everywhere but as a noob i am i cant find it...

Plz help me.. i use Slackware 10.1

Hangdog42 01-03-2006 03:13 PM

A full install of Slackware comes with vsftp. If you didn't do a full install, you can get the package from your favorite mirror.

AmigaSpirit 01-03-2006 03:15 PM

i did a full install but i dont find vsftp ?!
it installed 3gb i think

Did u mean vsftpd ?? i have it but how to config it ???

Hangdog42 01-03-2006 05:19 PM

Yes, vsftpd is the program you need to run. Slackware is set up to run it through inetd, and you can check that this is the case by looking at your /etc/inetd.conf file. The ftp line for vsftpd should be uncommented.

You configure vsftpd itself using the /etc/vsftpd.conf file. Be sure to read through the man page as well (man vsftpd.conf) for an explanation of the things you can configure. If you have any specific questions, post them.

AmigaSpirit 01-03-2006 05:26 PM

anything special that i need to think about to be able to manage the web pages i want on my server ???

I get some strange error mess:

500 OOPS: could not bind listening IPv4 socket

if i comment out the line in /etc/inetd.conf

#ftp stream tcp nowait root /usr/sbin/tcpd vsftpd

and start it manual from # vsftpd vsftpd.conf it works, but i want it to start when i boot and run in the background at all times..
It seems like i have missed something here but i dont know what..

Hangdog42 01-03-2006 08:11 PM

Hm. That sounds to me like a problem with inetd, not vsftpd. You might want to check that inetd is running. In /etc/rc.d the rc.inetd file should be executable and if you run lsof -i you should see that inetd is the command running ftp.

Since all inetd is doing is running vsftpd on demand, you could not use it and just leave vsftpd running all the time. You could easily start it on boot by putting the appropriate command in /etc/rc.d/rc.local.

The other thing to check is that if you are running vsftpd from inetd, you need to make sure the listen=YES line in vsftpd.conf is commented out. If it isn't commented out and inetd is running vsftpd, some odd things may happen.

AmigaSpirit 01-03-2006 08:47 PM

i got another problem also, when i upload files to my web server the files are seen but not available to view or use. i dont know what i shall do or search for.. i dont wanna use putty and ftp command to get files in to the web and be able to use em... what am i doing wrong here ?!

Thx man i got it running from inetd now.. But still i dont know how to upload stuff to it and get the pictures and files working on my web page without manually changing the attributes....
how do i do that ???

timmeke 01-04-2006 02:02 AM

Sounds to me that the file permissions are wrong when you upload a file.
This can be caused by:
-your vsftpd.conf (and ftpaccess) configuration settings
-a wrong umask value

In ftp, after you've used "put" or "mput" to upload your files, do a listing with "dir" or "ls" and
post the output of that command. That may give me a clue on what's going wrong.

One possible "quick and dirty" solution would be to execute a "chmod" operation in ftp just after the upload.
Be careful though when changing file permissions though. They contribute significantly to your website's overall security.

AmigaSpirit 01-04-2006 06:53 AM

i use flashfxp to connect and when i make a dir it gets drwx------ flags not drwxr-xr-x as the other dirs this i have to change manually with attributes (CHMOD) in flashfxp..
I dont know how to make it set the flags right from the begining...

Hangdog42 01-04-2006 07:17 AM

The way I've handled this is to create a real user/group (www:www) that both runs Apache and owns the directory for the web file. When I need to transfer files, I ftp in as www and the files are saved with the proper permissions. By default, Slackware uses the nobody:noone user and group to run Apache, but since the nobody user isn't a fully qualified user, you can't log in via ftp as nobody. So you either need to create a fully qualified user that can log in, or you just need to remember to change file permissions after you upload.

Quote:

drwx------
That actually isn't a bad thing. Basically only your Apache user is allowed to do anything to the files. Group members and everyone aren't allowed to do anything.

AmigaSpirit 01-04-2006 07:27 AM

Quote:

Originally Posted by Hangdog42
The way I've handled this is to create a real user/group (www:www) that both runs Apache and owns the directory for the web file. When I need to transfer files, I ftp in as www and the files are saved with the proper permissions. By default, Slackware uses the nobody:noone user and group to run Apache, but since the nobody user isn't a fully qualified user, you can't log in via ftp as nobody. So you either need to create a fully qualified user that can log in, or you just need to remember to change file permissions after you upload.



That actually isn't a bad thing. Basically only your Apache user is allowed to do anything to the files. Group members and everyone aren't allowed to do anything.


Ok so how do i do that ?? with apache i mean, think about the topic in this forum now... i installed linux 2 times only, and knows so little...

Hangdog42 01-04-2006 10:38 AM

Well, to create the user, you need to use the useradd command and the group with the groupadd command. Once that user and group exists, you then need to change ownership of the web files to that user/group with chown. When you create the user you also either have to make your web pages directory the users home directory or you can put a link in the new users home directory pointing to the web pages directory. You could also move your web pages to the users home.

Finally, you need to edit your httdp.conf file to reflect the new user Apache should run under and to point to the new web pages location if you changed it.

AmigaSpirit 01-04-2006 02:16 PM

Quote:

Originally Posted by Hangdog42
Well, to create the user, you need to use the useradd command and the group with the groupadd command. Once that user and group exists, you then need to change ownership of the web files to that user/group with chown. When you create the user you also either have to make your web pages directory the users home directory or you can put a link in the new users home directory pointing to the web pages directory. You could also move your web pages to the users home.

Finally, you need to edit your httdp.conf file to reflect the new user Apache should run under and to point to the new web pages location if you changed it.


Sorry but i dont have a clue what u mean that i shall do with em.... :P
I find em, see the switches for em but understand nothing, for example if i wanna add a user called oddjob how do i do ?! and the homedir i want him in is /home/oddjob and i want him to have access to manage to make dirs and add files that are shown without using any more programs to set the correct flags on the files for web users to be able to view em....

bosewicht 01-04-2006 03:09 PM

google for setting up a ftp server. There are lots of tutorials on how to do that. I would also use the LQ tutorials and wiki.

Hangdog42 01-04-2006 03:10 PM

OK.
First thing to do is create a group for oddjob. The command groupadd oddjob should do the trick. If useradd is a touch confusing, try adduser, which will ask you the questions that are needed to set up a user such as teh username, group and home directory. If you run through that, oddjob should be the owner of /home/oddjob, in which case they aren't going to have to worry much about permissions in /home/oddjob.

If you get past this, then it is time to mess with Apache. By default, Apache runs under the nobody:nogroup user and group. That means that Apache won't be able to read the files in /home/oddjob. If you want your web pages to be served out of /home/oddjob, then you need to run Apache as oddjob user. You do that by editing your /etc/apache/httpd.conf file. If you read through that, you'll find a directive that sets the user Apache runs under. Just change that to oddjob and restart Apache (/etc/rc.d/rc.httpd restart). Of course you will also have to set the document root for Apache to point to /home/oddjob if that is where your web pages are. There is another directive in httpd.conf that allows you to do that.


All times are GMT -5. The time now is 04:34 AM.