Wt on Apache2 with mod_fcgid configuration throwing error

Throwing error when browsing hello.wt

Ubuntu distribution:

Distributor ID: Neon
Description:    KDE neon 6.0
Release:        22.04
Codename:       jammy

Apache2 version

Server version: Apache/2.4.52 (Ubuntu)
Server built:   2024-07-17T18:57:26

Appche2 Error snippet

[2024-Aug-12 02:41:43.736] 29974 - [info] "WServer/wthttp: fatal: Document root (--docroot) was not set."
[Mon Aug 12 02:41:43.737088 2024] [fcgid:warn] [pid 29910:tid 139722038322752] (104)Connection reset by peer: [client 127.0.0.1:36194] mod_fcgid: error reading data from FastCGI server
[Mon Aug 12 02:41:43.737218 2024] [core:error] [pid 29910:tid 139722038322752] [client 127.0.0.1:36194] End of script output before headers: hello.wt

contents of the fcgi.conf

<IfModule mod_fcgid.c>
            AddHandler fcgid-script .wt
            FcgidIPCDir /var/lib/apache2/fcgid
            FcgidIdleTimeout 100
            FcgidMaxProcessesPerClass 1
            FcgidInitialEnv WT_DOC_ROOT=/var/www/wt/
            DocumentRoot /var/www/wt
    
            <Directory /hello/hello.wt>
               Options +ExecCGI -Indexes
               FcgidWrapper "/var/www/wt/examples/hello/hello.wt --docroot=."
               Require all granted
            </Directory>
    
            <IfModule mod_mime.c>
               AddHandler fcgid-script .fcgi
            </IfModule>
</IfModule>

contents of my site config

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin [email protected]
    DocumentRoot /var/www/wt/
    ServerName wt.example.com

    ScriptAlias /cgi-bin/ /var/www/wt/
    <Directory "/var/www/wt">
       Options +ExecCGI -Indexes +FollowSymLinks +MultiViews
       Require all granted
    </Directory>

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

Not much documentation on this, and seems I’ve gotten pretty far in this; I would not be seeing the error, if the module was not at least getting called. 🙂

The crux of this biscuit is –docroot is not being set when executing using mod_fcgid within apache2.

When starting hello.wt from the CLI in terminal, it expects –docroot, as well as –http-listen parameters passed which then starts listening. The example starts an wthttp instance listening on 0.0.0.0:8080. This all works, and my C++ code is compiled, and executes correctly in the browser.

The issue is when trying to configure mod_fcgid with the above configuration. It’s still looking for –docroot parameter. How can I set this within the configuration? or how can I compile the examples to have this preset?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật