![]()
Replies: 22
Views: 3951
Last Post By: tabaka
ON: wczoraj, o 21:31
Topic By: SiLAS ON: 11 sie 2008, o 19:36
Creating multiple websites on your NAS.
There are already running several apache servers on your NAS. These have different special purposes. To have your NAS serve multiple domains, there is no need to add additional apache servers, you can serve them all from one Apache server.
All the magic lies inside apache, by using VirtualHosts.
First of, you need to create a folderstructure on the NAS, that the apache can utilize.
We already have Qweb, so let's just extend the use of it, by moving all our websites to subfolders.
Qweb:
index.html
HTML files
Folders for the site
Changes to:
Qweb:
site1
HTML files
Folders for the site
site2
HTML files
Folders for the site.
Site3
....
To minimize the damage if the apache.conf file is reset by a firmware you should create your own config file. As we no longer want to use the root of Qweb to hold webserver pages, we can place the additional configuration there.
Qweb:\customization.conf
And then in the config file of the apache server ( /etc/config/apache/apache.conf), we can add
include /share/Qweb/customization.conf
at the bottom of apache.conf
An example of a config file could look like this:
ServerAdmin webmaster@site1.com
ServerName http://www.site1.com
DocumentRoot "/share/Qweb/site1”
<Directory />
Order Deny,Allow
Deny from all
</Directory>
<Directory "/share/Qweb/site1">
Options FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ServerSignature Off
ServerTokens Prod
NameVirtualHost *:80
<VirtualHost *:80>
ServerName http://www.site1.com
ServerAlias site1.com http://www.site1.org site1.org
DocumentRoot "/share/Qweb/site1"
<Directory "/share/Qweb/site1">
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog /share/Qweb/logs/site1_error
CustomLog /share/Qweb/logs/site1_access combined
</VirtualHost>
First of we define where to send mail for users that experience errors, we also set a deny for root, which is lacking in the standard config.
Furthermore we limit the info we want to give away, and then we tell apache, that we want to create virtualhosts based on their name on port 80, which is the standard webport.
Finally we define a virtual server based on it's name.
There is the servername, which is what apache is to react on, and then there are aliases created for other sites, or TopLevelDomains, that you want to direct to the same site.
Finally there is a seperate logfile for each website, if you don't want to look at the logfiles, the errorlog and customlog lines can be omitted. Then the apache will use it's standard log file for every transaction.
To create another site, we simply add a new <VirtualHost> ... </VirtualHost> set, that points to another directory.
This way you can have some domains point to the same site, and others to seperate sites.
If you wish to harden the apache a bit more, you should find the Rewrite module, which can be found on the qnap forums, and then add the following lines to the customization config. The apache replies to some very unusual request methods, and there is no need for that, so we just want to redirect them to nothing.
LoadModule rewrite_module libexec/mod_rewrite.so
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE [OR]
RewriteCond %{REQUEST_METHOD} ^PROPFIND [OR]
RewriteCond %{REQUEST_METHOD} ^PROPPATCH [OR]
RewriteCond %{REQUEST_METHOD} ^MKCOL [OR]
RewriteCond %{REQUEST_METHOD} ^COPY [OR]
RewriteCond %{REQUEST_METHOD} ^MOVE [OR]
RewriteCond %{REQUEST_METHOD} ^LOCK [OR]
RewriteCond %{REQUEST_METHOD} ^UNLOCK [OR]
RewriteCond %{REQUEST_METHOD} ^LINK [OR]
RewriteCond %{REQUEST_METHOD} ^UNLINK
RewriteRule .* - [F]
![]()
Replies: 0
Views: 5
Last Post By: endorse
ON: wczoraj, o 18:44
Topic By: endorse ON: wczoraj, o 18:44
witam
Czy ktoś byłby w stanie podpowiedzieć mi dlaczego po zainstalowaniu xDova i próbowaniu skonfigurowania go wyskakuje mi białe okienko:
Z góry dziękuje za pomoc
![]()
Replies: 4
Views: 23
Last Post By: ziomok
ON: wczoraj, o 00:19
Topic By: ziomok ON: 4 lut 2012, o 12:03
Witam
Mam problem przyznam sie na wstepie ze jestem poczatkujacym uzytkownikiem QNAP 112 i powiedzmy w 85% wszystko sam doszedlem co gdzie sie z czym je, ale jak to samouk popelniam bledy i przy
rafik_1 za co mu jestem bardzo wdzieczny postawilem TwonkyMedia bo sam bez podpowiedzi raczej bym tego nie zrobil. I tu zaczyna sie moj problem podpowiedzcie mi jak mam odzyskac login i haslo z TwonkyMedia bo jakies wstawilem i nie pamietam i nie moge sie zalogowac i ustawic jakie partycje ma widziec np moj TV, czy wogule sie cos takiego da?? pomyslalem ze jak zrobie reset calego QNAP-a przyciskiem z tylu obudowy czy nie strace calych danych? podpowiedzcie co mam zrobic, jestem w kropce przez moj blad 
zgory dziekuje i pozdrawiam
![]()
Replies: 3
Views: 61
Last Post By: ziomok
ON: wczoraj, o 00:18
Topic By: ziomok ON: 1 lut 2012, o 18:03
Jak w temacie co mam zrobić żeby można było oglądać filmy z servera bez obsługi komputera (wyłączony)?
Posiadam WRT54GL do którego jest podłączony QNAP i TV kablem internetowym, jak ktoś wie proszę o opisanie jak to zrobić.
![]()
Replies: 3
Views: 49
Last Post By: dju1972
ON: wczoraj, o 00:05
Topic By: dju1972 ON: 2 sty 2012, o 09:59
Szanowne QNAPki;
Najlepszego w Nowym 2012 Roku i mam problem, który robi się delikatnie mówiąc denerwujący:
1. pojawił się na początku użytkowania - nowy NAS wstał z dwoma dyskami i później czekała mnie przebudowa RAID z 1 na 5;
2. przy wysłaniu komendy restartu system się zamyka i nie wstaje - po sygnale dzwiękowym wszystkie 4 kontrolki od dysków święcą się na czerwono;
3. po wyjęciu 3 i 4 dysku system podnosi się na 1 i 2, dodaję wtedy 3 i 4, robię RECOVERY i działa;
Co jest grane?
![]()
Replies: 0
Views: 5
Last Post By: jdebs
ON: 4 lut 2012, o 22:10
Topic By: jdebs ON: 4 lut 2012, o 22:10
Witam,
Jak można ustawić podkatalogi niewidzialne dla konkretnego usera?
W katalogu Web mam parę stron (podkatalogów, wirtualnych hostów). Jeden z tych podkatalogów chcę przyporządkować użytkownikowi zewnętrznemu (dostęp po ftp).
Nadałem prawa r/w dla podkatalogu dla użytkownika. Problem w tym że nie jest on widzialny dopóki nadrzędny katalog nie zostanie udostępniony (przynajmniej do odczytu).
Efekt jest taki że user logując się na serwerze widzi całą strukturę głównego drzewa. Co prawda nie może otworzyć zablokowanych katalogów ale widzi je. Jak można je ukryć?
Będę wdzięczny za pomoc.
===
TS-219P II, 2TB Hitachi HDD
![]()
Replies: 4
Views: 85
Last Post By: dju1972
ON: 3 lut 2012, o 20:52
Topic By: dju1972 ON: 25 gru 2011, o 22:59
Pomocy,
mam na swoim QNAPie około 3,5TB muzyki. Problem jest w tym, że streamer widzi pliki w katalogu w kolejności alfabetycznej a nie tak, jak są numerowane. Wszystko jest tagowane. Nazwa pliku to numer utworu. nazwa utworu.
POMOCY!!!
![]()
Replies: 0
Views: 23
Last Post By: rithien
ON: 2 lut 2012, o 23:23
Topic By: rithien ON: 2 lut 2012, o 23:23
Witam
Testował może już to ktoś ? http://forum.qnap.com/viewtopic.php?f=9 ... it=qnology
Hardware Qnapa i soft synca to by było niezłe połączenie. Soft maja o wiele bardziej dopracowany.
![]()
Replies: 0
Views: 14
Last Post By: xanpl1987
ON: 2 lut 2012, o 14:29
Topic By: xanpl1987 ON: 2 lut 2012, o 14:29
Zamierzam kupić :
Serwer plików QNAP TS-412U , posiadam też QNAP TS-119P+
i moje pytanko jest takie , czy można rozdzielić przez haba USB monitorowanie napięcia z UPS-a na dwa serwery?
![]()
Replies: 0
Views: 14
Last Post By: staxspox
ON: 1 lut 2012, o 22:39
Topic By: staxspox ON: 1 lut 2012, o 22:39
Dodaje aplikację na Androida za pomocą której będziesz mógł sprawdzać status twoich torrentów, jak dla mnie zarąbista sprawa bo już nie muszę specjalnie odpalać kompa tylko po to aby sprawdzić czy ściągnęło mi się już to co było w kolejce życzeń http://hotfile.com/dl/144802334/3d2c9ad/QGetMobile_1.7.1.rar.html