Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Switched hosting recently (Linux, CPanel, WHM). At the old host, there was a subdomain that had a file (instead of a directory) as a root. The file was a CGI script. The said subdomain was created via CPanel by me a while ago.

At the new host, I'm trying to recreate this subdomain. And I get the following error:

The directory, /home/(...)/cgi-bin/guest.cgi could not be created.

Is there a tweak somewhere that enables this functionality?

EDIT: tried to repeat the trick on the old site, and I could not. CPanel update broke it, maybe?

share|improve this question

1 Answer 1

Perhaps you had an .htaccess on the subdomain created that leads the user to guest.cgi with a internal redirect ?

AFAIK cpanel subdomain will create the subdomain folder, so for example:

Our domain will be domain.com and our subdomain will be test

cPanel will create the subdomain for you and a default structure folder at the root of domain.com: /home/domain.com/test

Now you make a simple .htaccess file inside test with the follow content:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/guest.cgi$
RewriteRule . cgi-bin/guest.cgi [L]

The above file will redirect any request made to test.domain.com to be redirected to cgi-bin/guest.cgi !

Perhaps you had something like this on your subdomain... you can use a simple redirect in php aswell if you wish, make a index.php on the test.domain.com with the content:

<?
Header( "Location: http://test.domain.com/cgi-bin/guest.cgi" );
?>
share|improve this answer
    
I just checked .htaccess in the cgi-bin folder - it was not like this. But then again, it could've been implemented via upper-level Apache configs. I don't have root rights on that box. –  Seva Alekseyev Oct 7 '10 at 20:46
    
@Seva it is not inside cgi-bin that the .htaccess should be but inside the root folder. –  Prix Oct 7 '10 at 23:13
    
it could be anywhere up the tree to the root or in the /etc configs. –  pjz Oct 8 '10 at 0:57
    
@pjz cgi-bin folders usually have httpd.conf rules which may get overwritten so it would not work and ALSO he wants the root test.domain.com to get to test.domain.com/cgi-bin/guest.cgi so if that .htaccess is inside the cgi-bin forlder it would never work. –  Prix Oct 8 '10 at 3:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.