Hi all, only discovered this amazing software last week, flashed a few devices and had a good play around until ran into a problem trying to setup a small web server...
apache seems to work just fine and /usr/bin/php-cgi also is happy to interpret php files i pass on to it in the terminal, so it must be misscommunication tween the two...
following the suggestions in user guide to use apache's Action directive to handle php scripts i run into "404 Not Found" by requesting index.php from DocumentRoot
apache's error_log contains:
[actions:info] [pid 5046] [client 192.168.1.241:38550] AH00652: File does not exist: /usr/share/apache2/htdocs/usr/bin/php-cgi/index.php
which is bizarre, I expect Action to run php interpreter with index.php as parameter, instead judging from the error it mangles a request path as follows:
requested_page_path / path_to_php_interpreter / requested_page_filename
what am I missing? here's my apache2.config:
ServerRoot "/usr"
ServerName 192.168.1.187
Listen 81
LoadModule mpm_prefork_module lib/apache2/mod_mpm_prefork.so
LoadModule authn_file_module lib/apache2/mod_authn_file.so
LoadModule authn_core_module lib/apache2/mod_authn_core.so
LoadModule authz_host_module lib/apache2/mod_authz_host.so
LoadModule authz_groupfile_module lib/apache2/mod_authz_groupfile.so
LoadModule authz_user_module lib/apache2/mod_authz_user.so
LoadModule authz_core_module lib/apache2/mod_authz_core.so
LoadModule access_compat_module lib/apache2/mod_access_compat.so
LoadModule auth_basic_module lib/apache2/mod_auth_basic.so
LoadModule reqtimeout_module lib/apache2/mod_reqtimeout.so
LoadModule filter_module lib/apache2/mod_filter.so
LoadModule mime_module lib/apache2/mod_mime.so
LoadModule log_config_module lib/apache2/mod_log_config.so
LoadModule env_module lib/apache2/mod_env.so
LoadModule headers_module lib/apache2/mod_headers.so
LoadModule setenvif_module lib/apache2/mod_setenvif.so
LoadModule version_module lib/apache2/mod_version.so
LoadModule unixd_module lib/apache2/mod_unixd.so
LoadModule status_module lib/apache2/mod_status.so
LoadModule autoindex_module lib/apache2/mod_autoindex.so
<IfModule !mpm_prefork_module>
#LoadModule cgid_module lib/apache2/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
#LoadModule cgi_module lib/apache2/mod_cgi.so
</IfModule>
LoadModule dir_module lib/apache2/mod_dir.so
#+++
LoadModule actions_module lib/apache2/mod_actions.so
LoadModule alias_module lib/apache2/mod_alias.so
<IfModule unixd_module>
User apache
Group apache
</IfModule>
ServerAdmin you@example.com
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "/usr/share/apache2/htdocs"
<Directory "/usr/share/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
<FilesMatch \.phps$>
SetHandler application/x-httpd-php
</FilesMatch>
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "/var/log/apache2/error_log"
LogLevel debug
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "/var/log/apache2/access_log" common
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/share/apache2/cgi-bin/"
</IfModule>
<IfModule cgid_module>
#Scriptsock cgisock
</IfModule>
<Directory "/usr/share/apache2/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<Directory "/usr/bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule headers_module>
RequestHeader unset Proxy early
</IfModule>
<IfModule mime_module>
TypesConfig /etc/apache2/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
</IfModule>
<IfModule proxy_html_module>
Include /etc/apache2/extra/proxy-html.conf
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Action application/x-httpd-php /usr/bin/php-cgi
Thanks!