[TUTORIAL] How to config your webserver first time

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Locked
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 »

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 »

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 »

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
Guru
Posts: 11448
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 »

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 (QTS) w. 4tb [ 3x HGST Deskstar NAS & 1x WD RED NAS ] EXT4 Raid5 & 2 x m.2 SATA Samsung 850 Evo raid1 +16gb ddr4 Crucial+ QWA-AC2600 wireless+QXP PCIE
[Backup] QNAP TS-653A (Truenas Core) w. 4x 2TB Samsung F3 (HD203WI) RaidZ1 ZFS + 8gb ddr3 Crucial
[^] QNAP TL-D400S 2x 4TB WD Red Nas (WD40EFRX) 2x 4TB Seagate Ironwolf, Raid5
[^] QNAP TS-509 Pro w. 4x 1TB WD RE3 (WD1002FBYS) EXT4 Raid5
[^] QNAP TS-253D (Truenas Scale)
[Mobile NAS] TBS-453DX w. 2x Crucial MX500 500gb EXT4 raid1

Network
Qotom Pfsense|100mbps FTTH | Win11, Ryzen 5600X Desktop (1x2tb Crucial P50 Plus M.2 SSD, 1x 8tb seagate Ironwolf,1x 4tb HGST Ultrastar 7K4000)


Resources
[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 »

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: 5398
Joined: Thu May 21, 2009 2:14 pm
Location: Taipei

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

Post by QNAPJason »

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 »

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: 5398
Joined: Thu May 21, 2009 2:14 pm
Location: Taipei

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

Post by QNAPJason »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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
Locked

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