Page 1 of 1

Install Bolt in Apache instead of Nginx

PostPosted: Tue Mar 25, 2014 2:09 am
by reynierpm
Hi there, I tried to install Bolt in Apache Web Server by following every step in the guide but when I try to access http://bolt.dev, which is the VH name, I got redirected to http://bolt.dev/bolt/users/edit/ with 404 Not Found error. This is the Apache VH configuration:

Code: Select all
<VirtualHost *:80>
    ServerName      bolt.dev

    DocumentRoot    "/var/www/html/bolt"
    DirectoryIndex  index.php

    <Directory "/var/www/html/bolt">
        AllowOverride None
        Allow from All
    </Directory>

    CustomLog  logs/bolt-access_log combined
    ErrorLog   logs/blot-error_log

    KeepAlive            On
    MaxKeepAliveRequests 200
    KeepAliveTimeout     5

    AddOutputFilterByType DEFLATE text/css text/plain text/html application/xhtml+xml text/xml application/xml

    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary

        ExpiresActive On
        ExpiresDefault "now plus 1 week"
        ExpiresByType image/x-icon "now plus 1 month"
        ExpiresByType image/gif    "now plus 1 month"
        ExpiresByType image/png    "now plus 1 month"
        ExpiresByType image/jpeg   "now plus 1 month"
    </IfModule>
</VirtualHost>


What I miss or what is wrong?

Re: Install Bolt in Apache instead of Nginx

PostPosted: Tue Mar 25, 2014 10:35 am
by hansfn
You have set "AllowOverride None" which means that the included .htaccess in Bolt isn't used - see Apache documentation. Also re-read the Bolt installation documentation.

Re: Install Bolt in Apache instead of Nginx

PostPosted: Tue Mar 25, 2014 10:57 am
by reynierpm
hansfn wrote:You have set "AllowOverride None" which means that the included .htaccess in Bolt isn't used - see Apache documentation. Also re-read the Bolt installation documentation.

Thanks I made it to work after change AllowOverride to All

Re: Install Bolt in Apache instead of Nginx

PostPosted: Wed Oct 22, 2014 9:40 am
by jult
People generally set AllowOverride to None because it's an enormous performance hit on apache for servers with more than a number of websites.
Is there a way to change that .htaccess stuff to be in the server .conf files instead, I mean; Offer that as an install option, please.

Re: Install Bolt in Apache instead of Nginx

PostPosted: Wed Oct 22, 2014 12:17 pm
by hansfn
Just move the content of the .htaccess file into a Directory directive in the server config. The .htaccess setup are for novice users, advanced users know what to do. (You have the same thing with for example Drupal.)

Re: Install Bolt in Apache instead of Nginx

PostPosted: Wed Oct 22, 2014 2:41 pm
by jult
Yeah I know how to do that (which was why I asked), but the bolt install errors out on the fact that .htaccess content is not correct or .htaccess is missing. Which should not matter if its all in conf already..

Re: Install Bolt in Apache instead of Nginx

PostPosted: Wed Oct 22, 2014 9:20 pm
by hansfn
Sorry, my bad. Didn't know that Bolt did something as stupid as that. Reading the source code for Bolt 1.6.9 (in app/classes/lowlevelchecks.php) is clarifying:

Code: Select all
        // Check if .htaccess is present and readable
        // tdammers@gmail.com: This is actually a bad thing to check: it means
        // that if we're running on nginx, or rewrites have been set up in the
        // main apache config (which is more efficient than doing it in
        // .htaccess), we still need a dummy .htaccess just for the sake of
        // this check. Plus we can't really tell whether what's *inside*
        // htaccess is doing the right thing or not.

:D

In Bolt 2 I see that the check is only run for Apache and can be disabled, by adding

Code: Select all
config->getVerifier()->disableApacheChecks();

to bootstrap.php