tags:

views:

21

answers:

2

i want to have apache server to serve only /var/www/ directory now it serves all my files on system from directory "/"
i tried to edit httpd.conf placed in /etc/apache2 and placed the folllowing content in it(intially it was empty)

<Directory />
   Options None
   AllowOverride None
</Directory>
DocumentRoot "/var/www"

<Directory "/var/www">
   Options Indexes FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

then saved it,restarted apache server put the location /var/www in the web browser address bar,still it shows the higher level directories too then i edited the file Default,Default-ssl in the sites-available folder repeated the same process

still apache serves all files on my system


2.when i try to use the following command

gedit httpd.conf

I get the error

gedit:2696): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported

GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
A: 

Make it look like this:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</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">
typoknig
A: 

i tried it but nothing is changing. sever is still showing all the files.i think it is not able to accept chnges done to apache2/httpd.config files

mohit

related questions