[TUTORIAL] How to config your webserver first time

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Locked
vandenbd
New here
Posts: 2
Joined: Sat Jan 14, 2012 12:23 am

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

Post by vandenbd »

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
ste8604
Know my way around
Posts: 101
Joined: Tue Apr 13, 2010 8:24 pm

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

Post by ste8604 »

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 firmware 4.0.2
saleoscende
New here
Posts: 3
Joined: Wed Feb 29, 2012 6:48 pm

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

Post by saleoscende »

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
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

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

Post by schumaku »

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.
saleoscende
New here
Posts: 3
Joined: Wed Feb 29, 2012 6:48 pm

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

Post by saleoscende »

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
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

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

Post by schumaku »

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?
saleoscende
New here
Posts: 3
Joined: Wed Feb 29, 2012 6:48 pm

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

Post by saleoscende »

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
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

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

Post by schumaku »

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.
necmon
New here
Posts: 3
Joined: Thu Dec 15, 2011 8:10 am

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

Post by necmon »

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...
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

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

Post by schumaku »

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
s35mic
Starting out
Posts: 48
Joined: Tue Jan 15, 2013 8:53 pm

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

Post by s35mic »

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?
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

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

Post by pwilson »

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-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
milplus
New here
Posts: 7
Joined: Fri Dec 06, 2013 12:19 am

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

Post by milplus »

thanks for the tutorial

can you advise if you are aware of working perfirmances of a drupal 7.x website sitting on a qnap nas

i have a DP7 Wesite with estore to move onto my NAS T-469 pro

i jave sone concerns becAuse i am usig now a dedicated machine on a web farm server with linus OS cento with a detailed control panel and possibility to work over SSH putty

do you know if i can install same OS on the nas in order to do not miss my familiarity with such environment?

hope you will give me a guidance

thanks
ndeasis
New here
Posts: 3
Joined: Wed Dec 01, 2010 12:20 pm

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

Post by ndeasis »

I have the TS-251 Qnap NAS anf followed the tutorial configuring website. My Wordpress website is working with internal IP http://192.168.1.x\wordpress on port 80. My problem is the port 80 which should me my wecite is always redirecting to admin window port 8080 on internal network. I could not find any article how to stop this port redirection. Thank you.
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

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

Post by pwilson »

ndeasis wrote:I have the TS-251 Qnap NAS anf followed the tutorial configuring website. My Wordpress website is working with internal IP http://192.168.1.x\wordpress on port 80. My problem is the port 80 which should me my wecite is always redirecting to admin window port 8080 on internal network. I could not find any article how to stop this port redirection. Thank you.

Code: Select all

mv /share/Web/index.php /share/Web/index.php.REDIRECT

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
Locked

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