Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting started with MAMP/WAMP #6

Open
benpixel opened this issue Dec 7, 2016 · 1 comment
Open

Getting started with MAMP/WAMP #6

benpixel opened this issue Dec 7, 2016 · 1 comment

Comments

@benpixel
Copy link

benpixel commented Dec 7, 2016

Hi there! I wanted to run frameworkless without docker or vagrant, by using good ol' MAMP and looks like I succeeded. Here is what I had to do, maybe someone will find it useful.

Edit base.html.twig to look for CSS in the right place:

<link rel="stylesheet" href="../public/assets/css/style.css">

Create a .htaccess in root directory and add:

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /public/
RewriteCond %{REQUEST_URI} !/public [NC]
RewriteRule ^(.*)$ index.php/$1 [L]

Oops, not working. Looks like .htaccess overrides are disabled.

In /Applications/MAMP/conf/apache/httpd.conf find this:

<Directory />
    Options Indexes FollowSymLinks
    AllowOverride None
</Directory>

...and replace with

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

Now, I'm wondering if there is a simpler way of doing this and is it possible that somewhere down the road this might interfere with router somehow?

@mmeyer724
Copy link
Owner

mmeyer724 commented Dec 8, 2016

From what I can tell it looks like your document root is set to be the root directory of the cloned repository instead of the public subdirectory, which is pretty risky.

For example, if I changed this line in the example nginx configuration (https://github.com/mmeyer724/Frameworkless/blob/master/misc/config/nginx/vagrant.conf#L15):

location ~ \.php$ {

to

location ~ \.meat$ {

nginx would happily start serving up my .php scripts as plaintext instead of executing them.

When your document root is set to public, the only file at risk in this case is index.php (which only contains a single line of code) -- instead of the entire application.

Note: I haven't used apache in a quite a while, so there's a decent chance I misread the .htaccess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants