[HOWTO] Multiple websites on TS-109

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
humlebien
New here
Posts: 2
Joined: Fri Sep 28, 2007 4:16 am

[HOWTO] Multiple websites on TS-109

Post by humlebien »

Hi everybody

I have just got a TS-109 and I have a question about the webserver.

Is it possible to have multiple websites on the TS-109 :?:
and how do I do it :?:

Humlebien
Denmark
chowchow2003
Starting out
Posts: 30
Joined: Sun Sep 16, 2007 9:36 pm

Post by chowchow2003 »

Yes, OK. U just upload different directory into the /Qweb/ and each directory have each index.html file.
humlebien
New here
Posts: 2
Joined: Fri Sep 28, 2007 4:16 am

Post by humlebien »

How will the webserver know where to find the right files for the right domain??
User avatar
TheEnvoy
Know my way around
Posts: 138
Joined: Mon Sep 10, 2007 3:47 pm
Location: Berlin, Germany
Contact:

Post by TheEnvoy »

For multiple domains you either need to use vhost or "host"-based redirection
with mod_alias / mod_rewrite. The later I wanted to use, as I only want to handle
subdomains. Unfortunatly there are no modules on the qnap, so I have to build them
myself some time...

I didn't use vhost yet, so I don't know if it works out of the box, without
modules.

For further information I would recommend the documentation over at apache.org.

regards
TheEnvoy
Think! :idea: Search :!: Ask :?:

"Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety."
-- B. Franklin

// TS-409 Pro - Debian Lenny
// TS-109 Pro / FW: 1.1.1 0831 (offline)
User avatar
jason
Getting the hang of things
Posts: 82
Joined: Tue Sep 04, 2007 4:30 pm

Post by jason »

hi all

you can make different directory into the /Qweb/ and try to add [/] at the hyperlink such as below example:

http://your ip:port/test1/
http://your ip:port/test2/
http://your ip:port/test3/
Image
TS 109 Pro
FirmWare 1.1.4 build 1207T
User avatar
TheEnvoy
Know my way around
Posts: 138
Joined: Mon Sep 10, 2007 3:47 pm
Location: Berlin, Germany
Contact:

Post by TheEnvoy »

Well yes, thats basically what chowchow2003 allready said, but it's not taking different domains or subdomains into account.

I just tested if vhost is feasable and I'm happy, as it indeed is.

Just change your apache.conf as described here: Apache Documentation
Think! :idea: Search :!: Ask :?:

"Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety."
-- B. Franklin

// TS-409 Pro - Debian Lenny
// TS-109 Pro / FW: 1.1.1 0831 (offline)
willyhoops
Starting out
Posts: 24
Joined: Sat Sep 29, 2007 10:38 pm

Post by willyhoops »

Hey I am interested in this feature as well and have a TS109. But where is the apache.conf file stored on the qnap? I can not find it anywhere.... Many thanks...
User avatar
jason
Getting the hang of things
Posts: 82
Joined: Tue Sep 04, 2007 4:30 pm

Post by jason »

willyhoops wrote:Hey I am interested in this feature as well and have a TS109. But where is the apache.conf file stored on the qnap? I can not find it anywhere.... Many thanks...
SSH
Image
TS 109 Pro
FirmWare 1.1.4 build 1207T
User avatar
AndyChuo
Experience counts
Posts: 2388
Joined: Thu Sep 13, 2007 11:56 am
Location: Taipei, Taiwan

Post by AndyChuo »

Hi willyhoops,

it's under /mnt/HDA_ROOT/apache/conf/apache.conf
don't forget to restart your web server after changes been made.

Andy
=============================================================>>>
TS-659-Pro [RAID6] rtorrent+SABnzbdplus+SickBeard+Couchpotato [Best PVR] Plex+PMS [Ultimate Streamer]
Apple iPad [Best Tablet] HTC One M8 [Mobile Phone] Samsung UA46ES6100 [My Screen] KRK Rokit 6 [Audio Speakers]
Chrome Cast [Screen Casting] Philips Hue [Personal Lighing]
Buffalo WZR-1750DHP [My Wifi Hub] D-Link DGS-1005D [Gbit Network]
=============================================================>>>
willyhoops
Starting out
Posts: 24
Joined: Sat Sep 29, 2007 10:38 pm

Post by willyhoops »

it's under /mnt/HDA_ROOT/apache/conf/apache.conf
I don't understand - where is that? I bought this TS-109 from http://www.ripcaster.co.uk a couple of weeks ago and it has slimserver preinstalled. When I look at the device in Windows Explorer - Microsoft Windows Network I have a Public directory with a couple of folders but can't see any such directory on that, and everything else is empty except Qweb which now contains my web site.

I used to run Apache Web Server on my PC before I bought this Qnap so I am not a total fool :?
User avatar
TheEnvoy
Know my way around
Posts: 138
Joined: Mon Sep 10, 2007 3:47 pm
Location: Berlin, Germany
Contact:

Post by TheEnvoy »

Well windows explorer only shows shares, it dosn't show the system.

As jason allready pointed out, you have to ssh (i.e. with putty or winscp) to qour qnap, then edit
/mnt/HDA_ROOT/apache/conf/apache.conf

you can do that with vi on the console, you can also copy the file to a shared folder and edit it
then (use something like notepad++ so you don't mess up the file, no no never use windows notepad)

if I remember corrctly you can user WinSCp to open the file directly and edit it in place, if
the editor is biult in, it should be ok with the linefeeds.

Anyway, after editing, and puting back in place if needed, restart apache with

Code: Select all

/etc/init.d/Qthttp restart
from the ssh command line

Be aware that the changes will be lost if you restart the qnap or restart apache with
the webinterface, unless you have your own startscript... that makes me think of a new feature request

regards
TheEnvoy
Think! :idea: Search :!: Ask :?:

"Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety."
-- B. Franklin

// TS-409 Pro - Debian Lenny
// TS-109 Pro / FW: 1.1.1 0831 (offline)
willyhoops
Starting out
Posts: 24
Joined: Sat Sep 29, 2007 10:38 pm

How To / Tutorial Connect to QNAP TS-109 with winSCP (SSH)

Post by willyhoops »

Many Thanks...

Also I found a web site on goolge that describes how to get into the qnap using winSCP with detailed instructions (this is not in the manual):

http://nachtrab.de/2007/09/03/connectin ... ng-winscp/

I will follow these instruction and see if I can get this done..
Last edited by willyhoops on Thu Oct 11, 2007 10:05 pm, edited 3 times in total.
willyhoops
Starting out
Posts: 24
Joined: Sat Sep 29, 2007 10:38 pm

Post by willyhoops »

WinSCP keeps giving me the error:

Cannot execute SCP to start transfer. Please make sure that SCP is installed on the server and path to it is included in PATH. You may also try SFTP instead of SCP. Command failed with return code 127.

Any ideas why please?
Last edited by willyhoops on Sat Oct 13, 2007 10:09 pm, edited 1 time in total.
User avatar
TheEnvoy
Know my way around
Posts: 138
Joined: Mon Sep 10, 2007 3:47 pm
Location: Berlin, Germany
Contact:

Post by TheEnvoy »

Don't use winscp myself, so I don't know, but I think they did some bug fixing with the latest firmware to make it work flawlessly with winscp.

Anyway, just get putty and connect to your qnap, you need a command line anyway to restart the apache...

copy the file to Public

Code: Select all

[~] # cp /mnt/HDA_ROOT/apache/conf/apache.conf /share/Public
edit the file with notepad++ (unix mode) and then copy back and restart apache

Code: Select all

[~] # cp /share/Public/apache.conf  /mnt/HDA_ROOT/apache/conf/
[~] # /etc/init.d/Qthttp restart
Think! :idea: Search :!: Ask :?:

"Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety."
-- B. Franklin

// TS-409 Pro - Debian Lenny
// TS-109 Pro / FW: 1.1.1 0831 (offline)
willyhoops
Starting out
Posts: 24
Joined: Sat Sep 29, 2007 10:38 pm

Post by willyhoops »

Ah yes when you upgrade to the latest firmware winSCP works just fine without this error.

I can then use putty to run the command to restart apache - or there is a commands, open terminal feature in winSCP - or i can go into the qnap admin web interface and just do a system restart.

Just to check could you post your VirtualHost code you added. Also does it go at the end of the file or somewhere else? And do I have to make any other changes on top of that?

Many Thanks
Last edited by willyhoops on Sat Oct 13, 2007 11:37 pm, edited 2 times in total.
Locked

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