Jump to content

Shinryuu

Moderators
  • Posts

    1,025
  • Joined

  • Last visited

  • Days Won

    40

Posts posted by Shinryuu

  1. So I was wondering a useful way to use php the other day and came up with a simple but extremely useful script. Firstly I want to make it clear that this is more for smaller site designers wanting to find out how to best improve their sites, however larger sites with more traffic may find it useful as well for different reasons.

     

    USES FOR SMALL SITES

    • Learn how your users move around your site.
    • Learn the most popular areas of your site.
    • Help learn what can be done to move users to the areas of your site that you want.

    USES FOR LARGE SITES

    • Learn when users are visiting broken links.
    • Learn when users are trying to enter restricted areas.
    • Learn what IP is most likely that of a spammy or otherwise disruptive user.

    OVERALL USE

    • Learn what peak times are for your site.
    • Identify when the best time for site maintenace is.

    The script is simple and will only create a plaintext log but you can refine it to use MySQL databases for storage. I advise putting the script after the page's html and styling is processed to avoid any major problems with displays being broken. Now to the fun part.

     

    Small sites:

    <?php
    $ip=$_SERVER['REMOTE_ADDR'];
    $page=$_SERVER['REQUEST_URI'];
    $dayassoc=getdate();
    $output= $ip."\t".$page."\t".$dayassoc['mon']."/".$dayassoc['mday']."/".$dayassoc['year']."\t".$dayassoc['hours'].":".$dayassoc['minutes']."\r\n";
    file_put_contents("tracking.txt", $output, FILE_APPEND);
    ?>

    put that on each page to get as detailed a listing as you can about how users interact with your site. You can include this on custom error pages as well and I'll explain that shortly.

     

    Large sites:

    I suggest only placing it on error pages, also replace "errorpagecode" with 401, 404, etc depending on the page you're putting it in. If you must put it in a trafficed area try to limit the amount of pages you paste it in to avoid collisions with file write requests.

    <?php
    $errcode="errorpagecode";
    $ip=$_SERVER['REMOTE_ADDR'];
    $page=$_SERVER['REQUEST_URI'];
    $dayassoc=getdate();
    $output= $ip."\t".$page."\t".$dayassoc['mon']."/".$dayassoc['mday']."/".$dayassoc['year']."\t".$dayassoc['hours'].":".$dayassoc['minutes']."\t".$errcode."\r\n";
    file_put_contents("tracking.txt", $output, FILE_APPEND);
    ?>

     

    Feel free to leave questions and comments

    :);

     

    EDIT: Changed to use file_puts_contents() instead of messy, unintuitive c-like fopen/fputs/fclose per Byron's suggestion.

     

    EDIT 2: I should probably add that you'd want to keep people from accessing this file so in your root folder's .htaccess add something like:

    AuthUserFile "/home/user/.htpasswds/public_html/passwd"
    AuthName "Visitor Tracking"
    AuthType Basic
    <Files "tracking.txt">;
     require valid-user
    </Files>

    where AuthUserFile is the filepath to a nonpublic directory containing the user=>key pairs required to access the file. AuthName can be anything you want. Don't put the

    require valid-user

    directive outside the files tag as that will password protect your entire site.

  2. Whereas Admins should easily be able to see what the problem is
    Yes but the admins really have better things to do, like work their paying jobs and spend time with their families, they can't be expected to baby us and look into every little thing that goes wrong with our accounts. An email notification sent to suspended accounts would probably be a good idea to help users know something needs their attention, but depending on the average amount of users suspended per day that may be a bad idea, just because we only see a handful of users request unsuspensions each day doesn't mean they're the only ones suspended.

     

    Looking at the inbox on the account there are 5000 mails that are historical activation mails and it looks like they have been duplicated over and over again.

    In other words these are system mails.

     

    I'm not entirely sure what you're getting at by 'system mails', if you mean they're like activation emails sent to new users by the CMS you're using like a forum script or something, those are sent by your account not HH. You can turn these off or restrict them using your admin dashboard.

  3. It would be installed there yes, and we do not provide it, you'd have to buy one from digicert or one of the other Certificate Authorities out there, however

    I have talk to Bank for payment gateway. They will create the payment gateway and also they will give SSL certificate only in payment page.
    I'm guessing you've worked out some tentative agreement with the bank on that matter? In which case once you have your dedicated IP you'd have to ask them to give you the SSL cert to upload into cPanel and then you'd be set to go. If they do give you the cert and limit it to your payment area you'll be getting errors if you try to do https://mysite.com
  4. After you buy a dedicated IP you can install your certificate if you already have one or generate a certificate signing request in cPanel to use when buying one, then upload the cert that you buy. Once the certificate is on the server in your cPanel you'll be able to access your site using https://

  5. If rather than assume that account holders are intentionally creating these issues, they are informed prior to suspension, they can then check the accounts.

    In this case this is not something that I have implemented as the website e-mail domain is not even on this hosting.

     

    The suspension page is just a warning that something's going wonky, don't make it sound like it's always a punishment, it rarely is. It's primary functions are:

    a ) alert the user that their site is running out of control.

    b ) prevent the server, and all other sites on it, from going down.

     

    Is it inconvenient? Yes. Is it a personal attack on a user? No, so don't make it sound like your being persecuted. We cannot just mail out a warning and wait for users to analyze their site when they get a chance as that could be days before the user gets the time to do so, so we suspend the account and when you come ask for an unsuspension it's assumed you now have the time to try and work out the kinks and your site is unsuspended, it's that simple.

  6. Admin will have to fix that for you, during that week did you happen to clear your cache before deleting the add-on?
    I think I cleared neither browser- nor dns-cache, but I wouldn't take an oath on it. How could that affect my problem?

     

    You were looking at a cached page most likely and your add-on was fully working. Water under the bridge now though, if by this time tomorrow you still see a queued page clear your cache.

  7. If I buy dedicated IP from you, does https port = 443 will open?

     

    Yes

     

    After some months, if I want to host my website in other server, can I transfer this dedicated IP?

     

    I believe not as HE would be buying the rights to use that IP on your behalf. Companies purchase batches of IPs and they're allowed to use these on the machines they administer so that's why I think not, though I may be wrong.

    • Like 1
  8. To use HTTPS and your SSL Cert you need to first get a dedicated IP. The company we use requires a price of $12 US/yr for one. Use Paypal to send it to admin@heliohost.org and when the payment is confirmed you'll have a dedicated IP to use with your secure transactions.

    • Like 1
  9. better alternative for Windows.

    It won't be, it's meant for web surfing, eCommerce, Social Networking and such, without an internet connection these devices are little more than paperweights. You could argue the same about Android tablets but at least there you can install games that may or may not require web access. Also if by some weird reason they do beat marketshare out of Windows, Chrome OS runs on a Linux kernel.

     

    had heard about it somewhere being used with nexus chromebook but never heard more about it

     

    A bit of irony that a company that makes billions on marketing can't be bothered marketing their own products o_O. Originally I'd heard about it while it was in development and figured I'd eventually try it out when it was released, that was the last I ever heard.

×
×
  • Create New...