2

Platform: Mac OSX Maverics

Web Server: built-in apache with mod-rewrite, php5_module enabled

Steps to repro:

  • cd /Users/username/Sites/
  • mkdir bolt chmod a+rx bolt
  • download bolt zip distro
  • tar -xzf bolt_latest.tgz
  • chmod -R 777 files/ app/database/ app/cache/ app/config/ theme/
  • made sure php is enabled by creating a test.php inside bolt directory, accessed via browser, all OK
  • attempted to access http://localhost/~username/bolt observed 404 "/bolt/bolt/users/edit does not exist on this server"
  • .htaccess manipulations did not change anything (like enabling rewrite, etc)
  • Apache error logs report: /Users/username/Sites/bolt/bolt does not exist

I attempted to move the bolt directory to the main Document Root denoted in httpd.conf with exactly the same results.

Please advise why I cannot get your app running given all the instructions. All advice is greatly appreciated.

5 Answers5

3

I had this problem while deploying a bolt application to amazon ec2.

This is what made it work for me:

1) Edit http.conf:

sudo nano /etc/httpd/conf/http.conf

2) Change "AllowOverride None" to "AllowOverride All" in both sections:

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
AllowOverride All

3) Restart httpd:

sudo service httpd restart

After those changes the first login page worked fine.

Kiko Castro
  • 612
  • 6
  • 15
2

There's most likely a configuration problem somewhere with Apache or with mod_rewrite being handled.

Since the redirect to /bolt/bolt/users/edit happens we know the app is loading ok so just need to sort the redirects out.

Here's an Apache setup that works on OSX and makes it a bit easier for you to add more sites. Open the file found at: /etc/apache2/users/.conf

Make sure it has the following lines inside it:

NameVirtualHost *:80

<VirtualHost *:80>
    VirtualDocumentRoot /Users/<user>/Sites/%1/public
    UseCanonicalName Off
    SetEnv ENV development
    <Directory /Users/<user>/Sites>
      Order allow,deny
      Allow from all
    </Directory>
    <Directory /Users/<user>/Sites/*/public>
      Options Indexes FollowSymLinks MultiViews
      Order allow,deny
      Allow from all
      AllowOverride All
    </Directory>
    FallbackResource /index.php
</VirtualHost>

Take care to replace every instance of:

<user> 

with your username.

Then restart apache and you can put any site in ~/Sites//public

And it will serve any site:

<site>.dev 

from

~/Sites/<site>/public
Ross Riley
  • 826
  • 5
  • 8
  • Thank you Ross, I am sure this config would work in a normal set of circumstances. In my case it resulted in `[error] [client ::1] Request exceeded the limit of 10 subrequest nesting levels due to probable confguration error` - something was not right with rewrite rules. In the end I got tired of it and downloaded MAMP (that Bopp below advised) and Bolt worked right out of the box. – Greg Slonim Oct 15 '14 at 18:18
2

Apache error logs report: /Users/username/Sites/bolt/bolt does not exist

This means that it's not picking up on the rewrite. Are you positive mod_rewrite is working correctly?

I use OSX to dev as well, and I'm using MAMP or XAMPP. They are much friendlier to use than OSX's built-in server, imho.

Bopp
  • 664
  • 3
  • 5
1

The question specifically says their server had mod_rewrite enabled, but I wanted to highlight that this might not be true on your machine. In my case, mod_rewrite was not enabled. Running sudo a2enmod rewrite fixed the problem.

salsbury
  • 2,777
  • 1
  • 19
  • 22
0

I am not used to dealing with the builtin Apache server, but I also work with MAMP and have had similar troubles on several online servers.

If I have a error message, then I just have to set the PHP version I need with

SetEnv PHP_VER 5_4

If I have a 404 on users/edit, then I need to map the registry

AddType x-mapp-php5.4 .php
AddHandler x-mapp-php5.4 .php 

This may not be exactly what you are experiencing, but just in case it helps...

mskfisher
  • 3,291
  • 4
  • 35
  • 48
makar
  • 1