LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-15-2008, 10:11 AM   #1
prashant.kumar
LQ Newbie
 
Registered: Dec 2006
Location: New Delhi
Posts: 12

Rep: Reputation: 0
Problem in configuring public_html


I have configure my httpd.conf file .I did UseDir enable and also load user modules . I also uncomment these lines:

</IfModule>

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

but when I type in the browser http://localhost/~my_username/index.html . it showing in the log file that in /var/www/html/ ~my_username/index.html no such file. But when type only http://localhost/index.html is run the file present in the /var/www/html/ .Thats means public_html is not working. Any help is highly appreciable
 
Old 06-15-2008, 10:25 AM   #2
alitrix
Member
 
Registered: Jun 2003
Location: Netherlands, The
Distribution: Ubuntu, Kernel 2.6.7
Posts: 169

Rep: Reputation: 30
Can you show us the UserDir part?
 
Old 06-15-2008, 10:58 AM   #3
prashant.kumar
LQ Newbie
 
Registered: Dec 2006
Location: New Delhi
Posts: 12

Original Poster
Rep: Reputation: 0
Part of my httpd.conf file

### Section 2: 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin root@localhost

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work. See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
#ServerName www.example.com:80
# ServerName 172.16.3.115:80
#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.
#
UseCanonicalName Off

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
# AllowOverride None
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid. This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
# See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden
#
<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#UserDir disable

#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
UserDir public_html

</IfModule>

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
TypesConfig /etc/mime.types
 
Old 06-15-2008, 11:32 AM   #4
prashant.kumar
LQ Newbie
 
Registered: Dec 2006
Location: New Delhi
Posts: 12

Original Poster
Rep: Reputation: 0
Actually my problem is that the server try to find the file in /var/www/html/ istead of /home/user_name/public_html and showing error 404 Not Found

Last edited by prashant.kumar; 06-15-2008 at 11:50 AM.
 
Old 06-15-2008, 11:50 AM   #5
yadava
Member
 
Registered: Apr 2008
Posts: 60

Rep: Reputation: 15
first make a directory public_html inside your home directory
then make any web page inside that directory
and then run this command........
"restorecon -R /home/"
to get proper SELinux context
because SELinux prevent to read the users home directory
then try hope so it should work
 
Old 06-15-2008, 11:58 AM   #6
prashant.kumar
LQ Newbie
 
Registered: Dec 2006
Location: New Delhi
Posts: 12

Original Poster
Rep: Reputation: 0
I am using fedora 8 . It showing command not found . I have disable SElinux.My error log showing "File does not exist: /var/www/html/~sarba" when I am typing http://localhost/~sarba/index.html.Any suggestion
 
Old 06-15-2008, 12:32 PM   #7
prashant.kumar
LQ Newbie
 
Registered: Dec 2006
Location: New Delhi
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks all . I got the answer. Actually I wrote a line UserDir enable <username> and its working.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Access problem whit userdir/public_html adapter Linux - Server 1 05-13-2007 07:46 AM
apache UserDir public_html problem aeshley Linux - Newbie 4 11-29-2004 01:58 AM
useradd etc/skel public_html permissions problem bnorton787 Linux - Newbie 4 02-20-2004 06:01 PM
Problem with Apache and public_html MiB_24 Linux - General 3 07-28-2002 12:33 AM
apache UserDir public_html problem aeshley Linux - Networking 4 01-17-2002 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration