1 (edytowany przez kermu 2020-05-02 19:36:09)

Temat: AH00126: Invalid URI in request

Próbuję uruchomić frontend Kalkun do gammu-smsd na wirtualce

Po wejściu na stronę:
http://sms2.domena.pl:81/index.php

gdzie index.php zawiera:
<?php phpinfo(); ?>

W przeglądarce komunikat:
"Bad Request
Your browser sent a request that this server could not understand."

/var/log/apache2/sms2.domena.pl-error_log

[Sat May 02 18:23:25.692137 2020] [authz_core:debug] [pid 12330] mod_authz_core.c(818): [client 10.0.3.250:51390] AH01626: authorization result of Require all granted: granted
[Sat May 02 18:23:25.692371 2020] [authz_core:debug] [pid 12330] mod_authz_core.c(818): [client 10.0.3.250:51390] AH01626: authorization result of <RequireAny>: granted

[Sat May 02 18:23:25.692534 2020] [core:error] [pid 12330] [client 10.0.3.250:51390] AH00126: Invalid URI in request '\xe2\x80\x9c/php/php-cgi\xe2\x80\x9d/index.php' 'GET /index.php HTTP/1.1'

[Sat May 02 18:23:26.120253 2020] [authz_core:debug] [pid 12332] mod_authz_core.c(818): [client 10.0.3.250:51391] AH01626: authorization result of Require all granted: granted
[Sat May 02 18:23:26.120484 2020] [authz_core:debug] [pid 12332] mod_authz_core.c(818): [client 10.0.3.250:51391] AH01626: authorization result of <RequireAny>: granted


/etc/apache2/extra/httpd-vhosts.conf

<VirtualHost sms2.domena.pl:81>
    ServerAdmin sms2@domena.pl
    DocumentRoot "/var/www/sms2domena.pl"
    ServerName sms2.domena.pl
    ServerAlias www.sms2.domena.pl
    ErrorLog "/var/log/apache2/sms2.domena.pl-error_log"
    CustomLog "/var/log/apache2/sms2.domena.pl-access_log" common

<Directory "/var/www/sms2.domena.pl">
        order deny,allow
        deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
        Allow from 10.0.0.0/255.0.0.0
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
</VirtualHost>

/etc/apache2/apache2.conf

ServerRoot "/usr"
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

LoadModule actions_module lib/apache2/mod_actions.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 alias_module lib/apache2/mod_alias.so

<IfModule unixd_module>

User apache
Group apache

</IfModule>

###############   MAIN config

ServerAdmin you@example.com
ServerName sms2.domena.pl

DocumentRoot "/usr/share/apache2/htdocs"

<Directory />
    AllowOverride none
    Require all denied
</Directory>

<Directory "/www">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

ErrorLog "/var/log/apache2/error_log"

#LogLevel warn
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/ "/www/cgi-bin/"
    ScriptAlias /php/ "/usr/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-gzip .tgz
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php
    #AddHandler cgi-script .cgi
    #AddHandler type-map var
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
</IfModule>

#MIMEMagicFile /etc/apache2/magic

#Include /etc/apache2/extra/httpd-mpm.conf
#Include /etc/apache2/extra/httpd-multilang-errordoc.conf
#Include /etc/apache2/extra/httpd-autoindex.conf
#Include /etc/apache2/extra/httpd-languages.conf
#Include /etc/apache2/extra/httpd-userdir.conf
#Include /etc/apache2/extra/httpd-info.conf
Include /etc/apache2/extra/httpd-vhosts.conf
#Include /etc/apache2/extra/httpd-manual.conf
#Include /etc/apache2/extra/httpd-dav.conf
#Include /etc/apache2/extra/httpd-default.conf

# Configure mod_proxy_html to understand HTML4/XHTML1
<IfModule proxy_html_module>
Include /etc/apache2/extra/proxy-html.conf
</IfModule>

#Include /etc/apache2/extra/httpd-ssl.conf
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

Action application/x-httpd-php “/php/php-cgi”

Gdzie może być błąd ?
Z góry dziękuję za pomoc
Krzysztof

2

Odp: AH00126: Invalid URI in request

Czy ty to na pewno robisz na openwrt? Bo chyba raczej nie...

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3 (edytowany przez kermu 2020-05-02 18:58:47)

Odp: AH00126: Invalid URI in request

Openwrt 19.07 x86 na ALIX 1E smile

root@sms2:/etc# opkg list-installed
apache - 2.4.43-1
base-files - 204.2-r10947-65030d81f3
bluez-libs - 5.50-5
br2684ctl - 2.5.2-7
busybox - 1.30.1-5
ca-bundle - 20190110-2
cgi-io - 16
chat - 2.4.7.git-2019-05-25-3
comgt - 0.32-32
comgt-ncm - 0.32-32
dmidecode - 3.2-1
dnsmasq - 2.80-15
dropbear - 2019.78-2
e2fsprogs - 1.44.5-2
firewall - 2019-11-22-8174814a-1
flashrom - 1.0-2
fstools - 2020-01-18-189b41b6-1
fwtool - 2
gammu - 1.41.0-2
getrandom - 2019-06-16-4df34a4d-3
glib2 - 2.58.3-5
gzip - 1.10-2
hostapd-common - 2019-08-08-ca8c2bd2-2
htop - 2.2.0-2
hwclock - 2.34-1
ip6tables - 1.8.3-1
iptables - 1.8.3-1
iw - 5.0.1-1
iwinfo - 2019-10-16-07315b6f-1
jshn - 2020-02-27-7da66430-1
jsonfilter - 2018-02-04-c7e938d6-1
kernel - 4.14.171-1-3ae3b29984920a219471e83e2c7d07f2
kmod-8139cp - 4.14.171-1
kmod-ath - 4.14.171+4.19.98-1-1
kmod-ath5k - 4.14.171+4.19.98-1-1
kmod-ath9k - 4.14.171+4.19.98-1-1
kmod-ath9k-common - 4.14.171+4.19.98-1-1
kmod-atm - 4.14.171-1
kmod-bluetooth - 4.14.171-1
kmod-button-hotplug - 4.14.171-3
kmod-cfg80211 - 4.14.171+4.19.98-1-1
kmod-crypto-aead - 4.14.171-1
kmod-crypto-cbc - 4.14.171-1
kmod-crypto-cmac - 4.14.171-1
kmod-crypto-ecb - 4.14.171-1
kmod-crypto-ecdh - 4.14.171-1
kmod-crypto-hash - 4.14.171-1
kmod-crypto-hw-geode - 4.14.171-1
kmod-crypto-kpp - 4.14.171-1
kmod-crypto-manager - 4.14.171-1
kmod-crypto-null - 4.14.171-1
kmod-crypto-pcompress - 4.14.171-1
kmod-crypto-sha1 - 4.14.171-1
kmod-hid - 4.14.171-1
kmod-input-core - 4.14.171-1
kmod-input-evdev - 4.14.171-1
kmod-ip6tables - 4.14.171-1
kmod-ipt-conntrack - 4.14.171-1
kmod-ipt-core - 4.14.171-1
kmod-ipt-nat - 4.14.171-1
kmod-ipt-offload - 4.14.171-1
kmod-ledtrig-gpio - 4.14.171-1
kmod-ledtrig-heartbeat - 4.14.171-1
kmod-ledtrig-netdev - 4.14.171-1
kmod-lib-crc-ccitt - 4.14.171-1
kmod-lib-crc16 - 4.14.171-1
kmod-mac80211 - 4.14.171+4.19.98-1-1
kmod-mii - 4.14.171-1
kmod-mppe - 4.14.171-1
kmod-nf-conntrack - 4.14.171-1
kmod-nf-conntrack6 - 4.14.171-1
kmod-nf-flow - 4.14.171-1
kmod-nf-ipt - 4.14.171-1
kmod-nf-ipt6 - 4.14.171-1
kmod-nf-nat - 4.14.171-1
kmod-nf-reject - 4.14.171-1
kmod-nf-reject6 - 4.14.171-1
kmod-nls-base - 4.14.171-1
kmod-ppp - 4.14.171-1
kmod-pppoa - 4.14.171-1
kmod-pppoe - 4.14.171-1
kmod-pppox - 4.14.171-1
kmod-regmap-core - 4.14.171-1
kmod-sched-core - 4.14.171-1
kmod-slhc - 4.14.171-1
kmod-solos-pci - 4.14.171-1
kmod-usb-core - 4.14.171-1
kmod-usb-ehci - 4.14.171-1
kmod-usb-net - 4.14.171-1
kmod-usb-net-cdc-mbim - 4.14.171-1
kmod-usb-net-cdc-ncm - 4.14.171-1
kmod-usb-net-huawei-cdc-ncm - 4.14.171-1
kmod-usb-ohci - 4.14.171-1
kmod-usb-ohci-pci - 4.14.171-1
kmod-usb-serial - 4.14.171-1
kmod-usb-serial-ch341 - 4.14.171-1
kmod-usb-serial-option - 4.14.171-1
kmod-usb-serial-wwan - 4.14.171-1
kmod-usb-uhci - 4.14.171-1
kmod-usb-wdm - 4.14.171-1
kmod-usb2 - 4.14.171-1
kmod-via-rhine - 4.14.171-1
libaio - 0.3.112-1
libapr - 1.7.0-1
libaprutil - 1.6.1-2
libatomic1 - 7.5.0-2
libattr - 2.4.48-1
libblkid1 - 2.34-1
libblobmsg-json - 2020-02-27-7da66430-1
libc - 1.1.24-2
libcomerr0 - 1.44.5-2
libcurl4 - 7.66.0-1
libedit - 20191025-3.1-1
libelf1 - 0.177-1
libexpat - 2.2.9-1
libext2fs2 - 1.44.5-2
libf2fs6 - 1.12.0-3
libffi - 3.2.1-3
libftdi1 - 1.4-3
libgcc1 - 7.5.0-2
libip4tc2 - 1.8.3-1
libip6tc2 - 1.8.3-1
libiwinfo-lua - 2019-10-16-07315b6f-1
libiwinfo20181126 - 2019-10-16-07315b6f-1
libjson-c2 - 0.12.1-3
libjson-script - 2020-02-27-7da66430-1
libkmod - 20-2
libltdl7 - 2.4.6-2
liblua5.1.5 - 5.1.5-3
liblucihttp-lua - 2019-07-05-a34a17d5-1
liblucihttp0 - 2019-07-05-a34a17d5-1
liblzma - 5.2.4-5
libmariadb - 10.2.31-2
libmbedtls12 - 2.16.6-1
libmount1 - 2.34-1
libncurses6 - 6.1-5
libnl-tiny - 0.1-5
libopenssl1.1 - 1.1.1g-1
libpci - 3.6.2-3
libpcre - 8.43-1
libpq - 11.3-1
libpthread - 1.1.24-2
librt - 1.1.24-2
libsmartcols1 - 2.34-1
libss2 - 1.44.5-2
libssh2-1 - 1.9.0-2
libstdcpp6 - 7.5.0-2
libubox20191228 - 2020-02-27-7da66430-1
libubus-lua - 2019-12-27-041c9d1c-1
libubus20191227 - 2019-12-27-041c9d1c-1
libuci20130104 - 2019-09-01-415f9e48-3
libuclient20160123 - 2019-05-30-3b3e368d-1
libusb-1.0-0 - 1.0.22-2
libusb-compat4 - 0.1.5-2
libustream-openssl20150806 - 2019-11-05-c9b66682-2
libuuid1 - 2.34-1
libxml2 - 2.9.9-2
libxtables12 - 1.8.3-1
linux-atm - 2.5.2-7
logd - 2019-06-16-4df34a4d-3
lua - 5.1.5-3
luci - git-20.057.55219-13dd17f-1
luci-app-firewall - git-20.057.55219-13dd17f-1
luci-app-opkg - git-20.057.55219-13dd17f-1
luci-base - git-20.057.55219-13dd17f-1
luci-lib-ip - git-20.057.55219-13dd17f-1
luci-lib-jsonc - git-20.057.55219-13dd17f-1
luci-lib-nixio - git-20.057.55219-13dd17f-1
luci-mod-admin-full - git-20.057.55219-13dd17f-1
luci-mod-network - git-20.057.55219-13dd17f-1
luci-mod-status - git-20.057.55219-13dd17f-1
luci-mod-system - git-20.057.55219-13dd17f-1
luci-proto-ipv6 - git-20.057.55219-13dd17f-1
luci-proto-ppp - git-20.057.55219-13dd17f-1
luci-theme-bootstrap - git-20.057.55219-13dd17f-1
mariadb-client - 10.2.31-2
mariadb-client-base - 10.2.31-2
mariadb-common - 10.2.31-2
mariadb-server - 10.2.31-2
mariadb-server-base - 10.2.31-2
mc - 4.8.23-2
mkf2fs - 1.12.0-3
mtd - 24
netifd - 2019-08-05-5e02f944-1
odhcp6c - 2019-01-11-e199804b-16
odhcpd-ipv6only - 2019-12-16-e53fec89-3
openssh-sftp-server - 8.0p1-1
openwrt-keyring - 2019-07-25-8080ef34-1
opkg - 2020-01-25-c09fe209-1
partx-utils - 2.34-1
pciutils - 3.6.2-3
php7 - 7.2.30-1
php7-cgi - 7.2.30-1
php7-cli - 7.2.30-1
php7-fastcgi - 7.2.30-1
php7-mod-hash - 7.2.30-1
php7-mod-mysqli - 7.2.30-1
php7-mod-mysqlnd - 7.2.30-1
php7-mod-openssl - 7.2.30-1
ppp - 2.4.7.git-2019-05-25-3
ppp-mod-pppoa - 2.4.7.git-2019-05-25-3
ppp-mod-pppoe - 2.4.7.git-2019-05-25-3
pppdump - 2.4.7.git-2019-05-25-3
pppstats - 2.4.7.git-2019-05-25-3
procd - 2020-01-24-31e4b2df-1
resolveip - 2
rpcd - 2019-11-10-77ad0de0-1
rpcd-mod-file - 2019-11-10-77ad0de0-1
rpcd-mod-iwinfo - 2019-11-10-77ad0de0-1
rpcd-mod-luci - 20191114
rpcd-mod-rrdns - 20170710
smstools3 - 3.1.21-2
soloscli - 1.04-2
tc - 5.0.0-2.1
terminfo - 6.1-5
ubox - 2019-06-16-4df34a4d-3
ubus - 2019-12-27-041c9d1c-1
ubusd - 2019-12-27-041c9d1c-1
uci - 2019-09-01-415f9e48-3
uclient-fetch - 2019-05-30-3b3e368d-1
uhttpd - 2020-02-12-2ee323c0-1
unixodbc - 2.3.7-1
urandom-seed - 1.0-1
urngd - 2020-01-21-c7f7b6b6-1
usb-modeswitch - 2017-12-19-f40f84c2-2
usbutils - 007-10
usign - 2019-08-06-5a52b379-1
wireless-regdb - 2019.06.03
wpad-basic - 2019-08-08-ca8c2bd2-2
wwan - 2014-07-17-1
zlib - 1.2.11-3
zoneinfo-core - 2019b-1

4 (edytowany przez kermu 2020-05-02 19:04:00)

Odp: AH00126: Invalid URI in request

Przed chwilą sprawdzałem bez wirtualki  z

#<VirtualHost sms2.domena.pl:81>
/etc/apache2/extra/httpd-vhosts.conf
ale dalej to samo po wrzuceniu index.php do
/usr/share/apache2/htdocs

Apache działa niezależnie na porcie 81 od uhttpd na porcie 80

5

Odp: AH00126: Invalid URI in request

I jako root masz ustawiony /var/www czyli pamięć ram?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

6

Odp: AH00126: Invalid URI in request

/etc/php.ini

[PHP]
zend.ze1_compatibility_mode = Off

; Language Options

engine = On
;short_open_tag = Off
precision    =  12
y2k_compliance = On
output_buffering = Off
;output_handler =
zlib.output_compression = Off
;zlib.output_compression_level = -1
;zlib.output_handler =
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 100

;open_basedir =
disable_functions =
disable_classes =

; Colors for Syntax Highlighting mode.  Anything that's acceptable in
; <span style="color: ???????"> would work.
;highlight.string  = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg      = #FFFFFF
;highlight.default = #0000BB
;highlight.html    = #000000

;ignore_user_abort = On
;realpath_cache_size = 16k
;realpath_cache_ttl = 120

; Miscellaneous

expose_php = On

; Resource Limits

max_execution_time = 30    ; Maximum execution time of each script, in seconds.
max_input_time = 60    ; Maximum amount of time each script may spend parsing request data.
;max_input_nesting_level = 64
memory_limit = 8M    ; Maximum amount of memory a script may consume.

; Error handling and logging

; Error Level Constants:
; E_ALL             - All errors and warnings (includes E_STRICT as of PHP 6.0.0)
; E_ERROR           - fatal run-time errors
; E_RECOVERABLE_ERROR  - almost fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often result
;                     from a bug in your code, but it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it's automatically initialized to an
;                     empty string)
; E_STRICT            - run-time notices, enable to have PHP suggest changes
;                     to your code which will ensure the best interoperability
;                     and forward compatibility of your code
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
; E_DEPRECATED      - warn about code that will not work in future versions
;                     of PHP
; E_USER_DEPRECATED - user-generated deprecation warnings
;
; Common Values:
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE
;error_reporting  =  E_ALL & ~E_NOTICE & ~E_STRICT
error_reporting =  E_ALL | E_STRICT



display_errors = On
display_startup_errors = Off
log_errors = Off
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
;report_zend_debug = 0
track_errors = Off
;html_errors = Off
;docref_root = "/phpmanual/"
;docref_ext = .html
;error_prepend_string = "<font color=#ff0000>"
;error_append_string = "</font>"
; Log errors to specified file.
error_log = /var/log/php_errors.log
; Log errors to syslog.
;error_log = syslog

; Data Handling

;arg_separator.output = "&amp;"
;arg_separator.input = ";&"
variables_order = "EGPCS"
request_order = "GP"
register_globals = Off
register_long_arrays = Off
register_argc_argv = On
auto_globals_jit = On
post_max_size = 8M
;magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
;default_charset = "iso-8859-1"
;always_populate_raw_post_data = On

; Paths and Directories

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;doc_root =
;doc_root =/usr/share/apache2/htdocs
user_dir =
extension_dir = "/usr/lib/php"
extension=gd.so
extension=sockets.so
enable_dl = On
;cgi.force_redirect = 1
;cgi.nph = 1
;cgi.redirect_status_env = ;
cgi.fix_pathinfo=1
;fastcgi.impersonate = 1;
;fastcgi.logging = 0
;cgi.rfc2616_headers = 0

; File Uploads

file_uploads = On
upload_tmp_dir = "/tmp"
upload_max_filesize = 2M
max_file_uploads = 20

; Fopen wrappers

allow_url_fopen = On
allow_url_include = Off
;from="john@doe.com"
;user_agent="PHP"
default_socket_timeout = 60
;auto_detect_line_endings = Off

7

Odp: AH00126: Invalid URI in request

Jak to jest lede to wywal apache. W lede apache miał problem z działaniem.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

8

Odp: AH00126: Invalid URI in request

Dodałem  w apache2.conf

DocumentRoot "/usr/share/apache2/htdocs"

potem

apachectl restart

ale to nie rozwiązało problemu ...