1
2

Hi!

I have some directories created (one for each domain I have externally managed and redirected using WebFaction DNS) and I pointed each domain to the corresponding folder in the websites menu, so I have something like:

One Static/CGI/PHP-5.3 App running on htdocs and inside this, one folder per domain as I mentioned before. So I configured in the "Domains/Websites > Websites" menu the folder for each domain, getting something like:

Name: project_name Disabled: No Ip: Web999 - 99.99.99.99 Https: No Subdomains: externaldomain.com Site apps: /dir_inside_htdocs/second_dir: htdocs

But when I access to the externaldomain.com site, I get a "There is no application mounted at the root of this domain." error and I don't know why, because this domain is within an application, isn't it?

asked 21 Jan '12, 03:14

JavierCane's gravatar image

JavierCane
156
accept rate: 0%


The "site apps" uses a "URL Path". This is a path in URL space.

For example, let's say we have:

Https: No
Subdomains: externaldomain.com
/dir_inside_htdocs/second_dir: htdocs

That means that your htdocs application is available at:

http://externaldomain.com/dir_inside_htdocs/second_dir/

Which is probably not what you want. Instead, you would map the URL subpaths that you want to use. For example:

Https: No
Subdomains: externaldomain.com
/: htdocs
/blog: wp
/foo: bar

Assuming that you have 3 applications, htdocs, wp, and bar. They would then be available at:

http://externaldomain.com/        --> htdocs
http://externaldomain.com/blog    --> wp
http://externaldomain.com/foo     --> bar

What you are attempting to do, which is map /dir_inside_htdocs/second_dir to the URL Path of /, is the inverse operation. You do that by creating a Symbolic Link to Static/CGI/PHP app and then mounting it to your website record with a URL Path of /.

Hope that helps!

link

answered 21 Jan '12, 03:26

ryans's gravatar image

ryans ♦♦
3.8k1932
accept rate: 44%

Thanks a lot for your reply! So, i understand that if I want to point some domain names to different paths, I have to create an app for each one no?

In other words: I can't use a single PHP instance/app for multiple domains hosted in different dirs?

(21 Jan '12, 23:48) JavierCane JavierCane's gravatar image

Yes, that is correct. You should create one Static/CGI/PHP app which holds your files, and then make some Symbolic Link to Static/CGI/PHP apps afterwards. These Symbolic Link applications can then be mounted to your website record with a URL Path of /.

The error There is no application mounted at the root of this domain. happens when there is no application set to a URL Path of /.

However, if you're really making a single PHP Instance for multiple domains in different dirs, this seems like the wrong way to do it.

Why not just create multiple Static/CGI/PHP applications, with one for each domain? This would make it easy to separate your code for different websites.

At the same time, the Symbolic Link applications do exist to allow you to do this anyway, if that is what you prefer.

(21 Jan '12, 23:55) ryans ♦♦ ryans's gravatar image

Ok, I think that I get it: Firstly I only have to create one Static/CGI/PHP application called htdocs (by default) and then, inside the folder /webapps/htdocs/folder1/projectfolder allocate the site via FTP, secondly create another Symbolic Link application pointing in the extra info to /webapps/htdocs/folder1/projectfolder and finally, in Websites panel, configure the project like:

Name: projectname Https: No Subdomains: projectname.com App: symbolic_link_app URL: /

I did it but for the moment I'm getting 500 Internal Server errors.

(22 Jan '12, 00:13) JavierCane JavierCane's gravatar image

Yes, that is exactly correct. (Note, the extra_info would point to /home/username/webapps/htdocs/folder1/projectfolder)

A 500 Internal Server error is actually good - it means that you have set up the Control Panel correctly, and that requests are being routed to your application.

500 Errors generally mean that something in your application code is broken or confused. You can check the logs to see exactly what's going wrong. You may need to set a RewriteBase directive.

(22 Jan '12, 00:18) ryans ♦♦ ryans's gravatar image

Thank you again for your support! you're being very helpful!

Now I have created all "parts": the domain, applications, website and FTP structure, and now I can prove that the Symbolik link application is working well because I can follow the link vía the shortcut created by the application in my webapps folder.

But I allocated a "Hello world" HTML page in the project folder with index.html as name and created a .htaccess file like you suggested me with the following content: http://pastebin.com/VdPn0NMi

But I'm still getting 500 errors, I've also tried with RewriteBase pointing to "/" and "/<folder1>/<projectfolder>" but it didn't work either.

(22 Jan '12, 00:52) JavierCane JavierCane's gravatar image

It looks like the domain which you are pointing to your Symlink application isn't actually pointing to the WebFaction Server.

You may want to configure your domain to use WebFaction's nameservers so that our Control Panel can set up the DNS for your domain automatically.

(22 Jan '12, 01:12) ryans ♦♦ ryans's gravatar image

Aaaaalright! I tried it with another domain and it's working perfectly!

The problem with the previous case, as you mentioned now, is that the domain was in transferring process from another domain registrar to GoDaddy and it's in "No action required: Processing approval" status, so I think that in the following days it'll be working as the other domain do :)

Thanks a lot for your help!

(22 Jan '12, 07:25) JavierCane JavierCane's gravatar image
showing 5 of 7 show 2 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×52
×28
×9
×6

Asked: 21 Jan '12, 03:14

Seen: 1,821 times

Last updated: 22 Jan '12, 07:25

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited