Thread: Configuring Apache to link to contents on /etc/skel/html?

  1. #1
    POeT GuY Matus's Avatar
    Join Date
    Feb 2008
    Location
    Bz
    Posts
    235

    Configuring Apache to link to contents on /etc/skel/html?

    When i type in the address in firefox as serverip/in/username it should display the contents in that users html folder. For example: 10.0.11.25/in/username

    What do i need to configure in the apache configuration to be able to have contents displayed?


    I forgot to mention the distro sorry. I'm working on Ubuntu server 8.10
    Last edited by Matus; 03-12-2009 at 01:03 PM.
    PoEms R InsPiRatiOns of LIfE ExpErienCes!!


  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    The directory to which you refer is more likely to be /var/www/html. Apache has configuration files that control this tho, in etc/httpd (httpd is apache). Also:
    • apache must be running, start it with apachectl -k start
    • if you have doubts about your ip address, 127.0.0.1 will always work
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Depending on your distro (assuming you are using Linux), it can be found at a few different places with different names, but yes, there is a configuration file.

    On Debian (and probably Ubuntu, too), look into /etc/apache2/sites-available. You can change the default one to point to where your files are (DocumentRoot).

  4. #4
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    You could try:
    Code:
    locate httpd.conf
    From the shell, then have a dig around. You can set domain names to point to directories in this file, set the index page and other stuff. I guess you could even setup subdomains for each of your users if you wanted to.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    /etc/skel is the template which is copied to form the initial content of a new user's home directory. I seriously doubt you want to store anything there.

    Sounds like you want /in/username to access ~username/html (i.e. the html subdirectory of the specified user).

    Part of this is actually pretty easy. Just make sure mod_userdir is loaded. Then, place this configuration directive somewhere:

    UserDir html

    This will make requests to http://server/~username/index.html access ~username/html.
    The problem here is that it's not exactly the URL you want. You can use mod_rewrite to patch that up.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #6
    POeT GuY Matus's Avatar
    Join Date
    Feb 2008
    Location
    Bz
    Posts
    235
    Quote Originally Posted by MK27 View Post
    The directory to which you refer is more likely to be /var/www/html. Apache has configuration files that control this tho, in etc/httpd (httpd is apache). Also:
    • apache must be running, start it with apachectl -k start
    • if you have doubts about your ip address, 127.0.0.1 will always work
    Thanks to all of you, i ill check the things you mentioned as soon as i get back to my server this afternoon. I'll try the various things you mentioned, and see what happens, that sounds close to what a friend told me . He said Apache is currently pointing to the www and so i needed to point it to the contents in the html directory, though which file to configure was my problem. So i'll be checking what u all mentioned.
    PoEms R InsPiRatiOns of LIfE ExpErienCes!!


  7. #7
    POeT GuY Matus's Avatar
    Join Date
    Feb 2008
    Location
    Bz
    Posts
    235
    Quote Originally Posted by cyberfish View Post
    Depending on your distro (assuming you are using Linux), it can be found at a few different places with different names, but yes, there is a configuration file.

    On Debian (and probably Ubuntu, too), look into /etc/apache2/sites-available. You can change the default one to point to where your files are (DocumentRoot).
    Sorry update my thread, distro was working on is Ubuntu server 8.10, I'm gona try all you guys responses as soon as i get back to it this afternoon.

    Thanks
    PoEms R InsPiRatiOns of LIfE ExpErienCes!!


  8. #8
    POeT GuY Matus's Avatar
    Join Date
    Feb 2008
    Location
    Bz
    Posts
    235
    Quote Originally Posted by CornedBee View Post
    /etc/skel is the template which is copied to form the initial content of a new user's home directory. I seriously doubt you want to store anything there.

    Sounds like you want /in/username to access ~username/html (i.e. the html subdirectory of the specified user).

    Part of this is actually pretty easy. Just make sure mod_userdir is loaded. Then, place this configuration directive somewhere:

    UserDir html

    This will make requests to http://server/~username/index.html access ~username/html.
    The problem here is that it's not exactly the URL you want. You can use mod_rewrite to patch that up.

    Yours is the closest, but still i can't figure it out. I followed instructions from this site
    http://www.opensourcehowto.org/how-t...rectories.html

    But nada, though i think thats for windows, and I'm on ubuntu. Got any other ideas.
    PoEms R InsPiRatiOns of LIfE ExpErienCes!!


  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Post your configuration.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  10. #10
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    b/t/w I know there is an active "apache-user" forum out there, I just can't remember the address...
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  11. #11
    POeT GuY Matus's Avatar
    Join Date
    Feb 2008
    Location
    Bz
    Posts
    235
    Quote Originally Posted by CornedBee View Post
    Post your configuration.
    This is what i had on httpd.conf

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


    <Directory /home/*/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>


    I'm also geting this when i restart apache

    * Restarting web server apache2
    httpd (no pid file) not running
    PoEms R InsPiRatiOns of LIfE ExpErienCes!!


  12. #12
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Well, mod_userdir is configured to look into /home/username/public_html, not /home/username/html. You need to change the UserDir directive to change that.

    The restart error message means that there isn't an Apache already running, so it can't restart it.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  13. #13
    POeT GuY Matus's Avatar
    Join Date
    Feb 2008
    Location
    Bz
    Posts
    235
    Quote Originally Posted by CornedBee View Post
    Well, mod_userdir is configured to look into /home/username/public_html, not /home/username/html. You need to change the UserDir directive to change that.

    The restart error message means that there isn't an Apache already running, so it can't restart it.
    Yea, got your point i changed it to the below, but still nothing. You can check my error at 10.0.11.25/in/alberto, or like the page says use 10.0.11.25/~alberto but still i get nothing, you can see the error by typing that. I'm trying to get over this tonigh, i've googled so much, and all point to the configurations below. By the way this file is /etc/apache2/httpd.conf


    <IfModule mod_userdir.c>
    # UserDir disable
    UserDir html
    </IfModule>

    <Directory /home/*/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>
    PoEms R InsPiRatiOns of LIfE ExpErienCes!!


  14. #14
    POeT GuY Matus's Avatar
    Join Date
    Feb 2008
    Location
    Bz
    Posts
    235
    Quote Originally Posted by cyberfish View Post
    Depending on your distro (assuming you are using Linux), it can be found at a few different places with different names, but yes, there is a configuration file.

    On Debian (and probably Ubuntu, too), look into /etc/apache2/sites-available. You can change the default one to point to where your files are (DocumentRoot).
    Damn, i didn't notice this directorey. I changed the DocumentRoot directory to point to /etc/skel/html should it be that? or should it be /home/*/html

    I'm not sure what should go there
    PoEms R InsPiRatiOns of LIfE ExpErienCes!!


  15. #15
    POeT GuY Matus's Avatar
    Join Date
    Feb 2008
    Location
    Bz
    Posts
    235
    Ok i changed the DocumentRoot to /etc/skel/html since thats where the html folder that is shared located. /home/*/html was no allowed, it had that it didn't existed. with the /etc/skel/html i get the error Forbidden

    You don't have permission to access /in/victor on this server.
    Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.1 with Suhosin-Patch Server at 10.0.11.25 Port 80

    What do i really need to do, chmod on html?
    PoEms R InsPiRatiOns of LIfE ExpErienCes!!


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linked List, Please Help!
    By CodeMonkeyZ in forum C Programming
    Replies: 5
    Last Post: 02-17-2009, 06:23 AM
  2. I'm confused about link lists (again)
    By JFonseka in forum C Programming
    Replies: 4
    Last Post: 06-13-2008, 08:13 PM
  3. Function to check memory left from malloc and free?
    By Lechx in forum C Programming
    Replies: 4
    Last Post: 04-24-2006, 05:45 AM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. Undefined Structure in Link List
    By _Cl0wn_ in forum C Programming
    Replies: 1
    Last Post: 03-22-2003, 05:57 PM