Symlink Apps

Symbolic link (aka "symlink") applications are used to serve web content from a directory other than the root directory of an application. They work by creating a symlink pointing the desired directory.

Symlink apps are available in two varieties:

  • PHP Apache Symlink applications can serve PHP scripts (via CGI), CGI scripts, and static content via Opalstack's shared back-end Apache server proxied behind the front-end Nginx server.
  • Nginx Static Symlink applications can serve static content directly from the front-end Nginx server.

To install a symlink application:

  1. Follow our general instructions for adding applications and select either "PHP Apache Symlink" or "Nginx Static Symlink" as the application type in step 5. A "Symbolic Link Path" field will appear in the application form when you've selected a symlink app type.

  2. In the Symbolic Link Path field, enter the full path to the directory that you want to serve, including the trailing slash.

    For example, if your shell user is named myuser and you want to serve a directory named myfiles in the shell user's home directory, then you would enter /home/myuser/myfiles/ as the symlink path.

  3. Click the green "Create Application" button to save your new symlink app.

  4. Complete the setup by adding the symlink app to a site.

Modern PHP web frameworks such as Laravel typically serve their content from a subdirectory of the project directory. PHP apps on Opalstack are served from the app directory, so a symlink app is needed instead of a regular PHP application.

  1. Create a shell user if you have not done so already. You can use an existing shell user if you wish.

    The rest of this example will use myuser as the shell user name.

  2. Upload your Laravel project into your shell user's home directory.

    The rest of this example will use mysite as the Laravel project name.

  3. Create a new symlink application with the following values:

    • Name: whatever you like. For this example we'll use mysite_public_symlink
    • Type: PHP Apache Symlink
    • Symbolic Link Path: /home/myuser/mysite/public/ (change myuser and mysite to your shell user and project names.
  4. Create a site to serve the symlink app from step 3 on the URI path /.