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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RedHat/Apache - Website Setup - What am I missing?

Status
Not open for further replies.

csirman

Programmer
Oct 8, 2001
15
0
0
US
I've got a RedHat 8.0 Linux box runing the latest
version of Apache. I'm trying to setup a new user/website.
So far creating the user/website is no problem, but I can't
hit the site from the browser. What am I missing?? This is
what I'm doing:

I have a website registered: it is
pointing to my box. If I browse to it before doing the
below, I get the index.html page I have sitting in
/var/ That works great.

What I want to do is setup a user called getinvest and
put the website in getinvest's home directory so when
I browse to Apache is serving the page:
/home/getinvest/website/index.html

Here is what I'm doing:

#Start in /home as a user with root privledges

#Create the user and assign them to their group and the
#apache group
/usr/sbin/useradd getinvest -G apache

#Create the user's password
passwd getinvest

#Create the subdirectorie under their home directory
cd getinvest
mkdir website


#FTP to the box as getinvest from another box and
#upload a simple file called index.html into the
#website directory. This works great.


#Add the website dir to the apache group
chown -R apache.apache website

#Change the permissions so apache/getinvest have
#access to the files
chmod -R 2770 website


#This is my httpd.conf file
<VirturalHost 76.30.132.66>

ServerName ServerAdmin webmaster@getinvest.com

DocumentRoot /home/getinvest/website

</VirturalHost>


#Restart the web server
/usr/sbin/httpd -k restart


I would expect at this point I should be able to
browse to and be shown

/home/getinvest/website/index.html

I would also expect that I should be able to
browse to:


I can't do either! What have I missed?

Thanks!
 
I can get to your site-

This is getinvest.com Web site
It was created on 2003-02-06-16-47
 
It seems to be working fine. You may have to clear the cache in you browser if youve been there before you made the changes.
 
That's because I fixed it! :)

Actually there were several minor issues with the above. Corrected here:

----------------------------------------------------------

#Start in /home as a user with root privledges

#Create the user and assign them to their group and the
#apache group
#/usr/sbin/useradd getinvest -G apache
#CHANGED - No need to add to the apache group
/usr/sbin/useradd getinvest

#Create the user's password
passwd getinvest

#Create the subdirectories under their home directory
cd getinvest
mkdir website

#FTP to the box as getinvest from another box and
#upload a simple file called index.html into the
#website directory. This works great.

#Add the website dir to the apache group
#chown -R apache.apache website
#CHANGED - ChangeOwner to getinvest full/apache read/exec
chown -R getinvest.apache website

#Change the permissions so apache/getinvest have
#access to the files
chmod -R 2770 website


#This is my httpd.conf file

#Added Next Line
NameVirtualHost 76.30.132.66

<VirtualHost 76.30.132.66> #Virtual was spelled VirtuRal

ServerName ServerAdmin webmaster@getinvest.com

DocumentRoot /home/getinvest/website

#Added Next Line so index.html would come up
#without specifing DirectoryIndex index.php index.html index.htm

</VirtualHost> #Virtual was spelled VirtuRal


#Restart the web server
/usr/sbin/httpd -k restart

----------------------------------------------------------

I'm all set now.. just need to figure out how to limit the user when they FTP in. I don't want them to go up or see up the directory tree, only down. Guess I'll move that question to another forum.
 
Try ProFTPD. It is setup to jail your users by default.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top