Hosting Website on NAS and connecting it to domain

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
nafisreza
New here
Posts: 2
Joined: Fri Jun 26, 2020 6:10 pm

Hosting Website on NAS and connecting it to domain

Post by nafisreza »

I have hosted a WORDPRESS website on my QNAP NAS. I was able to access it with the IP of NAS. Today I have purchased a domain. Now please tell me how do I connect the domain with my wordpress site hosted on NAS. I have created a virtual host. Now the site is being loaded, but only HTML files are loading. Other things are not there. Moreover, I cant even login to the dashboard of WORDPRESS. It gives me this error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@NAS to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

NOW I DONT KNOW WHAT TO DO. PLEASE HELP !!!!
User avatar
dolbyman
Guru
Posts: 35248
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Hosting Website on NAS and connecting it to domain

Post by dolbyman »

best to get a cheap webspace and host it there

qnap webserver is running with root privileges, so if somone hacks your website, they can gain full access to all your nas files (erase or hold them hostage)

never expose your nas to the web
nafisreza
New here
Posts: 2
Joined: Fri Jun 26, 2020 6:10 pm

Re: Hosting Website on NAS and connecting it to domain

Post by nafisreza »

please explain
User avatar
dolbyman
Guru
Posts: 35248
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Hosting Website on NAS and connecting it to domain

Post by dolbyman »

what part do you need explaining for ?
User avatar
Moogle Stiltzkin
Guru
Posts: 11448
Joined: Thu Dec 04, 2008 12:21 am
Location: Around the world....
Contact:

Re: Hosting Website on NAS and connecting it to domain

Post by Moogle Stiltzkin »

i recommend blue host, if your purpose is making a website
https://hostingfacts.com/hosting-reviews/bluehost/

Bluehost Review 2020 - Is Bluehost The Best Option In 2020? Honest Look
https://www.youtube.com/watch?v=jeFSRFmhSMk


may be worth going for the plus plan since it's unmetered storage space and bandwidth
Image


and if your site gets hacked, you can wipe it, then restore using backups hosted on your nas (which ideally should not be exposed to the web).

So then your important data on the QNAP NAS is safe away from the internet, and you can have your website online hosted on a hosting server kept separate.
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
User avatar
jaysona
Been there, done that
Posts: 854
Joined: Tue Dec 02, 2008 11:26 am
Location: Somewhere in the Great White North

Re: Hosting Website on NAS and connecting it to domain

Post by jaysona »

dolbyman wrote: Fri Jun 26, 2020 9:25 pm best to get a cheap webspace and host it there

qnap webserver is running with root privileges, so if somone hacks your website, they can gain full access to all your nas files (erase or hold them hostage)

never expose your nas to the web
nafisreza wrote: Fri Jun 26, 2020 10:15 pm please explain
Hosting a wordpress website on a QNAP NAS securely requires the modification of several configuration files, such as the apache config files, php environment and config files, wordpress config files, etc.

So, given that you are asking for help with very basic web-server and wordpress configuration indicates that you are probably better off using an inexpensive wordpress hosting service. You can host the wordpress site on your NAS is you want, but be aware that unless it is properly configured and secured, the wordpress site will eventually get hacked.

Wordpress sites are hacked every day, keeping a wordpress site secure requires constant attention, and that attention is best left to be handled by a wordpress hosting service. As with all services, there are some that are better than others.
RAID is not a Back-up!

H/W: QNAP TVS-871 (i7-4790. 16GB) (Plex server) / TVS-EC1080 (32Gig ECC) - VM host & seedbox
H/W: Asustor AS6604T (8GB) / Asustor AS7010T (16GB) (media storage)
H/W: TS-219 Pro / TS-509 Pro
O/S: Slackware 14.2 / MS Windows 7-64 (x5)
Router1: Asus RT-AC86U - Asuswrt-Merlin - 386.7_2
Router2: Asus RT-AC68U - Asuswrt-Merlin - 386.7_2
Router3: Linksys WRT1900AC - DD-WRT v3.0-r46816 std
Router4: Asus RT-AC66U - FreshTomato v2021.10.15

Misc: Popcorn Hour A-110/WN-100, Pinnacle Show Center 250HD, Roku SoundBridge Radio (all retired)
Ditched QNAP units: TS-269 Pro / TS-253 Pro (8GB) / TS-509 Pro / TS-569 Pro / TS-853 Pro (8GB)
TS-670 Pro x2 (i7-3770s 16GB) / TS-870 Pro (i7-3770 16GB) / TVS-871 (i7-4790s 16GB)
User avatar
spile
Been there, done that
Posts: 641
Joined: Tue May 24, 2016 12:13 am

Re: Hosting Website on NAS and connecting it to domain

Post by spile »

On the other hand others make a case for for self hosting
https://mariushosting.com/pay-for-web-h ... ology-nas/
I use a web host but others like those above demonstrate that many issues are less black and white and more shades of grey.
User avatar
jaysona
Been there, done that
Posts: 854
Joined: Tue Dec 02, 2008 11:26 am
Location: Somewhere in the Great White North

Re: Hosting Website on NAS and connecting it to domain

Post by jaysona »

spile wrote: Thu Jul 02, 2020 2:09 pm On the other hand others make a case for for self hosting
https://mariushosting.com/pay-for-web-h ... ology-nas/
I use a web host but others like those above demonstrate that many issues are less black and white and more shades of grey.
That's a somewhat mis-leading (or rather incomplete) blog imnsho.

I also host a plethora of services on my NAS (web, email, dns, xmpp/omemo, to name a few), however there needs to be some clarifications in reagrds to the post.

What is not mentioned in the blog is that the Synology NAS administration web services have their own set of security vulnerabilities which have been actively exploited as well. Regardless of which NAS platform is used for home hosting, the http, php, sql, etc services need to be properly configured and secured - another mention that is missing from the blog post.

The upside to (some) paid hosting services, is that the apache (typically used), php and sql configs tend to be better configured than the default configs deployed on QNAP and Synology NAS units, for example. Sure the sites may work just fine, but how secure are the apache, PHP and sql configs?

Most exploits do not go after the web server itself, but rather poorly configured PHP and sql which are served by the apache web server. Once a PHP or sql vulnerability is exploited (usually a series and vulnerabilities need to be exploited in a particular order) then the privilege escalation can begin with the goal of owning the NAS. This type of hack is equally applicable to any NAS unit since most are packaged with confgs to make the web site work vs work securely.

It is quite possible to host a relatively secure web site on NAS, but to do so requires fore-thought, planning and the proper configuration of several config files. I am not saying do not host a website on a NAS, but if it is going to be done, it should be done properly.
RAID is not a Back-up!

H/W: QNAP TVS-871 (i7-4790. 16GB) (Plex server) / TVS-EC1080 (32Gig ECC) - VM host & seedbox
H/W: Asustor AS6604T (8GB) / Asustor AS7010T (16GB) (media storage)
H/W: TS-219 Pro / TS-509 Pro
O/S: Slackware 14.2 / MS Windows 7-64 (x5)
Router1: Asus RT-AC86U - Asuswrt-Merlin - 386.7_2
Router2: Asus RT-AC68U - Asuswrt-Merlin - 386.7_2
Router3: Linksys WRT1900AC - DD-WRT v3.0-r46816 std
Router4: Asus RT-AC66U - FreshTomato v2021.10.15

Misc: Popcorn Hour A-110/WN-100, Pinnacle Show Center 250HD, Roku SoundBridge Radio (all retired)
Ditched QNAP units: TS-269 Pro / TS-253 Pro (8GB) / TS-509 Pro / TS-569 Pro / TS-853 Pro (8GB)
TS-670 Pro x2 (i7-3770s 16GB) / TS-870 Pro (i7-3770 16GB) / TVS-871 (i7-4790s 16GB)
User avatar
Johnno72
Easy as a breeze
Posts: 378
Joined: Fri Jul 31, 2015 1:35 pm
Location: Australia

Re: Hosting Website on NAS and connecting it to domain

Post by Johnno72 »

jaysona wrote: Thu Jul 02, 2020 9:04 pm <snip>
It is quite possible to host a relatively secure web site on NAS, but to do so requires fore-thought, planning and the proper configuration of several config files. I am not saying do not host a website on a NAS, but if it is going to be done, it should be done properly.
And what is this proper configuration of several config files be? Are you able to name said files? Are you able to describe what edits need to be done?

Thanks
OS: Win10 Professional v2004 OS Build 19041.388 x64
NAS: QNAP TS-EC2480U-RP 16G 24 Bay - Firmware: v4.4.3.1421 build 20200907. Updated from v4.4.3.1400 Build 20200817 Official
StoragePool / DataVol: Storage Pool 1 / DataVol1: Single 29.04TB - Thick Volume: 29TB
HDD's: Western Digital - Model: WDC WD4001FFSX-68JUN0 Red Pro NAS 3.5"
HDD Size: 4TB - HDD Firmware all HDD's: 81.00A81
RAID Configuration: RAID6 x 10, HotSpare x 1, ColdSpare x 1 - Network: 1GbE
UPS: CyberPower PR3000ELCDRT2U Professional Rackmount LCD 3000VA, 2250W 2U Line Interactive UPS
QNAP Hardware details required: viewtopic.php?f=5&t=68954
Remote Administration of: TVS-863+ 16G on UPS Cyberpower OLS1500E+RMcard205
User avatar
jaysona
Been there, done that
Posts: 854
Joined: Tue Dec 02, 2008 11:26 am
Location: Somewhere in the Great White North

Re: Hosting Website on NAS and connecting it to domain

Post by jaysona »

Johnno72 wrote: Wed Aug 26, 2020 7:16 pm And what is this proper configuration of several config files be? Are you able to name said files? Are you able to describe what edits need to be done?

Thanks
Apache config files are located in:
/etc/config/apache and /etc/config/apache/extra

Apache config file is /etc/config/apache/apache.conf The apache.conf file will list the .conf files in /etc/config/apache/extra that will be loaded.

In addition, the /etc/init.d/Qhttp.sh file will need to be tweaked because QNAP - in their retarded wisdom - makes several specific config entries in the apache.conf, apache-ssl.conf and other .conf files via the Qhttpd.sh file. So if you make changes to the .conf file, those changes will be undone when the Qhttpd.sh file is executed.

Another option is to use Qapache instead and completely disable the QNAP default apache server, and configure Qapache to use tcp 80/443 instead.
RAID is not a Back-up!

H/W: QNAP TVS-871 (i7-4790. 16GB) (Plex server) / TVS-EC1080 (32Gig ECC) - VM host & seedbox
H/W: Asustor AS6604T (8GB) / Asustor AS7010T (16GB) (media storage)
H/W: TS-219 Pro / TS-509 Pro
O/S: Slackware 14.2 / MS Windows 7-64 (x5)
Router1: Asus RT-AC86U - Asuswrt-Merlin - 386.7_2
Router2: Asus RT-AC68U - Asuswrt-Merlin - 386.7_2
Router3: Linksys WRT1900AC - DD-WRT v3.0-r46816 std
Router4: Asus RT-AC66U - FreshTomato v2021.10.15

Misc: Popcorn Hour A-110/WN-100, Pinnacle Show Center 250HD, Roku SoundBridge Radio (all retired)
Ditched QNAP units: TS-269 Pro / TS-253 Pro (8GB) / TS-509 Pro / TS-569 Pro / TS-853 Pro (8GB)
TS-670 Pro x2 (i7-3770s 16GB) / TS-870 Pro (i7-3770 16GB) / TVS-871 (i7-4790s 16GB)
mikewong
New here
Posts: 2
Joined: Sat May 29, 2010 2:36 pm

Re: Hosting Website on NAS and connecting it to domain

Post by mikewong »

I got the same error with WordPress page in my Qnap server, where is the configure file path of the Wordpress located? thanks!
Post Reply

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