[TUTORIAL] How to config your webserver first time

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
User avatar
thorejoha
Know my way around
Posts: 144
Joined: Mon Mar 24, 2008 9:41 pm

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

Post by thorejoha » Wed Jun 10, 2009 5:36 am

stephenpini wrote:Well, I own http://www.braia.co.uk. So what I would like is that when people type this in there web browser it goes to a website that is hosted on my QNAP. Is that possible?



Yes this is possible. But you will need to have a static IP from your broadband provider.


Ore as I do with my domain. I have just created a forwarding on my domain to my DYNDNS adress.
I have done the same with my subdomains to the other dyndns adresss I use.
My Tutorials:
Tutorial:How to config webserver on Qnas!
Tutorial:How to use loginscript and Robocopy
Tutorial:How to set up DynDNS on Qnas!
Tutorial:How to move large files on Qnas!
Tutorial:How to edit apache.conf on Qnas!
Tutorial:How to seed files and folders in Qget
Tutorial:How to fix slow wordpress on Qnas!

See also Don`s How To guide!
And Frisbe`s signatur for more Tips and Tricks!
_______________________________________
NAS nr 1: TS-109 Pro FW: 3.1.0 Build 0708T - 1 x Seagate 500Gb + 1X USB 500GB Qraid
NAS nr 2: TS-109 Pro II FW: 3.1.0 Build 0708T - 1 x Western Digital 1Tb
____________________________________________________________________________

stephenpini
Starting out
Posts: 10
Joined: Sat Jun 06, 2009 1:42 am

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

Post by stephenpini » Wed Jun 10, 2009 6:21 am

haha! Now that sounds like a good idea!

So you forward to your dyndns address? so in my case http://borto.dyndns.org

User avatar
thorejoha
Know my way around
Posts: 144
Joined: Mon Mar 24, 2008 9:41 pm

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

Post by thorejoha » Wed Jun 10, 2009 11:40 am

If you like the idea, you can upload a file named index.php to your domain.
add only this line inside it.

Code: Select all

<?php
header("Location: http://borto.dyndns.org"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>


If you have some file in the root with name like index.html ore index.htm, you need to rename them or delet them.
Rename them like indexold.html ore something.

If your domain dont support PHP, you can use a HTML redirect
then create a file named index.html and add this lines inside of it

Code: Select all

<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://borto.dyndns.org/">


Have a Qnap day.
Good luck
My Tutorials:
Tutorial:How to config webserver on Qnas!
Tutorial:How to use loginscript and Robocopy
Tutorial:How to set up DynDNS on Qnas!
Tutorial:How to move large files on Qnas!
Tutorial:How to edit apache.conf on Qnas!
Tutorial:How to seed files and folders in Qget
Tutorial:How to fix slow wordpress on Qnas!

See also Don`s How To guide!
And Frisbe`s signatur for more Tips and Tricks!
_______________________________________
NAS nr 1: TS-109 Pro FW: 3.1.0 Build 0708T - 1 x Seagate 500Gb + 1X USB 500GB Qraid
NAS nr 2: TS-109 Pro II FW: 3.1.0 Build 0708T - 1 x Western Digital 1Tb
____________________________________________________________________________

User avatar
Moogle Stiltzkin
Ask me anything
Posts: 7563
Joined: Thu Dec 04, 2008 12:21 am
Location: Around the world....
Contact:

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

Post by Moogle Stiltzkin » Thu Jun 18, 2009 6:26 pm

Not sure if anyone has mentioned this yet, but using my QNAP 509 Pro, after updating to the newest firmware 3, they had fixed the issue so people don't need to put / at the end of every URL.

May need to update the tutorial :mrgreen:
NAS
[Main Server] QNAP TS-877 w. 4tb [ 3x HGST Deskstar NAS (HDN724040ALE640) & 1x WD RED NAS ] EXT4 Raid5 & 2 x m.2 SATA Samsung 850 Evo raid1 + 16gb ddr4 Crucial + QWA-AC2600 wireless adapter.
[Backup] QNAP TS-653A w. 5x 2TB Samsung F3 (HD203WI) EXT4 Raid5
[^] QNAP TS-659 Pro II 1x 4TB HGST Deskstar NAS
[^] QNAP TS-509 Pro w. 4x 1TB WD RE3 (WD1002FBYS) EXT4 Raid5
[^] QNAP TS-228 w. 1x 1TB WD RE3 (WD1002FBYS)
[^] QNAP TS-128
Mobile NAS TBS-453DX w. 2x Crucial MX500 500gb EXT4 raid1

Network
Asus AC68U Router|100dl/50ul MBPS FTTH Internet | Windows 10, WC PC-Intel i7 920 Ivy bridge desktop (1x 512gb Samsung 850 Pro SSD + 1x 4tb HGST Ultrastar 7K4000)


Guides & articles
[Review] Moogle's QNAP experience
[Review] Moogle's TS-877 review

https://www.patreon.com/mooglestiltzkin

aziz3786
Starting out
Posts: 10
Joined: Wed Apr 16, 2008 7:06 am

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

Post by aziz3786 » Tue Jul 07, 2009 5:45 am

Im still having problems getting my web server started after following all the instructions.

Ive checked my ISP Virgin Media UK does not block web ports

The only page i can view externally is http://mydomain.dyndns.org:8080,
http://mydomain.dyndns.org:80 doesn't work

Firefox has "The connection was reset" error.

However when i put my domain to -> http://www.the-cloak.com/login.html
It showed my web-page fine...

Is there something im doing wrong?

User avatar
QNAPJason
QNAP Staff
Posts: 5391
Joined: Thu May 21, 2009 2:14 pm
Location: Taipei

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

Post by QNAPJason » Tue Jul 07, 2009 10:35 am

aziz3786 wrote:Im still having problems getting my web server started after following all the instructions.

Ive checked my ISP Virgin Media UK does not block web ports

The only page i can view externally is http://mydomain.dyndns.org:8080,
http://mydomain.dyndns.org:80 doesn't work

Firefox has "The connection was reset" error.

However when i put my domain to -> http://www.the-cloak.com/login.html
It showed my web-page fine...

Is there something im doing wrong?

Dear aziz3786,
On your router, have you correctly forwarded port 80 from your router to your NAS ip?

Jason

aziz3786
Starting out
Posts: 10
Joined: Wed Apr 16, 2008 7:06 am

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

Post by aziz3786 » Tue Jul 07, 2009 11:50 am

Hello Jason, thanks for reply.

Yes i did forget to mention i have forwarded Port 80 on my Netgear WNR854T RangeMax Next Wireless Router to my server IP address

Ive even restarted my router and inputted port settings again, still no luck....

Current firmware version: 3.1.0 Build 0627T
NAS -- 639

User avatar
QNAPJason
QNAP Staff
Posts: 5391
Joined: Thu May 21, 2009 2:14 pm
Location: Taipei

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

Post by QNAPJason » Tue Jul 07, 2009 12:26 pm

aziz3786 wrote:Hello Jason, thanks for reply.

Yes i did forget to mention i have forwarded Port 80 on my Netgear WNR854T RangeMax Next Wireless Router to my server IP address

Ive even restarted my router and inputted port settings again, still no luck....

Current firmware version: 3.1.0 Build 0627T
NAS -- 639


Hmm, for troubleshooting, do you mind putting your NAS in the DMZ of your router, just temporarily? This will essentially open all the ports to your NAS. If you can access your web server externally after you've placed the NAS in the DMZ zone, then there's a problem with your previous port-forwrding settings for port 80.

Regards,

Jason

aziz3786
Starting out
Posts: 10
Joined: Wed Apr 16, 2008 7:06 am

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

Post by aziz3786 » Tue Jul 07, 2009 11:28 pm

Good idea... Ive put my NAS on DMZ Server of my router and still no luck, port 8080 still works

I'm gutted as this is one of the main feature i want to use when i bought my NAS two weeks ago

I did try to attempt it with firmware 2 but had the same issues as firmware 3, it must be an external problem

Anyone hosting with ISP Virgin Media UK??

sebus
Starting out
Posts: 49
Joined: Fri Nov 06, 2009 4:03 am

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

Post by sebus » Mon Nov 09, 2009 7:46 pm

Anybody enabled https on the webserver?

Obviously it can be done with include .conf file to the running apache.conf

sebus
EDIT
I edited running apache.conf to have
include /usr/local/apache/conf/extra/apache-ssl.conf
and edited apache-ssl.conf to have the port I need & ServerName "TS Series NAS", so the certificate matches

I can restart Apache by
/etc/init.d/./Qthttpd.sh restart

It seems to start, as there is no message in console or log otherwise, but it is NOT accessible
error_log only shows:

Code: Select all

[Mon Nov 09 14:03:35 2009] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Nov 09 14:03:36 2009] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Nov 09 14:03:36 2009] [notice] Apache/2.2.6 (Unix) DAV/2 PHP/5.2.9 mod_ssl/2.2.6 OpenSSL/0.9.7a configured -- resuming normal operations

Angelo
Starting out
Posts: 28
Joined: Mon May 10, 2010 5:51 pm

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

Post by Angelo » Wed May 19, 2010 6:37 am

Guys,

Thanks for the tutorial but I can't get onto my NAS from WAN.

I've setup the DDNS service and get from WAN onto the router but it doesn't forward me to the NAS. I've a Netgear DG834PN router and made a firewall rule for HTTP(TCP/UDP:8080) to the static ip of the NAS but no success... With the my_ddns_hostname without port specification I get into the login of the router. With my_ddns_hostname:8080 I get - Unable to connect.

What's wrong here? Anybody an idea?

User avatar
thorejoha
Know my way around
Posts: 144
Joined: Mon Mar 24, 2008 9:41 pm

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

Post by thorejoha » Wed May 19, 2010 10:12 am

Angelo wrote:Guys,

Thanks for the tutorial but I can't get onto my NAS from WAN.

I've setup the DDNS service and get from WAN onto the router but it doesn't forward me to the NAS. I've a Netgear DG834PN router and made a firewall rule for HTTP(TCP/UDP:8080) to the static ip of the NAS but no success... With the my_ddns_hostname without port specification I get into the login of the router. With my_ddns_hostname:8080 I get - Unable to connect.

What's wrong here? Anybody an idea?



You should forward your port 80 to your Nas.ip port 80.
My Tutorials:
Tutorial:How to config webserver on Qnas!
Tutorial:How to use loginscript and Robocopy
Tutorial:How to set up DynDNS on Qnas!
Tutorial:How to move large files on Qnas!
Tutorial:How to edit apache.conf on Qnas!
Tutorial:How to seed files and folders in Qget
Tutorial:How to fix slow wordpress on Qnas!

See also Don`s How To guide!
And Frisbe`s signatur for more Tips and Tricks!
_______________________________________
NAS nr 1: TS-109 Pro FW: 3.1.0 Build 0708T - 1 x Seagate 500Gb + 1X USB 500GB Qraid
NAS nr 2: TS-109 Pro II FW: 3.1.0 Build 0708T - 1 x Western Digital 1Tb
____________________________________________________________________________

Angelo
Starting out
Posts: 28
Joined: Mon May 10, 2010 5:51 pm

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

Post by Angelo » Wed May 19, 2010 2:40 pm

Sorry, but I did. When I make a firewall rule for port 80, I still end-up getting into the router not on the NAS. See below.
You do not have the required permissions to view the files attached to this post.

User avatar
thorejoha
Know my way around
Posts: 144
Joined: Mon Mar 24, 2008 9:41 pm

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

Post by thorejoha » Wed May 19, 2010 3:19 pm

First of all. Edit the portforwarding to only port 80. You have forwarded port 80 to 90
Your Qnas will not recive anything on this other ports from 81 to 90.

Is this the ADSL router, or is it only used for wirelss connection.
If it is the router delivered from your broadband company, try to send them a mail, and ask for "How to portforward the router". Its normal they have this solution and will send it to you.

If this is used as Wireless accesspoint only, try to put the Qnas server in one of the ports in your broadbandrouter and forward this to the Qnas.


I have have a Zyxell router my self, and it need some settings done with Telnet.
Its not enought to use the web gui. But my broadband company have instruction for this.


You can also check on http://portforward.com/english/routers/ ... Nindex.htm
My Tutorials:
Tutorial:How to config webserver on Qnas!
Tutorial:How to use loginscript and Robocopy
Tutorial:How to set up DynDNS on Qnas!
Tutorial:How to move large files on Qnas!
Tutorial:How to edit apache.conf on Qnas!
Tutorial:How to seed files and folders in Qget
Tutorial:How to fix slow wordpress on Qnas!

See also Don`s How To guide!
And Frisbe`s signatur for more Tips and Tricks!
_______________________________________
NAS nr 1: TS-109 Pro FW: 3.1.0 Build 0708T - 1 x Seagate 500Gb + 1X USB 500GB Qraid
NAS nr 2: TS-109 Pro II FW: 3.1.0 Build 0708T - 1 x Western Digital 1Tb
____________________________________________________________________________

Angelo
Starting out
Posts: 28
Joined: Mon May 10, 2010 5:51 pm

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

Post by Angelo » Wed May 19, 2010 5:05 pm

Thanks. But it works; I can get from outside on the webserver (index.htm) in qweb from outside. I tried only from inside the LAN and tht led to the router. So portforwarding works but I will change it to port 80 only.

I've another question;
-how do I get on the QNAP administrator page (normally on port 8080)?
-and how do I get in the web-filemanager from outside?

Thanks in advance for any help

Post Reply

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