WebFaction
Community site: login faq

In the past the test php apps that I've created have all been at the top level - meaning that the entrance page has always been at /home2/MYNAME/webapps/appname/index.php

No worries there.

Now I'm testing a micro-php framework that does the action-mapping for me in pure php code (trying to get away from writing all the glue code myself). This is only a test so far, but the documentation at Webfaction doesn't make it clear how this would be installed. On my test server at home I have to create a symbolic link in the apache conf that points the top level to (say) /var/www/testsite/webroot/ because /webroot/ is the directory that holds the index.php. At the same level as the webroot folder are other folders that hold parts of the application server, such that ../foldername/ is sprinkled throughout. Of course I can change all the mapping, but that is tedious.

I'd rather do something similar here at Webfaction that I do at my home server, meaning that the webroot directory will be the top directory (it will be /home2/MYNAME/webapps/appname/webroot/index.php where index.php is provided by the framework).

At Webfaction there are instructions on creating a symbolic link using the extra_info field, but that didn't seem to work on the first attempt. I received an error in the installation of the application. I know that index.php can be used at the top level as a type of forward, but that isn't spelled out anywhere in the Webfaction docs as supported.

Does someone know step-by-step how this can be done? Basically the webroot folder has its own .htaccess. I just need AFAICT to make sure that the "appname" folder has a symbolic link that says appname/webroot/ is actually the / folder for the app.

Thanks ahead of time

asked 23 Sep '11, 13:56

mumin
3623
accept rate: 100%

Hmm... using /home2/MYNAME/webapps/appname/webroot as a symlink path shouldn't cause any errors, and that's definitely the way we recommend setting up things for that sort of framework.

Can you let me know the exact symlink path you used and the exact error that you saw?

Feel free to open a support ticket if you'd rather not share that info in the forum.

(23 Sep '11, 14:17) seanf

It occurs after reading your comment that maybe the issue would be the syntax of the symbolic link. Could you share if there is any special syntax for the symbolic link that would be needed to set the extra_info?

(23 Sep '11, 14:20) mumin

There's nothing special. The syntax is simply that it needs to be an absolute path to the directory that you want to serve, eg /home2/MYNAME/webapps/appname/webroot

(23 Sep '11, 14:23) seanf

Hmm - and the application type should be CGI/STATIC/PHP or it should be custom? I'm going to try again.

(23 Sep '11, 14:28) mumin

The application category should be "Symbolic Link" and the type should be whichever of the three is most appropriate.

(23 Sep '11, 14:37) maryh ♦♦

Answer from the poster - after trial and error. In essence you need two Webfaction applications to get this to work (at least with these micro-PHP frameworks).

  1. Create an application (in my case it was of type PHP5.3) that holds the actual application.
  2. It isn't necessary to create a domain or web mapping for this, the actual application code - just create an application of the correct type.
  3. Unpack the framework elements into this new application's folders as normal using SSH.
  4. AFTER the creation of the framework elements into this application you must make the symbolic link application that calls the actual as the link, so
  5. Go through the exercises needed to create a new, 2nd actual Webfaction application (create the domain/app/website mapping for the actual application URL) WITH the following change...
  6. The application type for this second application is Symbolic Link, in the extra_info you should put the actual full path to the other, real application. In my case the extra_info was /home2/myname/webapps/myrealapp/webroot (since webroot folder has the index.php and the .htaccess file)

Now, if this second, symbolic application (the symbolic link) has a universal URL as mycompany.com this url will go to the symbolic link of the other application and load from the actual application running.

permanent link

answered 23 Sep '11, 15:33

mumin
3623
accept rate: 100%

thanks, your advice worked for me!

(18 Jan '12, 17:37) richard
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

Question tags:

×262
×57
×33
×17
×17

question asked: 23 Sep '11, 13:56

question was seen: 5,639 times

last updated: 18 Jan '12, 17:37

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM