Jump to content

Skel commands


TerrasIOI

Recommended Posts

That will only run if the page it's called from will parse for SSI (server side includes), typically by naming it xxx.shtml. You might try with PHP by using this (name the page "index.php", without "quotes"):

<?php
$_SERVER['HTTP_HOST']
?>

That should print the entire requested domain name, including the www and .tld

Try it?

Link to comment
Share on other sites

This doesn't cover the webhost-server1.com/~username case, but to do that you need to fiddle around quite a bit - extract the primary domain from /etc/userdomains, which isn't normally readable. Also a good solution may need to display a different page for reseller-owned accounts.

 

If you're displaying this sort of Welcome message, to make it easier to maintain 100s of domains with this file in place, I'd just have a single line like the following in your cpanel3-skel/public_html/index.php file:

 

<?php include "/home/username/shared/holdingpage.php";  ?>

 

That way you can modify the single included file and have the update available to all your users, without needing to fiddle with files all through various home directories.

Link to comment
Share on other sites

The point was he wanted to show the requested domain name on the page that's shown. What you've done is to include a page of "something", which could be just added to the actual skel directory page instead. No point complicating it in that case.

 

To clarify, the "skel" directory is content that gets included into the home directory of newly created cPanel accounts. There is no "various home directories", as this is only used for new setups. Once set up, the account skel dir is no longer used on that account.

Link to comment
Share on other sites

I know how the skel directory (actually cpanel3-skel) works, been using it for 4 years with a script like the one I'm discussing :P

 

The point is, it introduces only a small complication (one level of indirection), and makes it possible to change or grow the default display for accounts that haven't got webpages. Less than a minute's extra work gives you a simple system that you can upgrade, or not, as time goes along. If you don't do the include trick, to upgrade the script, you'd have to go into each user account and edit the copied index.php file, or just forget about changing anything. We're talking about a potentially dynamic rather than a static page that got copied in 2 years ago when the account got created.

 

Not intending to be a smart alec, hope I don't come across that way, just trying to clarify the value here!

Link to comment
Share on other sites

We're talking about a potentially dynamic rather than a static page that got copied in 2 years ago when the account got created.

I don't know about you, but my clients tend to upload their own pages rather quickly, overwriting the skel file "hold" page that this inserts into the account. Do you really have users that buy a hosting account and don't upload anything to it for 2 years?

The point of skel files is twofold:

- Creating a default holding page so visits aren't shown errors or the cPanel default page. This is intended to be replaced by the user's files.

- Copying any important files/scripts to the account automatically on creation.

 

I obviously don't know how you are using this feature, but this is the intended purpose.

Link to comment
Share on other sites

Do you really have users that buy a hosting account and don't upload anything to it for 2 years?

Yes, although admittedly not common. We have a lot of small business (ie one-person startups, tradies, etc) customers that start off using only their email address and often don't get around to creating an actual web page for some time. I did the figures once and it was something like 40-50% had default pages.
Link to comment
Share on other sites

They're random; but one thing in common is that they're often fairly computer illiterate and they're often in small business start up mode - and they're small - often 1-2 people. I think our experience with larger clients would be fairly similar to yours. My percentages above might be wrong, but they're ballpark correct. Of course, maybe it's as simple as I don't charge enough :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated