LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-30-2008, 02:27 PM   #1
richinsc
Member
 
Registered: Mar 2007
Location: Utah
Distribution: Ubuntu Linux (20.04)
Posts: 224

Rep: Reputation: 32
Am I being redundant in my Apache config


I have several name-based virtual hosts on my system and I am beginning to wonder if I am being to redundant in my configuration and give myself more work then I really need. But I am also asking this from a security perspective. In each of my virtual hosts I have put the following.

Code:
<VirtualHost *:80>
        ServerAdmin email@server.com
        ServerAlias server.domain.com
        DocumentRoot /path/to/site/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /path/to/site>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order deny,allow
                deny from all
                allow from xxx.xxx.xxx.xxx/XX # Only if needed for sites with local access only. 
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
I don't think I need all of that but for logging, having logs for each site is useful, but I haven't got around to configuring it like I want, it's on my to do list this weekend.

From what i can tell I don't really need the Alias /doc/ for each virtual host but do I neeed the ScriptAlias portion and other sections or would it just be best to put the following only for each of my virtual hosts. Thus saving myself less work.

Code:
<VirtualHost *:80>
        ServerAdmin email@server.com
        ServerAlias server.domain.com
        DocumentRoot /path/to/site/
        <Directory /path/to/site>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order deny,allow
                deny from all
                allow from xxx.xxx.xxx.xxx/XX # Only if needed for sites with local access only. 
        </Directory>
</VirtualHost>
Suggestions for the best possible VirtualHost configuration are welecome.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache config mahmoud Linux - Software 2 03-14-2008 08:08 AM
apache config ph3ar Linux - Newbie 2 05-03-2007 11:54 PM
apache config xpace Linux - Networking 22 08-26-2005 03:36 AM
Apache config silmaril8n Linux - Newbie 8 11-11-2004 04:02 PM
apache config. drkfir5 Linux - Software 9 10-25-2004 02:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration