Install Bolt in Apache instead of Nginx

A forum for Bolt related questions / issues

Install Bolt in Apache instead of Nginx

Postby reynierpm » Tue Mar 25, 2014 2:09 am

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?
reynierpm
 
Posts: 4
Joined: Tue Mar 25, 2014 2:06 am

Re: Install Bolt in Apache instead of Nginx

Postby hansfn » Tue Mar 25, 2014 10:35 am

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.
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Install Bolt in Apache instead of Nginx

Postby reynierpm » Tue Mar 25, 2014 10:57 am

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
reynierpm
 
Posts: 4
Joined: Tue Mar 25, 2014 2:06 am

Re: Install Bolt in Apache instead of Nginx

Postby jult » Wed Oct 22, 2014 9:40 am

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.
jult
 
Posts: 29
Joined: Sun Jun 05, 2011 9:43 pm

Re: Install Bolt in Apache instead of Nginx

Postby hansfn » Wed Oct 22, 2014 12:17 pm

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.)
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Install Bolt in Apache instead of Nginx

Postby jult » Wed Oct 22, 2014 2:41 pm

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..
jult
 
Posts: 29
Joined: Sun Jun 05, 2011 9:43 pm

Re: Install Bolt in Apache instead of Nginx

Postby hansfn » Wed Oct 22, 2014 9:20 pm

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
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway


Return to Bolt Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron