Apache virtual site default config recommendations please..

Hi,

I now have my server configured and I am writing a script to make it easy to add new sites as I need them without too much fuss..

I am looking for suggestion as to what I should include in the default setup to make it safe and secure but obviously functional as well.. :)

Below is what I would generate so far for all new sites.. If you have any recommendations please fire away and explain why what you are suggesting is a good idea..

Thanks..

 <virtualhost *:80="">ServerAdmin webmaster@domain.com
        ServerName www.domain.com
        ServerAlias alias.domain.com
        DocumentRoot /home/www.domain.com/public_html/
        ErrorLog /home/www.domain.com/logs/error.log
        CustomLog /home/www.domain.com/logs/access.log combined

        <directory home="" www.domain.com="" public_html="">Options FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all</directory> 

        <ifmodule mpm_itk_module="">AssignUserId www.domain.com www.domain.com</ifmodule></virtualhost> 

1 Reply

dunno if you would need or can put this;

 <ifmodule mod_rewrite.c="">RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule . /index.php [L]</ifmodule> 

in there as I have placed the above in a different file. (.htaccess)

Would mean that you could have the nice urls by default.

I really do not know if that would work in that way though.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct