Search

Ahhahahha

Having disabled cachelite.. the normal URL routing of .com returns!

hmmm might have to post a bug.

While I was going through michaele’s ssl tutorial, I kept running into issues on my (mt) dv server. Just a note, I have only gotten to the point of having symphony hosted in one spot, but showing both domains. I have not gone through the navigation aspect of his tutorial.

On the dv servers, Plesk is installed by default afaik. if you go through plesk to create a subdomain, a httpd.include is created here:

/var/www/vhosts/domain.com/conf/httpd.include

edit
it is recommended to use the vhost.conf file in the same directory above instead. if there is no vhost.conf file, simple create one and copy over the blocks of code needed to do the following steps
end edit

now, i’ve just really started admin’ing dedicated servers and learning all this in the past couple months, so I am by no means any expert on these subjects, so i do not know if this is the best or safest approach when doing this on a (mt) server. I only did modified this file b/c it had all the domain data already in it. that being said, there are still a few things you need to do that aren’t in his tutorial to get this multiple domain single build working.

getting around the open_basedir issue.

If you go through your logs after following michael’s instructions, you will see an open_basedir error popping up consistently. After some googling, I found some tutorials that explains what this is and how to get around it, but they were primarily focused on getting the pear module working. Now, once you locate the httpd.include file, open and edit (i use vim since i don’t know much else about editing via command line, please suggest anything better ;)):

vim /var/www/vhosts/domain.com/conf/httpd.include

you can do bash aliases so you don’t have to always type this stuff, but that’s beyond this post. so you will notice at least two <VirtualHost>s in that file, if not, then that means you do not have a subdomain for that domain. Find the subdomain you’d wish to have symphony on. You should have two of these lines:

php_admin_value open_basedir "/var/www/vhosts/domain.com/subdomains/subdomain/httpdocs:/tmp"

change the /tmp value to where you have symphony hosted. so probably something like this:

"/var/www/vhosts/domain.com/subdomains/subdomain/httpdocs:/var/www/vhosts/domain.com/httpdocs/"

There may also be something like Options -Includes -ExecCGI, i modified this line to be:

Options FollowSymLinks -Includes -ExecCGI

but that may not be necessary. Usually I end up restarting the server whenever I modify this file, but again, that may not be necessary:

/etc/init.d/httpd stop  
/etc/init.d/httpd start

Creating symlinks

This one was really an issue for me. I followed michaels’ instructions but kept on getting incorrect results. I had never created a symlink before so I didn’t really know what I was doing.
When I first created my symlinks, I didn’t know if you had to have a physical file or directory to get this to work. I was constantly facing this returned message after trying to create one:

Not a file or directory 

I wasn’t sure if that meant the symlink was created or not, so eventually I actually made some real files and directories to everything that needed a symlink. Once I did that and then redid the symlinks that michael outlined, i didn’t get any return message, so i thought I was golden. After more googling and messing around with my ftp program, I found something interesting - the symlinks were actual children of the directory i had created in the subdomain. so it seemed like the symlink would be looking for a path more like this:

/var/www/vhosts/domain.com/httpdocs/extensions/extensions/

instead of the desired path:

/var/www/vhosts/domain.com/httpdocs/extensions/

after realizing this, i delved into the symlink documentation (ln --help) and noticed this note about the different cases ln had:

In the 2nd form, create a link to TARGET in the current directory.

so instead of creating the symlink to a physical directory of the same name, i went into my subdomain httpdocs directory and created the symlink to the httpdocs directory instead. Now thinking about it, i’m sure i could have gone michael’s route, but left off the directory name in the second path.

cd /var/www/vhosts/domain.com/subdomains/subdomain/httpdocs/  
ln -s /var/www/vhosts/domain.com/httpdocs/extensions/

and so forth for all folders and i think the index.php file, but I can’t recall for that one exactly.

but now, after completing these steps, i refreshed my subdomain and a default bulid of symphony was showing up…finally! Next steps are to make sure the navigation stays true to each domain.

Thank you, wtdtan, for these explanations. I am sure that they will be helpful to others.

The open_basedir restriction is something I did not experience on my servers, but it may indeed be a show stopper. Thanks for pointing this out. I should ask Stephen to add a sentence or two to the tutorial.

I don’t really understand the symlink issue. My tutorial assumes that there are two physical folders in the filesystem:

  • /var/www/www.domain1.com — this is where Symphony lives
  • /var/www/www.domain2.com

So creating links like this should work:

ln -s  /var/www/www.domain1.com/extensions  /var/www/www.domain2.com/extensions;

Could you test this again (changing the paths, of course, to match your installation)?

michael, from what i understand, you’re saying the only two physical files have to be the two domains, correct? if that is the case, then from what i’ve tested the second url acts like a container to the first url. so instead of:

ln -s  /var/www/www.domain1.com/extensions  /var/www/www.domain2.com/extensions;

use

ln -s  /var/www/www.domain1.com/extensions  /var/www/www.domain2.com/;

which then makes the symlink look like it’s a child of domain2.com.

also, to add to my previous post with the plesk generated httpd.include (httpd) file, it is recommended to use the vhost.conf (vhost) instead. I think primarily b/c the httpd file can be overwritten by plesk (which makes absolute sense). One gotcha is that any subdomain created by plesk, the respective <VirtualHost> (<VH>) will not have an include reference to the vhost file. if you look in the main domain <VH>, you should find that reference right before the closing <VH> tag. just copy and paste that line within the subdomain’s <VH>. Though you are still modifying the plesk generated httpd file, just having a reference to the vhost file minimizes the amount you have to change in httpd file.

with that set in the httpd, copy the <Directory> of the subdomain (looks something like this):

    <Directory  /var/www/vhosts/domain1.com/subdomains/subdomain/httpdocs>
        <IfModule sapi_apache2.c>
            php_admin_flag engine on
            php_admin_flag safe_mode off
            php_admin_value open_basedir "/var/www/vhosts/domain1.com/subdomains/subdomain/httpdocs:/var/www/vhosts/domain1.com/httpdocs"
        </IfModule>
        <IfModule mod_php5.c>
            php_admin_flag engine on
            php_admin_flag safe_mode off
            php_admin_value open_basedir "/var/www/vhosts/domain1.com/subdomains/subdomain/httpdocs:/var/www/vhosts/domain1.com/httpdocs"
        </IfModule>
        Options +FollowSymLinks
    </Directory>

paste that into your vhost (and for safe measure, put in Options +FollowSymLinks), restart the server and you should see the subdomain working.

michael, from what i understand, you’re saying the only two physical files have to be the two domains, correct?

Not quite. There are two folders for two domains. In the first one you have installed Symphony, so you actually have some physical files and folders there. Now if you do:

ln -s  /var/www/www.domain1.com/extensions  /var/www/www.domain2.com/extensions;

This means: create a symbolic link, pointing to the existing extensions directory (in www.domain1.com), located in the www.domain2.com folder, named extensions.

It should work if you use absolute paths (starting with a slash) — but you won’t get any message if it is successful.

There are two folders for two domains. In the first one you have installed Symphony, so you actually have some physical files and folders there. Now if you do:

Right, I understand the physical folders in domain1, just like any default symphony build. But in domain2, there are no symphony related folders or does it need to mimic the folder structure of domain1?

In domain2’s folder, there are only symlinks. No physical file is necessary The only physical file you need is the .htaccess file (unless you want to have others for special reasons). The symlinks mimic the symphony installation which is in domain1’s folder.

right. when i was creating my first set of symlinks, I was running into the “file or folder does not exist” issue when linking a folder in the style you have written. when I remove the folder from the second argument, my symlinks worked.

Now i’m having an issue with the subdomain doesn’t recognize /symphony/ as the admin. I’ll have to look back at my .htaccess file to see what’s going on.

This is what your subdomain might look like in an FTP program:

screenshot

Attachments:
Bildschirmfoto 2010-05-24 um 21.58.25.png

yup, michael, that’s exactly how my ftp looks like. not sure how you were able to get those symlinks working like you did in your tutorial. every time i would try to make the symlink like your tutorial, i was always getting the “file of folder not found” error.

here’s another tip for (mt) dv user though. if you install symphony as the root user, make sure to update your user group for the debugdevkit extension otherwise when you view it from the web, that user won’t be able to write to the debug’s lib folder.

chown -R root:psacln /path/to/extensions/debugdevkit/lib/

using -R makes the process recursive while you’re still keeping the root user as the owner, but you’re moving the group ownership of the folder to the psacln group which is the web user (or at least should be). you may have to change your groups as well:

vim /etc/group

and in there, find the psacln group and add root as the first user (remember, whitespace is very important - no spaces after the commas!). I think any user created by plesk gets dropped into this group by default, though it may not show it in the doc.

edit

here’s a better way to add a user to a group instead of actually editing your /etc/group file:

useradd -G {group-name} username

Hope you don’t mind me posting this here but I figured it was a suitable place based on the post title, I’ve been following the tutorial ‘Ninja Domains: A Multi-Domain Setup using the Symphony XSLT Content Management System’ by Stephen Bau, I’m just a little confused as to where the script:

RewriteCond %{HTTP_HOST} domain1.com$ [NC]
RewriteRule ^domain2/?(.*/?)$ http://www.domain2.com/$1 [R,L]
RewriteRule ^domain2$ http://www.domain2.com/ [R,L]

RewriteCond %{HTTP_HOST} domain2.com$ [NC]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/?)$ index.php?symphony-page=domain2/$1&%{QUERY_STRING} [L]

RewriteCond %{HTTP_HOST} domain2.com$ [NC]
RewriteRule ^$ index.php?symphony-page=domain2 [L]

would need to go in relation to the .htaccess file symphony provides, any help would be great.

Dave

I put my multi-domain related rewrite rules after:

### ADMIN REWRITE
RewriteRule ^symphony/?$ index.php?mode=administration&%{QUERY_STRING} [NC,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^symphony(/(.*/?))?$ index.php?symphony-page=$1&mode=administration&%{QUERY_STRING}   [NC,L]

and before:

### FRONTEND REWRITE - Will ignore files and folders
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/?)$ index.php?symphony-page=$1&%{QUERY_STRING}    [L]

That seemed to work fine.

Great, thanks David.

As stated in the tutorial, you can put the rules at the very top of your .htaccess file, i.e. before the Symphony rewrite. (I would try to avoid hacking the Symphony part of the file, since a Symphony update script might replace this part.)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details