Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

apache config

Posted on 2001-08-08
18
Medium Priority
?
205 Views
Last Modified: 2010-03-04
Hi,
i have configured apache on one server.
its working quite fine.
when i say http://www.myserver.com
it is working.

now i want to browse my homedirectory, so when i give http://www.myserver.com/~msnr

it is not displaying the page.
it is saying the requested url was not found.

how to enable that..???


msnr
0
Comment
Question by:msnr
  • 10
  • 8
18 Comments
 
LVL 15

Expert Comment

by:samri
ID: 6366860
Basically you can not browse to you home directory by default.  If you still insist to do that, create an alias which point to you home directory.  For example, if your homedir  is /home/msnr

Alias /msnr /home/msnr

<Directory "/home/msnr">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

or another options is to use the homedir feature that is built into apache.  This will require you to create a dir name public_html (by default) in you home directory.  The access will be in the form of http://yourserver/~login

Excerpt from httpd.conf
#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>

#

Almost all configuration syntax and example are properly laid out in the apache config file.

good luck
0
 
LVL 1

Author Comment

by:msnr
ID: 6367526
Hi samri,

i have added the alias entry as u said.
and i have given permissions 755 to my login msnr directory.

but when i say http://myserver.com/~msnr

it is saying

Forbidden

You don't have permission to access /~msnr/ on this server.

what could be the problem.?

msnr
0
 
LVL 15

Accepted Solution

by:
samri earned 150 total points
ID: 6371006
msnr,

Just to double check:  I have proposed two options, which one do you take, the one with Alias or the pre-defined home_dir.


My config that works:
----
Alias /samri /export/home/samri

<Directory "/export/home/samri">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
----
And the URL.  And please make sure the last slash (/) is there.

http://www.myserver.com:8000/samri/

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:msnr
ID: 6371118
Hi samri,

i have added the alias entry as u said.
and i have given permissions 755 to my login msnr directory.

but when i say http://myserver.com/~msnr

it is saying

Forbidden

You don't have permission to access /~msnr/ on this server.

what could be the problem.?

msnr
0
 
LVL 1

Author Comment

by:msnr
ID: 6371124
samri,

thanks for the response,
i have taken the alias entry among the two u proposed.

i have given the same thing,
and given like this
http://myserver.com/~msnr/

still it is saying permission problem.

suggest me .


msnr
0
 
LVL 15

Expert Comment

by:samri
ID: 6373168
msnr,

since you have taken the Alias approach, try accessing the url by /msnr/ only and not (~).
/~msnr/ is for the 2nd option (the public_html approach).

Btw, what is the error message in the server log (error_logs)
0
 
LVL 1

Author Comment

by:msnr
ID: 6375060
thanks samri,
it is working,

but i have to set manually for each login id.

so can u tell me how to configure ~msnr.

In my httpd.conf  public_html is already there.
what else should i need to do.?
should i need to add any extra package for that.?



msnr
0
 
LVL 15

Expert Comment

by:samri
ID: 6375867
msnr,

The following config is from httpd.conf file should work.  On my machine the permission is 755.  The dir public_html should be a directory in user home dir. Not you do not need any extra packages to enable this.

Excerpt from httpd.conf
                     #
                     # UserDir: The name of the directory which is appended onto a user's home
                     # directory if a ~user request is received.
                     #
                     <IfModule mod_userdir.c>
                        UserDir public_html
                     </IfModule>

                     #

Link to Apache Docs website:

And yes, I believe that each login (user) should have their own public_html (or whatever dir you decide it to be).  It will take some line of shell scripts to do that.  But it really depends to the user (who own their homedir to decide whether they want to utilize it or not).

http://httpd.apache.org/docs/mod/mod_userdir.html

Another option is to look at mod_rewrite (http://httpd.apache.org/docs/mod/mod_rewrite.html), where you can utilize apache's url rewriting feature to further enhance mass virtual hosting.

This section (http://httpd.apache.org/docs/misc/rewriteguide.html) is very helpful.
0
 
LVL 1

Author Comment

by:msnr
ID: 6378512
thanks samri,

but can i make config, so that total user homedirectory will come insted of only public_html directory on the browser when i say http://myserver.com/~login/
?

or can i replace public_html with user home directory name, so that full directory will come.?

msnr
0
 
LVL 1

Author Comment

by:msnr
ID: 6378604
one more thing samri,
i have created one public_html directory
and when i say http://myserver.com/msnr

it is working fine.

but when i say http://myserver.com/~msnr/

it is giving the error.

why.?

msnr
0
 
LVL 15

Expert Comment

by:samri
ID: 6378977
msnr,

I think the http://myserver.com/msnr works because of the Alias directives that you enabled earlier.  But the http://myserver.com/~msnr/ is still not working really puzzled be.  Have you checked the  httpd.conf for the directive (aplogy if this is a repetition), but based on my experience, it should be quite straight forward.

Basically the public_html dir dan be anything, as long as it correspond with the on in  the httpd.conf.  The directory should be inside the users homedir.  For example if my homedir if /export/home/samri, the full path tp public_html should be /export/home/samri/public_html.

Another thing that you might want to double check the is following keywords, see if it is there.

LoadModule userdir_module     libexec/mod_userdir.so
.
.
AddModule mod_userdir.c

Another thing is to look in the  error log (error_log), try doing a
tail -f error_log  (make sure the path is correct), and try (from your browser), to go to http://myserver.com/~msnr/

0
 
LVL 1

Author Comment

by:msnr
ID: 6379123
my httpd.conf is like this...
is it ok..??


UserDir public_html

<IfModule mod_userdir.c>
UserDir public_html
</IfModule>

msnr
0
 
LVL 15

Expert Comment

by:samri
ID: 6380648
msnr,

it looks ok to me.

so does it works?

If it still does not work, check for the "AddModule mod_userdir.c" in the config file, and see if it does exist.

Or perhaps,

UserDir public_html

without the "<IfModule>... </IfModule>"... give it a try.
0
 
LVL 15

Expert Comment

by:samri
ID: 6380701
msnr,

The is somehow quite a similar Question in PAQ.

http://www.experts-exchange.com/jsp/qShow.jsp?ta=apache&qid=20159495

I can' purchase the solution due to "Javascript error on EE".

From the description, it sounds similar to your userdir problem.

I'll post it as soon as I can view the page.
0
 
LVL 1

Author Comment

by:msnr
ID: 6382843
my httpd.conf is like this...
is it ok..??


UserDir public_html

<IfModule mod_userdir.c>
UserDir public_html
</IfModule>

msnr
0
 
LVL 15

Expert Comment

by:samri
ID: 6383035
-- quoted from
http://www.experts-exchange.com/jsp/qShow.jsp?ta=apache&qid=20159495
--
  From: izwiz  Date: 08/02/2001 10:41AM PST
Are the permissions on the users directory set so that the apache user (normally nobody) has read access?

Please recheck the permission on public_html diretory.  Makefure the httpd user has read access to it.  chmod 755 public_html should do the work.

0
 
LVL 1

Author Comment

by:msnr
ID: 6384236
nice response from samri.
0
 
LVL 1

Author Comment

by:msnr
ID: 6384237
nice response from samri.
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Loops Section Overview
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question