Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache & PureFTP default directory 2

Status
Not open for further replies.

spook007

Programmer
May 22, 2002
259
US
All I'm trying to do is have Apache load the web page from a directory I specify. Right now it's pointed at /var/ I want it to go to /var/intranet/html

The other thing I'm trying to do is log in as a user and have ftp access to the /var/intranet/html directory with full control permissions.

I've read all the info I could get a hold of this past week and instead of gaining knowledge I'm just getting really confused. I've installed MySQL for authentication and have tried ProFTP with no luck I've configured files left and right and still no go. Any suggestions are welcomed! Thanks.
 
There is a config file for apache (HTTPD really) that you need to edit to set defaults up.
 
I've read stuff about setting up the DocumentRoot so that it will point to the new location, but I have no idea how or where to setup the configuration file. Half of my problem is locating the files. When apache got installed I have no idea where the files were installed, and it's not like I can find them in the KDE GUI so I've had to do a file search to find them. That's why I was wondering what the file structure was like so I can narrow my search a little. I'll keep trying I guess. Thanks.
 
I don't have "locate". I tried "locate locate", but no luck... :)

Anyway, I've found that httpd.conf tends to be in a few locations: /etc, /etc/httpd, /usr/local/apache/conf. You could try "find / -name httpd.conf" if locate doesn't work for you.

I'd suggest getting basic ftp working before dealing with external authentication. Make sure that you can ftp in as a regular user and see the home directory, then try for the web directory.
 
Once you find httpd.conf look for a directive called DocumentRoot in the 'main" server section. Change this from /var/ to /var/intranet/html. If you plan on hosting more than one site, then you will want to create VirtualHost containers instead. You will find plenty of help on setting up virtual hosting in the apache forum here at tek-tips. To get ftp to work the way you want, first chroot (jail) users to their home directories. In the case where ftp users will be webmasters of their own domains, then when you create a user, assing his webspace as his home directory. If you will be the webmaster of this domain then you would edit your regular user account (not root) and change the home directory to /var/intranet. Whenever you login with ftp, you will be placed in that directory. Below is an example of proftpd's config file:

Code:
# This is a basic ProFTPD configuration file (rename it to 
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName			"My Snazzy FTP Server"
ServerType	standalone
DefaultServer			on

# Port 21 is the standard FTP port.
Port				21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask				022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances			30

# Set the user and group under which the server will run.
User				nobody
Group				nobody

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~

# Normally, we want files to be overwriteable.
<Directory />
  AllowOverwrite		on
</Directory>

# A basic anonymous configuration, no upload directories.  If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
<Anonymous ~ftp>
  User				ftp
  Group				ftp

  # We want clients to be able to login with "anonymous" as well as "ftp"
  UserAlias			anonymous ftp

  # Limit the maximum number of anonymous logins
  MaxClients			10

  # We want 'welcome.msg' displayed at login, and '.message' displayed
  # in each newly chdired directory.
  DisplayLogin			welcome.msg
  DisplayFirstChdir		.message

  # Limit WRITE everywhere in the anonymous chroot
  <Limit WRITE>
    DenyAll
  </Limit>
</Anonymous>

This should look very much like yours so all you should have to do is look for the line in /etc/proftpd.conf that looks like this

#DefaultRoot ~

and uncomment it. If you don't have this file just copy it and paste it to /etc/proftpd.conf.
 
You guys are awsome... Thanks for the tips... I have a better understanding now on how to set this up. I have an assistant and myself that need to work on the company intranet site, so I should create a generic user like 'compFTP' that would have home directory pointed to /var/ that way we could both login as compFTP and have access to the site.

I found the files using 'locate', mind you I did find that I had files called httpd.conf and httpd2.conf so I changed them all, it's working now the way I was hoping! I appreciate your patience with this newbie! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top