WebFaction
Community site: login faq

Dear WebFaction Community,

I have been following the steps outlined by Klynton J and John S in a ticket i submitted a while ago. Here's what i have done so far:

  1. Backup data and determine what language/framework it is written in. [php & cgi]
  2. Backup your e-mail messages. [not yet]
  3. Point your domains to your DNS servers, detail is covered in the documentation, under domains. [i'll do this after i get this to work with webfactional subdomains]
  4. Create the necessary application no our platform. If you are using a regular PHP/HTML site than you will need a "Static/PHP/CGI" type app. this is covered in more detail in the documentation, under Websites. [done] I have created a webfaction a "Static/PHP/CGI" type app named static_cgi_php. I have copied the files from verio to webfaction like this:
    webapps
        '-- static_cgi_php
            '-- mydname
                '-- www
                    |-- cgi-bin    [lots of files in here]
                    '-- htdocs     [lots of files in here]

Here are my questions.

  1. How can I get a url like http://subd.acct.webfactional.com/ to go to webapps/static_cgi_php/mydname/www/htdocs/index.htm ? [Now it goes to webapps/static_cgi_php/index.htm]

  2. How can i get an html form like the one now found in: http://subd.acct.webfactional.com/mydname/www/htdocs/dem/vs/ which looks like this: <form name="input" onsubmit="return validate()" action="/cgi-bin/dem/vs/dem.cgi" method="post"> mapped to the proper cgi file? Which should be: webapps/static_cgi_php/mydname/www/cgi-bin/dem/vs/dem.cgi

Now a submit on this form yields: Not Found The requested URL /cgi-bin/dem/vs/dem.cgi was not found on this server.

Thanks in advance. You folks are the best.

Love and peace,

Joe

asked 09 Mar '11, 13:23

jdor
28510
accept rate: 20%

edited 09 Mar '11, 13:31


You should reply to us directly in the ticket. We can not look at the account or give you exact instructions in the community forum, but will try to best answer your questions in a general way. If you want specific instruction please contact us with a support ticket.

(1) With a "symbolic link to Static/PHP/CGI" app, http://docs.webfaction.com/user-guide/websites.html#installing-applications-not-listed-in-the-control-panel

(2) Use the absolute filepath, /home/user/webapps/appname/foo.cgi

permanent link

answered 09 Mar '11, 16:35

johns
5.4k312
accept rate: 23%

edited 09 Mar '11, 16:36

In regards to your first question, (1):

In the control panel, I tried to edit the app named static_cgi_php, putting /home/user/webapps/static_cgi_php/mydname/www/htdocs into the extra_info field, but the control panel wouldn't let me.

Right. The "Symbolic Link to Static/CGI/PHP" application type is distinct from the "Static/CGI/PHP" application type. "Symbolic Link to Static/CGI/PHP" application types are located under the "Symbolic Link" category.


In regards to your second question, (2):

is there any other high level (.htaccess or httpd.conf or symbolic-link or something-else) method to map all "/cgi-bin/x/y/z" URLs to the file path webapps/static_cgi_php/mydname/www/cgi-bin/x/y/z ?

Sure. There are at least two ways. Utilizing mod_rewrite in a .htaccess file is a good option because it works in URL-space (rather than file-space). You'd be looking at something like this in your application's root .htaccess file ($HOME/webapps/staticcgiphp/.htaccess):

RewriteRule ^/cgi-bin/(.*)$ mydname/www/cgi-bin/$1 [L]

The exact syntax will depend on your particular application, and RewriteBase might also be needed depending on the application and any URL subpath mounting in the website record mounting this application.

Another solution is to find out exactly which file the current application is trying to access (and failing). Then, just creating a symbolic link on the system to make this URL work might solve the problem:

cd $HOME/webapps/staticcgiphp
ln -s mydname/www/cgi-bin cgi-bin
permanent link

answered 09 Mar '11, 23:25

ryans ♦♦
5.0k93360
accept rate: 43%

edited 09 Mar '11, 23:28

Hi Ryan. Thanks for the reply. I have been playing around with the RewriteRule for a while with no luck. I'll take this over to a ticket and then bring the answer back in a sanitized manner. Thanks again. Love and peace, - Joe

(10 Mar '11, 16:20) jdor

Thanks for the reply, John.

For (1) I tried doing what you said:

With a "symbolic link to Static/PHP/CGI" app, http://docs.webfaction.com/user-guide/websites.html#installing-applications-not-listed-in-the-control-panel

user-guide/websites.html#installing-applications-not-listed... says:

Symbolic link to static/cgi/php: If the software you want to use needs only a subset of its files exposed to the web, use a Symbolic link to static/cgi/php application. In the control panel installer, enter the absolute path to the directory you want to expose to the web in the extra_info field. Otherwise, it works just like a Static/CGI/PHP application.

In the control panel, I tried to edit the app named static_cgi_php, putting /home/user/webapps/static_cgi_php/mydname/www/htdocs into the extra_info field, but the control panel wouldn't let me. The App doc says:

This creates a Static/CGI/PHP ... extra info: leave empty...

Is there some other way of symbolic-linking?

For (2), when you say:

Use the absolute filepath, /home/user/webapps/appname/foo.cgi

I am guessing you mean that I have to go into all of my php/html files and edit each of the forms to point to the correct absolute path.

If that's what you mean, is there any other high level (.htaccess or httpd.conf or symbolic-link or something-else) method to map all "/cgi-bin/x/y/z" URLs to the file path webapps/static_cgi_php/mydname/www/cgi-bin/x/y/z ?

Thanks again.

Love and peace,

Joe

permanent link

answered 09 Mar '11, 21:55

jdor
28510
accept rate: 20%

edited 09 Mar '11, 22:35

First, BIG THANKS to Aaron H., John S. and Ryan S. for their help. As I mentioned in my reply to Ryan S., I took this to a Ticket and I am bringing the answer I got from Aaron H. back here in a "sanitized manner".

Here are the steps to fix the problem.

A. Leave the static_cgi_php app intact - as is.
B. Add a new app:
    Name: subd_htdocs 
    App type: Symbolic link to static/cgi/php app 
    Extra info: /home/acct/webapps/static_cgi_php/mydname/www/htdocs
C. Add another new app:
    Name: subd_cgi
    App type: Symbolic link to static/cgi/php app 
    Extra info: /home/acct/webapps/static_cgi_php/mydname/www/cgi_bin
    notice it is cgi [underscore] bin NOT cgi [dash] bin
        Arron H said ctl panel wont allow cgi-bin in Extra info  
D. rename /home/acct/webapps/static_cgi_php/mydname/www/cgi-bin cgi_bin $ cd /home/acct/webapps/static_cgi_php/mydname/www/ $ # make sure there is NO directory named cgi_bin here $ mv cgi-bin cgi_bin E. Control Panel - hook up the website to the new apps.
CtrPanel >Home > Sites > subd > Edit E.1 Change the existing Site app to be: App: subd_htdocs URL path (ex: '/' or '/blog'): / E.2 Add a new Site app (button at bottom right): App: subd_cgi URL path (ex: '/' or '/blog'): /cgi-bin
NOTICE IT IS cgi [dash] bin HERE
I followed these steps and tested things and a URL of http://subd.acct.webfactional.com/ sent me to /home/acct/webapps/static_cgi_php/mydname/www/htdocs/index.htm and all the cgi items that I tested worked fine as well.

BIG THANKS again, to Aaron H, John S. and Ryan S..

Love and peace,

Joe

permanent link

answered 15 Mar '11, 13:01

jdor
28510
accept rate: 20%

edited 15 Mar '11, 13:07

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:

×44
×32
×31
×6
×3

question asked: 09 Mar '11, 13:23

question was seen: 5,204 times

last updated: 15 Mar '11, 13:07

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