|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
[httpd] 'fastcgi param' syntax error [Solved]
hi. i cant set fastcgi param and i get syntax error.
httpd.conf Code:
prefork 10 server "test.example.com" { ... location match "^.+%.php$" { fastcgi socket "/run/php-fpm-example" fastcgi param HTTP_HOST "test.example.com" <--- syntax error } ... } ---------------------------------[Solved] answer : httpd in OpenBSD 6.4 not support fastcgi param syntax. Last edited by jonsec; 5th August 2019 at 07:01 PM. |
|
||||
This is kind of a wild guess, but looking at: https://man.openbsd.org/httpd.conf
Code:
$HTTP_HOST %n The capture index n of a string that was captured by the enclosing location match option. There is no variable : Code:
HTTP_HOST |
|
|||
Quote:
i change Code:
fastcgi param HTTP_HOST "test.example.com" Code:
fastcgi param $HTTP_HOST "test.example.com" |
|
||||
What about :
Code:
fastcgi param HTTP on; Might help you, but it is Nginx and that is also what I use, I don't normaly use httpd, and am not at all a expert. I think it would help if you could give more information, like show the complete httpd.conf, and also some explanantion about what what you need to accomplish, I did a lot of searching, and did not find anything using a line like what you show, Code:
fastcgi param HTTP_HOST "test.example.com" ======edited=== This is one document I found that might help you: https://www.openbsd.org/papers/httpd-asiabsdcon2015.pdf ==================== http://www.protoc.org/blog/2014/11/2...-httpd-server/
__________________
My best friends are parrots Last edited by PapaParrot; 3rd August 2019 at 12:08 AM. Reason: added info |
|
||||
I finally found this again. I had seen it,wanted to share it but got interrupted, and had not saved the url:
https://www.openbsd.org/httpd.conf Not knowing what you are trying to do exactly makes it hard to suggest much, however you might be able to use the above as a guide and template, modify to suit your needs, Note, in the code they use, no where do they use a line like what you have: Code:
fastcgi param HTTP_HOST "test.example.com" You should also see this: https://man.openbsd.org/bgplg.8 It may be of help to you.
__________________
My best friends are parrots |
|
|||
thanks PapaParrot.
i love OpenBSD Because its slogan is "Secure by Default". OpenBSD is Good until No get into government matters or any other service. OpenBSD Must has to stay clean. i think OpenBSD has Clear future. so i love use httpd for better security and performance. Quote:
https://man.openbsd.org/httpd.conf.5 i read this document. and find below docs : Code:
[no] fastcgi [option] Enable FastCGI instead of serving files. Valid options are: socket socket httpd passes HTTP requests to a FastCGI handler listening on the socket socket. The socket can either be a UNIX domain socket or a TCP socket listening on localhost (127.0.0.1). If the FastCGI handler is listening on a UNIX domain socket, socket is a local path name within the chroot(2) root directory of httpd(8) and defaults to /run/slowcgi.sock. Alternatively if the FastCGI handler is listening on a TCP socket, socket starts with a colon followed by the TCP port number. param variable value Sets a variable that will be sent to the FastCGI server. Each statement defines one variable. The FastCGI handler will be given the following variables by default: DOCUMENT_ROOT The document root in which the script is located as configured by the root option for the server or location that matches the request. GATEWAY_INTERFACE The revision of the CGI specification used. HTTP_* Additional HTTP headers the connected client sent in the request, if any. HTTPS A variable that is set to “on” when the server has been configured to use TLS. This variable is omitted otherwise. REQUEST_URI The path and optional query string as requested by the connected client. DOCUMENT_URI The canonicalized request path, possibly with a slash or directory index file name appended. This is the same as PATH_INFO appended to SCRIPT_NAME. SCRIPT_NAME The virtual URI path to the script. PATH_INFO The optional path appended after the script name in the request path. This variable is an empty string if no path is appended after the script name. SCRIPT_FILENAME The absolute, physical path to the script within the chroot(2) directory. QUERY_STRING The optional query string of the request. This variable is an empty string if there is no query string in the request. REMOTE_ADDR The IP address of the connected client. REMOTE_PORT The TCP source port of the connected client. REMOTE_USER The remote user when using HTTP authentication. REQUEST_METHOD The HTTP method the connected client used when making the request. SERVER_ADDR The configured IP address of the server. SERVER_NAME The name of the server. SERVER_PORT The configured TCP server port of the server. SERVER_PROTOCOL The revision of the HTTP specification used. SERVER_SOFTWARE The server software name of httpd(8). TLS_PEER_VERIFY A variable that is set to a comma separated list of TLS client verification features in use (omitted when TLS client verification is not in use). httpd configuration must provide required feature for developers. for example i have three server in different domains and i want use set `Access-Control-Allow-Origin` in header for static file. how i can? for dynamic page is possible. for example you can set this header(Access-Control-Allow-Origin) by php. also for static page is possible but no with httpd.we can use php(fastcgi) for handle static file for more maneuverability But it may have optimization and security issues. |
|
||||
The problem I am having, everything I find that goes into a lot of detail is for Nginx and not Httpd (apache). I have been trying myself using httpd, and no results that work. This leads to why I ended up using Nginx myself, instead of httpd.
I do notice no one else has jumped in here, with any suggestions, indicates to me mayve no one knows .My suggestion is to ask at this mailing list: Quote:
I used one I found here ^above^ to help me with my server, you will notice there are various in many different countries, obviously one that is from the same country, and speaks/writes in your native language would be best. I will keep trying to do something with httpd, but do not have much free time, and also am not at all a expert, but if I come up with something that works I will post about it here. I am thinking maybe with just the default httpd, that comes with the OpenBsd 6.5 , it is not enough and additional packages are needed, but not sure on that.
__________________
My best friends are parrots |
|
||||
I am sorry, I did not see that, but also still am not sure exactly what you mean Jggimi, should it be like this ?:
Code:
prefork 10 server "test.example.com" { ... } location match "^.+%.php$" { fastcgi socket "/run/php-fpm-example" fastcgi param HTTP_HOST "test.example.com" <--- syntax error } ... }
__________________
My best friends are parrots |
|
|||
Quote:
|
|
||||
That's right, a missing-brace error could be hidden in one of the redacted "..." parts, yet impact the indicated line. I think we really need to see an entire configuration file that contains the error.
|
|
||||
Httpd needs to be restarted when the conf file is changed, I am sure you know that, but just in case.
Can you show us the complete configuration file ? Also this: Code:
/run/php-fpm-example Also is your php-fpm started ok ?
__________________
My best friends are parrots |
|
|||
OpenBSD 6.4
|
|
|||
Quote:
Code:
server test { listen on * port 80 location match "^.+%.php$" { fastcgi socket "/run/php-fpm-example" fastcgi param HTTP_HOST "test.example.com" } } Quote:
Quote:
|
|
||||
This is your problem. The fastcgi syntax you are using is from OpenBSD 6.5.
You are using OpenBSD 6.4 but not referring to the OpenBSD httpd.conf(5) man page from that release.
Last edited by jggimi; 5th August 2019 at 06:59 PM. Reason: clarity |
Tags |
httpd, httpd fastcgi |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ipsec.conf Syntax error | Dr-D | OpenBSD Security | 8 | 14th November 2018 11:57 PM |
httpd fastcgi configuration and programming | hanzer | OpenBSD General | 11 | 27th February 2015 01:45 PM |
Pf.conf:29 syntax error | CyberJet | OpenBSD Security | 17 | 3rd May 2013 06:41 PM |
Am I blind? syntax error: `(' unexpected | guitarscn | Programming | 1 | 10th November 2010 08:53 PM |
shc unistd.h:239: error: syntax error before '&' token | laraaj | OpenBSD General | 3 | 11th September 2010 07:21 AM |