Jump to content

Recommended Posts

If you're doing anything with Apache, everyone says to edit you httpd.conf file. However, my /etc/apache2/httpd.conf is remarkably empty. This is the entire content:

ServerName localhost

<Directory /www/htdocs/yoursite>
     AllowOverride FileInfo
</Directory>

I've never even had a site at /www/htdocs/yoursite! However, my /etc/apache2/apache2.conf is much more full. This is the beginning bit:

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.

 

The apache2.conf file seems to be the one that operates, since I changed the 'ServerTokens Full' line to 'ServerTokens Major' and it worked. Why is it called apache2 for me, when for everyone else it's httpd??

 

Also, I've heard that taking out 'Indexes' from

<Directory "/var/www/html">
Options Indexes FollowSymLinks
</Directory>

will make it so people can't see all the files in my directory.

 

So I added this to the end of my apache2.conf:

<Directory "/home/server/mysite">
Options FollowSymLinks
</Directory>

 

But it still displays all the files in any directory! How do I fix this?

Make sure you have restarted Apache after making the changes. As for why your httpd.conf is called apache.conf it is most probably do with how your linux distro installs/sets up Apache.

 

Any directives you apply in httpd.conf will override those set in apache.conf

Why is it called apache2 for me, when for everyone else it's httpd??

 

This really depends on how Apache has been configured, either by you or your distro. For instance, Debian uses the same /etc/apache2/apache2.conf file as its main configuration, but if you look within that file there is a line that reads....

 

/etc/apache2/apache2.conf

 

And this is where you ought store changes that you make.

 

Are you using Debain or a derivative?

 

As for your question, you need to remove the Indexes directive from the place where your site is actually defined.

 

 

Are you using Debain or a derivative?

 

Yeah, I'm using Xubuntu, so that makes sense.

 

As for your question, you need to remove the Indexes directive from the place where your site is actually defined.

 

Ok, now I get it, I found the file you're talking about. It's in /etc/apache2/sites-enabled.

Thank you guys so much for the help! ;D

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.