FTP and virtual domain in same folder

Questions about hosting a Website, using MySQL and PhP may be posted here.
Forum rules
This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:
https://myds.synology.com/support/suppo ... p?lang=enu

FTP and virtual domain in same folder

Postby c.nielsen.dk » Fri May 11, 2012 4:35 pm

Hi

I have multiple web domains (www.a.com & www.b.com) on my synology box through the virtual host. I have installed wordpress on each domain seprately (not through the package center since this only works with one domain). When wordpress updates it is done through FTP access to the web folder.

On the synology box the virtual host domains are installed in /volume1/homes/web/<virtual host>
FTP however points to /volume1/homes/<user>

How can I get FTP and virtual host to point to the same place so I can run multiple web domains with wordpress?

Thanks in advanced :-)
Synology DS207+, Synology DS411j and Synology DS712+
c.nielsen.dk
Rookie
Rookie
 
Posts: 35
Joined: Sun Aug 23, 2009 8:38 am

Re: FTP and virtual domain in same folder

Postby c.nielsen.dk » Sun May 13, 2012 10:40 pm

Let me ask in another way.
Is it possible to host sites in the users home folders.
If I have a user called a_com that hosts www.a.com and a user b_com hosting www.b.com.
But instead of writing http://servername/~a_com the location /volume1/users/a_com should have the web path http://www.a.com
Synology DS207+, Synology DS411j and Synology DS712+
c.nielsen.dk
Rookie
Rookie
 
Posts: 35
Joined: Sun Aug 23, 2009 8:38 am

Re: FTP and virtual domain in same folder

Postby HarryPotter » Mon May 14, 2012 2:40 pm

Easiest way is to redirect the url using a php script or a .htaccess file
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12326
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Re: FTP and virtual domain in same folder

Postby c.nielsen.dk » Mon May 14, 2012 6:57 pm

Thanks however I don't like the URL's to reflect "~user" in the URL.

If I edit
/usr/syno/apache/conf/httpd.config-user

<VirtualHost *:80>
Include /usr/syno/etc/sites-enabled-user/*.conf
DocumentRoot /volume1/homes/<site>
ServerName http://www.site.com
</VirtualHost>

and restart the web server /usr/syno/etc/rc.d/S97apache-user.sh restart
The URL gets right (Tested with index.html). However then I can not get PHP to execute within the user home directory.

"Warning: Unknown: open_basedir restriction in effect. File(/volume1/homes/<site>/index.php) is not within the allowed path(s): "

Even though open_basedir (Under php configuration) is set to

/etc:/etc.defaults:/tmp:/usr/bin/php:/usr/syno/synoman:
/var/packages/MailStation/target/roundcubemail:/var/run:
/var/services/blog:/var/services/homes/<site>:
/var/services/photo:/var/services/web:/var/spool/php:/volume1/@tmp/php
Synology DS207+, Synology DS411j and Synology DS712+
c.nielsen.dk
Rookie
Rookie
 
Posts: 35
Joined: Sun Aug 23, 2009 8:38 am

Re: FTP and virtual domain in same folder

Postby HarryPotter » Mon May 14, 2012 7:13 pm

The correct DocumentRoot is /volume1/homes/username/www
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12326
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Re: FTP and virtual domain in same folder

Postby c.nielsen.dk » Mon May 14, 2012 7:26 pm

Thanks

Putting index.html in /volume1/homes/site/www work fine accessing http://www.site.com/index.html
However PHP still not working when accessing http://www.site.com/index.php

Warning: Unknown: open_basedir restriction in effect. File(/volume1/homes/site/www/index.php) is not within the allowed path(s): (/etc:
/etc.defaults:/tmp:/usr/bin/php:/usr/syno/synoman:
/var/packages/MailStation/target/roundcubemail:/var/run:/var/services/blog:/var/services/homes/site/www:
/var/services/photo:/var/services/web:/var/spool/php:/volume1/@tmp/php) in Unknown on line 0 Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 Fatal error: Unknown: Failed opening required '/volume1/homes/site/www/index.php' (include_path='.:/usr/syno/php/lib/php') in Unknown on line 0
Synology DS207+, Synology DS411j and Synology DS712+
c.nielsen.dk
Rookie
Rookie
 
Posts: 35
Joined: Sun Aug 23, 2009 8:38 am

Re: FTP and virtual domain in same folder

Postby HarryPotter » Mon May 14, 2012 7:39 pm

I tried it myself. It does work if I set DocumentRoot to /var/services/homes/username/www and in DSM - Control Panel - Web Services Personal Websites is enabled.
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12326
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Re: FTP and virtual domain in same folder

Postby c.nielsen.dk » Mon May 14, 2012 8:00 pm

I'm doing a full factory reset to default settings and harddisk format.
I don't want something else to waste our time. I will get back later.
Synology DS207+, Synology DS411j and Synology DS712+
c.nielsen.dk
Rookie
Rookie
 
Posts: 35
Joined: Sun Aug 23, 2009 8:38 am

Re: FTP and virtual domain in same folder

Postby c.nielsen.dk » Tue May 15, 2012 6:17 pm

Accessing http://www.site.com/index.php
now
DocumentRoot /var/services/homes/site/www
ServerName http://www.site.com

I still get

Warning: Unknown: open_basedir restriction in effect. File(/volume1/homes/site/www/index.php) is not within the allowed path(s): (/etc.defaults:/usr/bin/php:/usr/syno/synoman:/etc:/var/run:/tmp:/var/spool/php:/volume1/@tmp/php:/var/services/web:
/var/services/photo:/var/services/blog:/volume1/homes/site) in Unknown on line 0 Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 Fatal error: Unknown: Failed opening required '/var/services/homes/site/www/index.php' (include_path='.:/usr/syno/php/lib/php') in Unknown on line 0

In "Web services" under "Web Applications" "Virtual Hosts" is empty
further more
In "Web services" under "PHP Settings" open_basedir is enabled and path is
/etc.defaults:/usr/bin/php:/usr/syno/synoman:/etc:/var/run:/tmp:/var/spool/php:/volume1/@tmp/php:/var/services/web:
/var/services/photo:/var/services/blog:/var/services/homes/site/www

It looks like something is preventing php code from running

If I access the same php script through http://www.site.com/~site/index.php the php script executes
Synology DS207+, Synology DS411j and Synology DS712+
c.nielsen.dk
Rookie
Rookie
 
Posts: 35
Joined: Sun Aug 23, 2009 8:38 am

Re: FTP and virtual domain in same folder

Postby c.nielsen.dk » Tue May 15, 2012 7:24 pm

I found this topic as well
viewtopic.php?f=20&t=44082
Synology DS207+, Synology DS411j and Synology DS712+
c.nielsen.dk
Rookie
Rookie
 
Posts: 35
Joined: Sun Aug 23, 2009 8:38 am

Re: FTP and virtual domain in same folder

Postby c.nielsen.dk » Thu May 17, 2012 7:08 am

If anyone have the same challenge as me having multiple wordpres domains one the same synology box and having the ability to upgrade and install through FTP, then look here instead: viewtopic.php?f=20&t=13208
Synology DS207+, Synology DS411j and Synology DS712+
c.nielsen.dk
Rookie
Rookie
 
Posts: 35
Joined: Sun Aug 23, 2009 8:38 am


Return to Web Server + PHP / MySQL

Who is online

Users browsing this forum: No registered users and 4 guests