after a bit of searching, i was not able to find a way to test the apache server for the existence of the PHP module and mod_rewrite using a bash script. however, that doesn't mean it's impossible, so i'm creating this issue in hopes that somebody else can figure it out ;)

it would make for a nice addition to the server requirements checking we already do...

Comments

bart jansens’s picture

Try "apache2ctl -D DUMP_MODULES". It shows a list like this:

Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 expires_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 status_module (shared)
 userdir_module (shared)
Syntax OK
Swampcritter’s picture

The command 'apache2ctl' is actually platform specific, so it might be better to do 'httpd -D DUMP_MODULES' instead.

bart jansens’s picture

Actually httpd is just as platform specific. For example on debian, the binary is called apache2.

I don't think there is a command that will work on all distributions, but there is already a platform-specific variable $APACHECTL that can be reused.

On a side note, do we even have to test for mod_rewrite? Drupal is still supported on servers where that module is not enabled so something like "Apache/Mysql/no rewrite" could even be an interesting additional environment to run tests. That way we can detect failures on servers without mod_rewrite as well.

hunmonk’s picture

at the time i wrote the server install script, the drupal install itself (the one running the tests) needed clean urls in order for the PIFR client to function properly -- no idea if that's changed since i wrote it.