Comments (5)
I took a stab to see if auto-enabling could be done simply, e.g. by including this in ~/.amp/apache.d:
<IfModule !rewrite_module>
LoadModule rewrite_module modules/mod_rewrite.so
</IfModule>
Unfortunately, this doesn't work in Debian/Ubuntu. They use this non-portable statement:
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
The best bet is probably to search for a few commands (apachectl
, apache2ctl
, a2enmod
) and run something like:
apache2ctl -t -D DUMP_MODULES
from amp.
Yeah, i was just burned by this. How about a phpinfo() type of approach? Or maybe this: http://php.net/manual/en/function.apache-get-modules.php.
Please advise and i'll work on it.
For posterity: One result of this is that Drupal login fails.
from amp.
That function is probably a little sensitive to operating environment -- e.g. on MAMP 3.x, confirmed to work with mod_php5 but not work on php-cli. (Haven't tested fastcgi/fpm - but guessing they wouldn't work.)
Maybe one could some kind of patch to the canary app (amp test
; TestCommand, canary.php) which runs in httpd to make it report a warning if it's not available.
from amp.
I agree this must be a check/warning. Enabling mod_rewrite on debian/ubuntu would require "sudo a2enmod rewrite".
New idea. Do you want amp to be opinionated like this and require rewrite be enabled? Or would you rather make this a config:set parameter?
from amp.
I'd vote for fairly opinionated -- although I agree it may be a little too tight to require mod_rewrite per se.
If we were really pushing it, I'd prefer to have a behavioral test which is independent of the httpd type. The behavioral test basically checks: "Does httpd correctly pass requests to the PHP front-controller? If not, display common tips for fixing that."
To do a behavioral test, we could update the canary app to include its own .htaccess (with a rewrite rule) -- when running amp test
, the request would no longer bet for http://localhost:7979/canary.php
-- it would be http://localhost:7979/canary/clean/url/example
from amp.
Related Issues (20)
- amp config - Better advice on httpd
- Connection must originate on localhost HOT 3
- Nginx support HOT 3
- NginX: Restrict access to sensitive directories
- Is app/defaults/services.yml distributed? HOT 1
- Warning: file_get_contents(http://localhost:7979/index.php): failed to open stream: Connection refused HOT 5
- nginx vhost view doesn't detect whether php is running on a port or a socket. HOT 3
- No random characters at the end of database name HOT 9
- amp config fails for invalid mysql config HOT 10
- amp config failed to read :7979 HOT 6
- Update README.md
- permissions: worldWritable not working for unprivileged users HOT 4
- Detect if we're running with encrypted home directories and suggest using AMPHOME instead HOT 3
- Allow longer database names HOT 5
- Make apache vhost config 12 factor friendly HOT 2
- Apache access denied without +x for user home directory
- Explicitly identify common stacks/environments
- Clarity / documentation
- Add ability to pass db user and password when creating (as we do with url etc) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amp.