Web Server without /MyWeb

Oxnas 810 based
Post Reply
tmohr
Posts: 2
Joined: Sat Jan 15, 2011 9:55 am

Web Server without /MyWeb

Post by tmohr » Sat Jan 15, 2011 10:08 am

Hello,

i try to get a web server running on my NAS210 that works without /MyWeb, which i find very annoying.

I installed FFP, which works great. I work by telnet on the NSA210.

I can change /etc/service_conf/httpd_zld.conf and other files. I know the changes here are not persistent, but i use for testing/debugging. Sending a kill -USR1 `cat /var/run/httpd.pid` tells the httpd to reload its configuration files. This works fine, except when there is a typo or other error in the config files. Then the httpd exits.

It seems i have no way of restarting the httpd by telnet, when i try:

/e-data/55310dbc-ebfc-4314-84c4-c75167f6e1c9/ffproot # /usr/sbin/httpd -f /etc/service_conf/httpd.conf
httpd: Syntax error on line 8 of /etc/service_conf/httpd.conf: Cannot load /usr/local/zy-pkgs/lib/libphp5.so into server: libhistory.so.4: cannot open shared object file: No such file or directory

Though the file exists and the path is correct.

Can anybody explain me why i get this error?

Is there a way to restart the httpd once it exits?

I also copied the configuration files to another place and adapted them, but i can't start another httpd on these files, i get the same error message as mentioned above.

Another question, in the config for httpd the ErrorLog is set to "syslog", can anybody tell me where this is going and how i can read it by telnet?

To start the web server my idea is to do in after-boot.sh:
- copy the config files for httpd from the memory stick to /etc/service_conf
- send a kill -USR1 to `cat/var/run/httpd.pid`

Does this look to be the right way? Or won't that work?


Thanks for any hints,
Torsten.

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Web Server without /MyWeb

Post by Mijzelf » Sat Jan 15, 2011 11:51 am

Answered here.

AgentBowler
Posts: 3
Joined: Thu Dec 20, 2012 8:03 pm

Re: Web Server without /MyWeb

Post by AgentBowler » Thu Dec 20, 2012 9:03 pm

yes, answered in german.
Considering i dont speak german and google translate was little to no help either...

any chance somone could assist me in fullfilling the same goal?

AgentBowler
Posts: 3
Joined: Thu Dec 20, 2012 8:03 pm

Re: Web Server without /MyWeb

Post by AgentBowler » Thu Dec 20, 2012 9:03 pm

yes, answered in german.
Considering i dont speak german and google translate was little to no help either...

any chance somone could assist me in fullfilling the same goal?

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Web Server without /MyWeb

Post by Mijzelf » Fri Dec 21, 2012 9:00 am

Hm. You didn't try very hard, did you? The question was the same (and also quested by the same person), and indeed in German. But the answer is in English.

Anyway, the answer is obsolete. It's about chrooted FFP. There is a package in my repository zyxel_utils, which can change the port(s) of the firmware webserver. Have a look in /ffp/start/zyxel_utils.sh (after installing the package).

tyo100
Posts: 1
Joined: Mon May 06, 2013 8:26 pm
Location: Mexico

Re: Web Server without /MyWeb

Post by tyo100 » Thu May 09, 2013 5:46 pm

Hi!, I'm working on getting, but i run web on 8080 and on my fw redirect public 80 to NAS 8080, for PHP support you need install on Zyxel the package phpmyadmin-mysql and then you can disable.

First, i made a shared folder named Websites, with 2 folders www(Web Data) and logs(:D) and then i copy config files
cp /etc/service_conf/httpd.conf /i-data/md1/Websites/
cp /etc/service_conf/httpd_zld.conf /i-data/md1/Websites/site.conf

httpd.conf contents

Code: Select all

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

LoadModule php5_module /usr/local/zy-pkgs/lib/libphp5.so
PHPIniDir /usr/local/zy-pkgs/php
LoadModule rewrite_module /usr/local/apache/modules/mod_rewrite.so
LoadModule wsgi_module /usr/local/apache/modules/mod_wsgi.so
LoadModule proxy_module /usr/local/apache/modules/mod_proxy.so
LoadModule proxy_http_module /usr/local/apache/modules/mod_proxy_http.so
Include /i-data/md1/Websites/site.conf
TypesConfig conf/mime.types

DefaultType text/plain

DirectoryIndex index.html index.htm index.php
AddHandler cgi-script .cgi
HostnameLookups Off
ServerTokens Full
ServerSignature On
ReadmeName README.html
HeaderName HEADER.html

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl                                                      
AddLanguage nn .nn                                                      
AddLanguage no .no                                                                                      
AddLanguage pl .po                                                                                      
AddLanguage pt .pt                                                                                      
AddLanguage pt-BR .pt-br                                                                                
AddLanguage ru .ru                                                                                      
AddLanguage sv .sv                                                                                      
AddLanguage zh-CN .zh-cn                                                                                
AddLanguage zh-TW .zh-tw                                                                                
                                                                                                        
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
                                                                                                        
ForceLanguagePriority Prefer Fallback                                                                   
                                                                                                        
AddDefaultCharset utf-8                                                                                 
                                                                                                        
AddCharset ISO-8859-1  .iso8859-1  .latin1                                                              
AddCharset ISO-8859-2  .iso8859-2  .latin2 .cen                                                         
AddCharset ISO-8859-3  .iso8859-3  .latin3                                                              
AddCharset ISO-8859-4  .iso8859-4  .latin4                                                              
AddCharset ISO-8859-5  .iso8859-5  .latin5 .cyr .iso-ru                                                 
AddCharset ISO-8859-6  .iso8859-6  .latin6 .arb                                                         
AddCharset ISO-8859-7  .iso8859-7  .latin7 .grk                                                         
AddCharset ISO-8859-8  .iso8859-8  .latin8 .heb                                                         
AddCharset ISO-8859-9  .iso8859-9  .latin9 .trk                                                         
AddCharset ISO-2022-JP .iso2022-jp .jis                                                                 
AddCharset ISO-2022-KR .iso2022-kr .kis                                                                 
AddCharset ISO-2022-CN .iso2022-cn .cis                                                                 
AddCharset Big5        .Big5       .big5                                                                
AddCharset WINDOWS-1251 .cp-1251   .win-1251                                                            
AddCharset CP866       .cp866                                                                           
AddCharset KOI8-r      .koi8-r .koi8-ru                                                                 
AddCharset KOI8-ru     .koi8-uk .ua                                                                     
AddCharset ISO-10646-UCS-2 .ucs2                                                                        
AddCharset ISO-10646-UCS-4 .ucs4                                                                        
AddCharset UTF-8       .utf8                                                                            
                                                                                                        
AddCharset GB2312      .gb2312 .gb                                                                      
AddCharset utf-7       .utf7                                                                            
AddCharset utf-8       .utf8                                                                            
AddCharset big5        .big5 .b5                                                                        
AddCharset EUC-TW      .euc-tw                                                                          
AddCharset EUC-JP      .euc-jp                                                                          
AddCharset EUC-KR      .euc-kr                                                                          
AddCharset shift_jis   .sjis                                                                            
                                                                                                        
AddType application/x-compress .Z                                                                       
AddType application/x-gzip .gz .tgz                                                                     
AddType application/x-httpd-php .php .phtml                                                             
                                                                                                        
#AddType application/x-httpd-php-source .phps                                                           
                                                                                                        
                                                                                                        
AddHandler type-map var
BrowserMatch "Mozilla/2" nokeepalive                                                                    
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0                                
BrowserMatch "RealPlayer 4\.0" force-response-1.0                                                       
BrowserMatch "Java/1\.0" force-response-1.0                                                             
BrowserMatch "JDK/1\.0" force-response-1.0                                                              
                                                                                                        
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully                    
BrowserMatch "^WebDrive" redirect-carefully                                                             
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully                                                     
BrowserMatch "^gnome-vfs" redirect-carefully                                                            
                                                                                                        
                                                                                                        
                                                                                                        
                                                                                                        
#<IfModule mod_ssl.c>                                                                                   
#    Include /etc/service_conf/ssl.conf                                                                 
#</IfModule>                                                                                            
                                                                                                        
#SSLCryptoDevice cryptodev  
site.conf contents

Code: Select all

ServerRoot "/usr/local/apache"
ServerName localhost
PidFile /var/run/httpd-2.pid
Timeout 300
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 15

<IfModule prefork.c>
StartServers         2
MinSpareServers      2
MaxSpareServers    5
ServerLimit     20
MaxClients         10
MaxRequestsPerChild  20
</IfModule>

<IfModule perchild.c>
NumServers           2
StartThreads         2
MinSpareThreads      2
MaxSpareThreads     5
MaxThreadsPerChild  5
</IfModule>

Listen 8080
User nobody
Group nobody
ServerAdmin you@example.com
UseCanonicalName Off
RewriteEngine on
DocumentRoot "/i-data/md1/Websites/www"

<Directory "/i-data/md1/Websites/www">
Options FollowSymLinks
AllowOverride none
Order allow,deny
Allow from all
Options ExecCGI
</Directory>

UserDir diabled
ErrorLog /i-data/md1/Websites/logs/error_log
LogLevel warn

<Directory "/usr/local/apache/cgi-bin>"
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

This error is for LD_LIBRARY_PATH
/e-data/55310dbc-ebfc-4314-84c4-c75167f6e1c9/ffproot # /usr/sbin/httpd -f /etc/service_conf/httpd.conf
httpd: Syntax error on line 8 of /etc/service_conf/httpd.conf: Cannot load /usr/local/zy-pkgs/lib/libphp5.so into server: libhistory.so.4: cannot open shared object file: No such file or directory
then you start, stop or restart http with this
LD_LIBRARY_PATH=/usr/local/zy-pkgs/lib/ /usr/sbin/httpd -k start -f /i-data/md1/Websites/httpd.conf
LD_LIBRARY_PATH=/usr/local/zy-pkgs/lib/ /usr/sbin/httpd -k stop -f /i-data/md1/Websites/httpd.conf
LD_LIBRARY_PATH=/usr/local/zy-pkgs/lib/ /usr/sbin/httpd -k restart -f /i-data/md1/Websites/httpd.conf


I hope this will serve for future reference and so sorry for my poor English

Post Reply