Code Monkey home page Code Monkey logo

Comments (6)

xplicit avatar xplicit commented on June 14, 2024

Чтобы откомпилировалось во freebsd надо в файл
/src/libnative/socket-helper.c

добавить следующие includes:

#include <netinet/in.h>
#include <string.h>

после чего использовать gmake вместо make.

from hyperfastcgi.

pavel-l-kirichenko avatar pavel-l-kirichenko commented on June 14, 2024

Спасибо! Поправил, установил:

root@rat-3o3r3d3:~ # hyperfastcgi4 --help
HyperFastCgi.exe 0.4.4.0
(c) Sergey Zhukov
…

Но дальше затык.

Версии софта:

root@rat-3o3r3d3:~ # mono --version
Mono JIT compiler version 4.2.1 (Stable 4.2.1.124/39edf24 Tue Dec 22 15:13:39 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen
root@rat-3o3r3d3:~ # nginx -v
nginx version: nginx/1.8.0 

Отредактировал файл server.config:

<configuration>
    <server type="HyperFastCgi.ApplicationServers.SimpleApplicationServer">
        <!-- Host factory defines how host will be created. SystemWebHostFactory creates host in AppDomain in standard ASP.NET way --> 
        <host-factory>HyperFastCgi.HostFactories.SystemWebHostFactory</host-factory>
        <!-- <threads> creates threads at startup. Value "0" means default value --> 
        <threads min-worker="40" max-worker="0" min-io="4" max-io="0" />
        <!--- Sets the application host root directory -->
        <!-- <root-dir>/usr/local/www/nginx</root-dir> -->
    </server>
    <listener type="HyperFastCgi.Listeners.NativeListener">
        <apphost-transport type="HyperFastCgi.Transports.NativeTransport">
            <multithreading>Single</multithreading>
        </apphost-transport>
        <protocol>InterNetwork</protocol>
        <address>127.0.0.1</address>
        <port>9000</port>
    </listener>
    <apphost type="HyperFastCgi.AppHosts.AspNet.AspNetApplicationHost">
        <log level="Debug" write-to-console="true" />
        <add-trailing-slash>false</add-trailing-slash>
    </apphost>
    <web-applications>
        <web-application>
            <name>ApplicationServer</name>
            <vhost>a1.ratord.ru</vhost>
            <vport>443</vport>
            <vpath>/</vpath>
            <path>/usr/local/www/nginx/a1.ratord.ru</path>
        </web-application>
        <web-application>
            <name>MainApplicationServer</name>
            <vhost>ma1.ratord.ru</vhost>
            <vport>443</vport>
            <vpath>/</vpath>
            <path>/usr/local/www/nginx/ma1.ratord.ru</path>
        </web-application>
    </web-applications>
</configuration>

Запускаю hyperfastcgi4, и начинаются проблемы:

root@rat-3o3r3d3:~ # hyperfastcgi4 /config=/root/HyperFastCgi/samples/server.config /loglevels=All /printlog
[2015-12-25 18:48:35Z] Debug   HyperFastCgi
[2015-12-25 18:48:35Z] Debug   Threadpool minw=40,minio=4,maxw=400,maxio=400
[2015-12-25 18:48:35Z] Debug   Root directory: /root
[2015-12-25 18:48:36Z] Error   Can't create host System.IO.FileNotFoundException: Could not load file or assembly 'HyperFastCgi, Version=0.4.4.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies
File name: 'HyperFastCgi, Version=0.4.4.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'
  at (wrapper xdomain-invoke) System.AppDomain:CreateInstanceAndUnwrap (string,string)
  at (wrapper remoting-invoke-with-check) System.AppDomain:CreateInstanceAndUnwrap (string,string)
  at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) <0x186b70 + 0x00c20> in <filename unknown>:0 
  at HyperFastCgi.HostFactories.SystemWebHostFactory.CreateApplicationHost (System.Type appHostType, System.String vhost, Int32 vport, System.String vpath, System.String path) <0x185d10 + 0x00035> in <filename unknown>:0 
  at HyperFastCgi.ApplicationServers.SimpleApplicationServer.CreateAppHost (System.Type appHostType, System.Object appHostConfig, HyperFastCgi.Configuration.WebAppConfig appConfig, IListenerTransport listenerTransport, System.Type appHostTransportType, System.Object appHostTransportConfig) <0x185800 + 0x000a3> in <filename unknown>:0 
[2015-12-25 18:48:36Z] Error   Can't create host System.IO.FileNotFoundException: Could not load file or assembly 'HyperFastCgi, Version=0.4.4.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies
File name: 'HyperFastCgi, Version=0.4.4.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'
  at (wrapper xdomain-invoke) System.AppDomain:CreateInstanceAndUnwrap (string,string)
  at (wrapper remoting-invoke-with-check) System.AppDomain:CreateInstanceAndUnwrap (string,string)
  at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) <0x186b70 + 0x00c20> in <filename unknown>:0 
  at HyperFastCgi.HostFactories.SystemWebHostFactory.CreateApplicationHost (System.Type appHostType, System.String vhost, Int32 vport, System.String vpath, System.String path) <0x185d10 + 0x00035> in <filename unknown>:0 
  at HyperFastCgi.ApplicationServers.SimpleApplicationServer.CreateAppHost (System.Type appHostType, System.Object appHostConfig, HyperFastCgi.Configuration.WebAppConfig appConfig, IListenerTransport listenerTransport, System.Type appHostTransportType, System.Object appHostTransportConfig) <0x185800 + 0x000a3> in <filename unknown>:0 
[2015-12-25 18:48:36Z] Debug   Listening on port: 9000
[2015-12-25 18:48:36Z] Debug   Listening on address: 127.0.0.1
libev.c:461: Listen():  libevent version: 2.0.22-stable
libev.c:475: Listen():  libevent is using kqueue for events.

Настроил сайт nginx'а:

upstream fastcgi_backend {
  #server unix:/tmp/my-web-app.socket;
  server 127.0.0.1:9000;
  keepalive 32;
}

# HTTP server
server {
        listen   80;
        listen [::]:80;

        server_name  a1.ratord.ru www.a1.ratord.ru;
        access_log   /var/log/nginx/a1.ratord.ru.access.log;

        # Перенаправление на https
        rewrite ^ https://a1.ratord.ru$request_uri? permanent; #301-redirect
}


# HTTPS server
server {

        listen 443 ssl spdy;

        server_name  a1.ratord.ru www.a1.ratord.ru;
        access_log   /var/log/nginx/a1.ratord.ru.access.log;

    location / {
        root /usr/local/www/nginx/a1.ratord.ru/;
        index login.aspx;
        fastcgi_index login.aspx;
        fastcgi_keep_conn on;
        fastcgi_pass fastcgi_backend;
        include /usr/local/etc/nginx/fastcgi_params;
    }

    … (настройки ssl, не привожу, чтобы не засорять эфир)

}

При попытке зайти на сайт в логе hyperfastcgi4 получаю:

fcgi-transport.c:394: parse_params():   Can't find app! HOST='a1.ratord.ru' port=443 path='/login.aspx'

P.S. Читал документацию внимательно, но так и не понял отличия в конфигурационном файле server.config элементов root-dir и path. Это одно и то же?

from hyperfastcgi.

xplicit avatar xplicit commented on June 14, 2024

Во freebsd в отличии от Ubuntu, все устанавливается в /usr/local, а не в /usr, поэтому при вызове autogen.sh, нужно использовать префикс /usr/local.

./autogen.sh --prefix=/usr/local
gmake
gmake install

root-dir и path - разные вещи, в #22 можно более детально почитать, как используется root-dir

from hyperfastcgi.

pavel-l-kirichenko avatar pavel-l-kirichenko commented on June 14, 2024

Сергей, огромное спасибо. Всё работает. По сравнению с xsp (раньше использовали) — hyperfastcgi4 летает.

Предложение: могу в вики проекта написать страничку по установке и настройке hyperfastcgi4 на FreeBSD.

from hyperfastcgi.

xplicit avatar xplicit commented on June 14, 2024

Было бы здорово, если бы в wiki появилось описание шагов для установки на FreeBSD. (Про правку headers в socket-helper.c там можно не писать, я сделаю патч для build script, который решит эту проблему)

from hyperfastcgi.

pavel-l-kirichenko avatar pavel-l-kirichenko commented on June 14, 2024

Страничку создал. Правда, английский у меня пока не самый лучший, но я старался :)

from hyperfastcgi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.