Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

config for h2o webserver #263

Open
basbebe opened this issue Feb 29, 2016 · 2 comments
Open

config for h2o webserver #263

basbebe opened this issue Feb 29, 2016 · 2 comments

Comments

@basbebe
Copy link

basbebe commented Feb 29, 2016

for anyone who's interested, these are settings that seem to work for the h2o web server (I'm running it on FreeBSD with PHP-FPM on demand):

# vi: ft=yaml
# see https://h2o.examp1e.net/ for detailed documentation
# see h2o --help for command-line options and settings
user: www
pid-file: /var/run/h2o.pid
access-log: /var/log/h2o/h2o-access.log
error-log: /var/log/h2o/h2o-error.log

expires: 1 day
file.dirlisting: off
file.send-gzip: on
gzip: ON

#header.add: "x-frame-options: deny"
#header.add: "X-Content-Type-Options: nosniff"
#header.add: "strict-transport-security: max-age=15768000; includesubdomains; preload"
#header.add: "X-Xss-Protection: 1; mode=block"

listen:
    host: 127.0.0.1
    port: 80

listen:
    host: 127.0.0.1
    port: 443
    ssl:
        minimum-version: TLSv1.2
        # generate your own certificates
        certificate-file: /usr/local/etc/h2o/server.crt
        key-file: /usr/local/etc/h2o/server.key

# per-host configuration

file.custom-handler:
    extension: .php
    fastcgi.connect:
        port: /var/run/php-fpm.sock
        type: unix
    fastcgi.send-delegated-uri: OFF
    fastcgi.timeout.io: 630000
    fastcgi.timeout.keepalive: 630000


file.index: [ 'index.php' ]

hosts:
    example.com:
        paths:
            "/":
                file.dir: "/usr/local/www/push"
                redirect:
                  url: /index.php/
                  internal: YES
                  status: 307
            "/Microsoft-Server-ActiveSync":
                redirect:
                  url: /index.php/
                  internal: YES
                  status: 307
@basbebe
Copy link
Author

basbebe commented Feb 29, 2016

I have to correct myself – sending emails doesn't seem to work (it worked with nginx, nothing else changed).

I get:

29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->Logon(): User '[email protected]' is authenticated on '{10.0.0.3:143/imap/tls/novalidate-cert}'
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] ZPush::CommandNeedsPlainInput(1): false
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] StringStreamWrapper::Open(): len = 0
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] StringStreamWrapper::Open(): Using php://temp
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] StringStreamWrapper::Open(): len = 0
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] StringStreamWrapper::Open(): Using php://temp
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->SendMail(): RFC822: 1 bytes  forward-id: 'false' reply-id: 'false' parent-id: 'false' SaveInSent: 'true' ReplaceMIME: 'false'
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->SendMail(): We get the new message
29/02/2016 13:10:45 [56919] [ WARN] [[email protected]] /usr/local/www/push/include/mimeDecode.php:512 Uninitialized string offset: 0 (8)
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->SendMail(): We get the From and To
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->getIdentityFromSql() - Connected to SQL Database
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->getIdentityFromSql() - Searching From with filter: select user, name from mailbox where username = '[email protected]'
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->getIdentityFromSql() - No entry found in SQL Database
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->getFromHeaderValue(): No From address defined, we try for a default one
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->setReturnPathValue(): No Return-Path address defined, we use From
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->SendMail(): is a new message or we are replacing mime
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->SendMail(): Copying new headers
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->SendMail(): Final mail to send:
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] BackendIMAP->sendMessage(): SendingMail with smtp
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 220 mail.example.com ESMTP Postfix (FreeBSD)
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Send: EHLO push.example.com

29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-mail.example.com
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-PIPELINING
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-SIZE 104857600
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-ETRN
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-STARTTLS
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-ENHANCEDSTATUSCODES
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-8BITMIME
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-DSN
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250 SMTPUTF8
29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Send: STARTTLS

29/02/2016 13:10:45 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 220 2.0.0 Ready to start TLS
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Send: EHLO push.example.com

29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-mail.example.com
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-PIPELINING
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-SIZE 104857600
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-ETRN
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-AUTH PLAIN LOGIN
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-ENHANCEDSTATUSCODES
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-8BITMIME
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250-DSN
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250 SMTPUTF8
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Send: AUTH LOGIN

29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 334 XXXXXXXX
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Send: YYYYYYYYYYYYYY=

29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 334 XXXXXXXX
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Send: YYYYYYYYYYYYY

29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 235 2.7.0 Authentication successful
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Send: MAIL FROM:<[email protected]>

29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250 2.1.0 Ok
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Send: DATA

29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 554 5.5.1 Error: no valid recipients
29/02/2016 13:10:46 [56919] [ERROR] [[email protected]] Net_SMTP error: Invalid response code received from server

==> /var/log/z-push/z-push-error.log <==
29/02/2016 13:10:46 [56919] [ERROR] [[email protected]] Net_SMTP error: Invalid response code received from server

==> /var/log/z-push/z-push.log <==
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Send: RSET

29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 250 2.0.0 Ok
29/02/2016 13:10:46 [56919] [ERROR] [[email protected]] Mail<smtp> error: Failed to send data [SMTP:  (code: 554, response: 5.5.1 Error: no valid recipients)]

==> /var/log/z-push/z-push-error.log <==
29/02/2016 13:10:46 [56919] [ERROR] [[email protected]] Mail<smtp> error: Failed to send data [SMTP:  (code: 554, response: 5.5.1 Error: no valid recipients)]

==> /var/log/z-push/z-push.log <==
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] BackendIMAP->sendMessage(): send return value
29/02/2016 13:10:46 [56919] [ INFO] [[email protected]] StatusException: BackendIMAP->sendMessage(): The email could not be sent - code: 120 - file: /usr/local/www/push/backend/imap/imap.php:2498
29/02/2016 13:10:46 [56919] [ WARN] [[email protected]] HTTPReturnCodeException: BackendIMAP->sendMessage(): The email could not be sent - code: 500 - file: /usr/local/www/push/lib/request/sendmail.php:132
29/02/2016 13:10:46 [56919] [ INFO] [[email protected]] User-agent: 'Apple-iPhone8C1/1304.20'
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Flushing 0, headers already sent? no
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] BackendIMAP->close_connection(): disconnected from IMAP server
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] LoopDetection->ProcessLoopDetectionTerminate()
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Memory usage information: 2224312/2621440 - Execution time: 1.4760 - HTTP responde code: 500
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] -------- End
29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Send: QUIT

29/02/2016 13:10:46 [56919] [DEBUG] [[email protected]] Net_SMTP DEBUG: Recv: 221 2.0.0 Bye

It works again when I switch back to nginx…

@basbebe
Copy link
Author

basbebe commented Jan 3, 2017

Anyone using H2O successfully?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant