[TUTORIAL] How to config your webserver first time

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.

Re: [TUTORIAL] How to config your webserver first time

Postby vandenbd » Fri Jan 20, 2012 9:59 pm

hi
what you describe in the article about dyndns, can you do hte same thing with no-ip.
i can't seem to figure out how to resolve my virtual hosts on my qnap 412
vandenbd
First post
 
Posts: 1
Joined: Sat Jan 14, 2012 12:23 am
NAS Model: TS-212

Re: [TUTORIAL] How to config your webserver first time

Postby ste8604 » Thu Jan 26, 2012 9:17 pm

a question i have a 1 domain in dyndns, like this: pippo.dyndns.org
i want make this:
stefano.pippo.dyndns.org
and
pippo.dyndns.org

all with document root share/QWeb
how to make this?? tks :D
qnap 239proII
ste8604
Getting the hang of things
 
Posts: 63
Joined: Tue Apr 13, 2010 8:24 pm
NAS Model: TS-419U

Re: [TUTORIAL] How to config your webserver first time

Postby saleoscende » Fri Mar 09, 2012 5:57 pm

Hello everybody,

I have no problem to use my TS412 from my LAN and from the web, but if I try to setup the web server, the browser remain with an "applyng, please wait..." message until it go in timeout.
Somebody had the same problem ?
This tutorial is very useful but I can't go beyond the first step.

Thank you
saleoscende
New here
 
Posts: 3
Joined: Wed Feb 29, 2012 6:48 pm
NAS Model: TS-212

Re: [TUTORIAL] How to config your webserver first time

Postby schumaku » Fri Mar 09, 2012 6:19 pm

saleoscende wrote:I have no problem to use my TS412 from my LAN and from the web, but if I try to setup the web server, the browser remain with an "applyng, please wait..." message until it go in timeout.
Not a vry common problem. cpuld be a corrupt config file, a RAM disk near full (check the system log), an incomplete fiormware installation, ...

Ensure to upgrade to the actual v3.6.1 using the process here - http://wiki.qnap.com/wiki/Manually_Updating_Firmware - and retry.
User avatar
schumaku
Guru
 
Posts: 22317
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
NAS Model: TS-x79 Pro

Re: [TUTORIAL] How to config your webserver first time

Postby saleoscende » Fri Mar 09, 2012 8:02 pm

schumaku wrote:
saleoscende wrote:I have no problem to use my TS412 from my LAN and from the web, but if I try to setup the web server, the browser remain with an "applyng, please wait..." message until it go in timeout.
Not a vry common problem. cpuld be a corrupt config file, a RAM disk near full (check the system log), an incomplete fiormware installation, ...

Ensure to upgrade to the actual v3.6.1 using the process here - http://wiki.qnap.com/wiki/Manually_Updating_Firmware - and retry.



Thank you for your replay
Now I have upgraded the firmware to 3.6.1 and the nas has 95,2 MB of free memory but I still have the problem, so I can think that it could be find in the log file as you say. Where I can find some info about it?

Thank you
saleoscende
New here
 
Posts: 3
Joined: Wed Feb 29, 2012 6:48 pm
NAS Model: TS-212

Re: [TUTORIAL] How to config your webserver first time

Postby schumaku » Fri Mar 09, 2012 8:53 pm

First thing worth checking is /etc/conf/uLinux.conf ... here you should find a block [QWEB]. In tis exammple, the Web Server is enabled, on the default port 80 (ensure no other service inlcuding the NAS Admin Web UI makes use of 80), https is enabled on port 8081, and WebDAV is enabled, too:

[QWEB]
Enable = 1
Port = 80
PHP_ZEND_SUPPORT = TRUE
Enable_SSL = 1
SSL_Port = 8081
Enable_WebDAV = 1

This should basically allow the Web server to execute. One this is set, you can try to (re)start the Web server:

[~] # /etc/init.d/Qthttpd.sh restart
...

Hard to say what's wrong on your NAS, Potentially there is some code missing or not installed, some of the default and effective config files and folders might not exist. Hard to evaluate with a few sentences. I expect we might get some insight from the above checks and settings.

Of course, you are always encouraged to contact QNAP Support - as this situation should not happen.

IS this a brand-new install, or a NAS operating for a long time already?
User avatar
schumaku
Guru
 
Posts: 22317
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
NAS Model: TS-x79 Pro

Re: [TUTORIAL] How to config your webserver first time

Postby saleoscende » Fri Mar 09, 2012 10:03 pm

Hi
thank you for your reply

I have installed the NAS from 3 moths ago, basically I tryed to setup my NAS step by step and now I try to configure the web server, but I remember that I tryed to setup it in january and I had the same problem.
Please sorry but I don't understand where I can find the .conf file, I access in the NAS from a web browser and I cant see any " sysetm folder".

Thank you
Last edited by schumaku on Fri Mar 09, 2012 10:08 pm, edited 1 time in total.
Reason: full quote removed
saleoscende
New here
 
Posts: 3
Joined: Wed Feb 29, 2012 6:48 pm
NAS Model: TS-212

Re: [TUTORIAL] How to config your webserver first time

Postby schumaku » Fri Mar 09, 2012 10:07 pm

You need to login ot the NAS shell, correct location and name is /etc/conf/uLinux.conf (i'll update the original post).

If you are not confident, please let QNAP support fix your NAS.
User avatar
schumaku
Guru
 
Posts: 22317
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
NAS Model: TS-x79 Pro

Re: [TUTORIAL] How to config your webserver first time

Postby necmon » Sun Apr 15, 2012 4:58 am

I had the interesting problem, that the confi file for apache was not suitable for my TS-412! I had no share QWeb; mine was named "Web" instead. So apache kept complaining that my documentroot did not exist (which was of course true...). After fixing the config file appropriately, it now works all very well...
necmon
New here
 
Posts: 3
Joined: Thu Dec 15, 2011 8:10 am
NAS Model: TS-212

Re: [TUTORIAL] How to config your webserver first time

Postby schumaku » Mon Apr 16, 2012 12:09 am

necmon wrote:I had the interesting problem, that the confi file for apache was not suitable for my TS-412! I had no share QWeb; mine was named "Web" instead.
The default apache.conf file does not list a DocumentRoot - it's added on the fly when starting Apache:

#!/bin/sh
# For Qweb and Qphoto
# default port: 80
...
WebShare=`/sbin/getcfg SHARE_DEF defWeb -d Qweb -f /etc/config/def_share.info`
QWEB_SLINK="/home/Qhttpd/${WebShare}"
QWEB_FOLDER="/share/${WebShare}"
...
if [ -f ${APACHE_CONF} ]; then
/bin/grep "^DocumentRoot \"/share/${WebShare}\"" ${APACHE_CONF} 1>/dev/null 2>/dev/null
[ $? = 0 ] || /bin/sed -i 's/^DocumentRoot.*$/'"DocumentRoot \"\/share\/${WebShare}\""'/g' ${APACHE_CONF}
/bin/grep "^<Directory \"/share/${WebShare}\">" ${APACHE_CONF} 1>/dev/null 2>/dev/null
[ $? = 0 ] || /bin/sed -i 's/^<Directory \"\/share\/Qweb.*$/'"<Directory \"\/share\/${WebShare}\">"'/' ${APACHE_CONF}
...


Probably the /etc/config/def_share.info was (or still is) missing at the apache.conf file generaiton time - then the fall-back will be Qfile.

Under the assumption the /etc/config/def_share.info does exist, and contains the expected data (see below) - restoring the apache.conf from the default would recover form the "document root did not exist" issue:

[~] # /etc/init.d/Qthttpd.sh stop
[~] # cp /etc/default_config/apache.conf /etc/config/apache/apache.conf
[~] # /etc/init.d/Qthttpd.sh start

Potentially, we're facing here on yet another config file corruption - it would be nice if you can check the content of the def_share.info file, example:

[~] # cat /etc/config/def_share.info
[SHARE_DEF]
defPublic = Public
defDownload = Download
defMultimedia = Multimedia
defRecordings = Recordings
defUsb = Usb
defWeb = Web
User avatar
schumaku
Guru
 
Posts: 22317
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
NAS Model: TS-x79 Pro

Re: [TUTORIAL] How to config your webserver first time

Postby s35mic » Tue Feb 12, 2013 12:10 am

I'm newbie in NAS and sorry if my question can be considered as stupid.

Now I have NAS start page like http://myname.dyndns.org / Here is access to adminiistrative panel as well as predefined multimedia services (Photo, Survielence, etc.)
After I put html files to Web directory what URL should by typed for users to reach my main web page?
I mean, if they typed http://myname.dyndns.org / then they will reach my administration panel or created Web page?
s35mic
Starting out
 
Posts: 48
Joined: Tue Jan 15, 2013 8:53 pm
NAS Model: TS-212

Re: [TUTORIAL] How to config your webserver first time

Postby pwilson » Tue Feb 12, 2013 4:00 am

s35mic wrote:I'm newbie in NAS and sorry if my question can be considered as stupid.

Now I have NAS start page like http://myname.dyndns.org / Here is access to adminiistrative panel as well as predefined multimedia services (Photo, Survielence, etc.)
After I put html files to Web directory what URL should by typed for users to reach my main web page?
I mean, if they typed http://myname.dyndns.org / then they will reach my administration panel or created Web page?


NAS Admin WebUI: http://myname.dyndns.org:8080/ or https://myname.dyndns.org
Your WebServer: http://myname.dyndns.org or https://myname.dyndns.org:8081

This of course assumes that you haven't changed the ports used for any of these URL's, and that you have your Port-Forwarding setup correctly in your Router, and that your ISP doesn't block access to ports: 80/TCP, 443/TCP, 8080/TCP or 8081/TCP.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-419P+ w/ 4 * Seagate Barracuda 2TB 5900rpm (RAID5) - FW: 3.8.1 Build 20121205
Forums: View My Profile - Search My Posts - Send Private Message - View My Photo - Top Community Forum Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs - HowTos - QNAP Video Library
User avatar
pwilson
Moderator
 
Posts: 3830
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada
NAS Model: TS-419P+

Previous

Return to Web Server & Applications (Apache + PHP + MySQL / SQLite)

Who is online

Users browsing this forum: digis and 1 guest