LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem with apache !!!! (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-apache-532080/)

adam_blackice 02-24-2007 05:23 PM

problem with apache !!!!
 
hello all

iam facing aproblem with my apache i want to setup an an alias that makes me able to access the documentations out side the document root .....

first i make a dir called test at the /var and

then i creat an html file at the /var/test/index.html

PHP Code:

adam@adam-laptop:/var/testcat index.html 
<html>
<
body><P>hello</p></body>
</
html

so at the apache httpd.conf file i set an alias to make this accessible by the broweser by http://localhost/test and here is the configuration that i made >

PHP Code:

<IfModule alias_module>
    
#
    # Redirect: Allows you to tell clients about documents that used to 
    # exist in your server's namespace, but do not anymore. The client 
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:

    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.
alias   /test   /var/test 

as shown i made alia /test /var/test


and when i get my apache up and want to access the page i got this error

Forbidden

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


so what is the problem how ever when i doing ls -ali for the /var/test

PHP Code:

 adam@adam-laptop:/var/testls -ali
total 12
2215235 drwxr
-xr-x  2 root root 4096 2007-02-24 05:24 .
1987137 drwxr-xr-x 20 root root 4096 2007-02-24 05:24 ..
2215236 -rw-r--r--  1 adam root   42 2007-02-24 05:25 index.html 

as the shown the index.html is owned by adam which is normal user at the system so what is the problem plz :)

ljs662_removed 02-24-2007 06:10 PM

Hi Adam,
Your post was a little confusing and i'm not quite sure what you are trying to achieve, but apache, by default, will put your internet files into /var/www and not just /var.
So just undo anything that you have done to the apache configuration file, and stick your index.html into /var/www. That should do the trick!!!
The reason that you are getting a forbidden message is because you are trying to access a directory that apache has blocked from the public. If apache did not do this anyone could access any file on your system!
Now that wouldn't be very nice would it?
Good Luck mate I hope that helps.
Luke

adam_blackice 02-24-2007 06:22 PM

thanx for ur replay but i know that and itis not a principle that the document root is located at /var/www but it can be located at htdocs dir under apache directory where u but the installation files .

by the way all i want to do to make an alias that makes me able to access html files that located out site document root and i got a permission warning however i set the permissions for normal users in the system

ljs662_removed 02-25-2007 12:02 AM

Hmmmm?
That is weird...
Must be a problem with the config file.

adam_blackice 02-25-2007 12:48 AM

MMMmmmMMMmmMMm

am sure that my config file is working well

adam_blackice 02-25-2007 05:28 AM

Hey !

any expert her can tell me what is the problem ?

henrysukumar 02-25-2007 06:01 AM

try as below,

Alias /test /var/test
<Directory /var/test>
Order allow,deny
Allow from all
</Directory>

I am very sure, but let me know whether this will help you, for more information visit http://linuxgalore.com

adam_blackice 02-25-2007 06:15 AM

i did that but still having the same problem

adam_blackice 02-25-2007 10:43 AM

thanx all it just working fine after adding what henry sukumar said

Alias /test /var/test
<Directory /var/test>
Order allow,deny
Allow from all
</Directory>

and changing the owner of the directory which i want to access it and it just fine :)


All times are GMT -5. The time now is 02:17 PM.