Web Hosting, Reseller and Windows Hosting Stuff

Another one of those web hosting blogs …

  • Home
  • Recomended Web Hosting

How to run a PHP script on cron?

First make your your web host allows you to do cronjob. We recommend using ehostpros.com for web hosting.

Look here to see how to setup your own crontab.

If your PHP scripts do not have executable permissions, 644 or -rw-r–r– for example, then as part of the command portion of the cron line, you must specify the php interpreter and pass it the filename of the PHP script (including full path to the script from your home directory) that you want executed, like so:

28 14 * * * /usr/local/bin/php /myscript.phtml
6 3 20 4 * /usr/local/bin/php /htdocs/www/x.php

The first cron line above will run myscript.phtml located in your home directory every day at 2:28PM. The second line will run the script x.php from your /htdocs/www/ directory once a year on April 20th at 3:06AM.

When you explicitly specify the php interpreter /usr/local/bin/php your scripts need not have filenames ending in .php .phtml .php3 .php4. Conversely, if your script filenames do not end in one of those PHP extensions, then you must explicitly use the php interpreter in the command portion of your cron as above.

If your PHP scripts do have executable permissions like 755 or -rwxr-xr-x and they have one of the PHP filename extensions above, then you do not need to specify the php interpreter in the command portion of your cron line, like this:

5 17 * * 2 /myscript.php

The above cron would run myscript.php in your home directory every Tuesday at 5:05PM.

How to disable the safe mode for particular domain

You cannot turn safe_mode off in .htaccess.

You can only change this value in system files (root access needed); php.ini or in <virtualhost> entry in apache’s httpd.conf.
More info: http://www.php.net/features.safe-mode

HOW-TO:
Changing safe_mode to off (or on) in just one domain

edit /usr/local/apache/conf/httpd.conf
find something similar to:
Quote:
<VirtualHost IP.IP.IP.IP>
ServerAlias www.domain.com domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /home/user/public_html
(…)
</VirtualHost>
of the domain name you wish to change, and palce inside <virtualhost></virtualhost>:
<IfModule mod_php4.c>
php_admin_flag safe_mode off (or on)
</IfModule>

That way, domain.com will have safe_mode disabled (or enabled)

Secure Your Server in ten steps

So many people are getting their own dedicated servers but are completely clueless about security. Usually they leave it up to the  company where they purchase it or hire someone. That’s fine but   make sure you have these 10 items covered.

1) Use a Firewall

Make absolutely sure that your server has a firewall running all the time. A firewall is like a screen door to your porch. It blocks out flies, rodents and other pests but you can still walk out and use your BBQ. If someone ever were to get into your server, which is very very likely, the first thing they’re going to try and do is upload something to start a daemon or their own service like an IRC server or use a port to launch attacks to other systems. A firewall with egress and ingress protection can stop both incoming and outgoing attacks even when you’re not aware of it. We recommend using APF on Linux systems or TinyFirewall on Windows Servers. These are software firewalls so there’s no extra monthly cost like a hardware firewall. For very busy systems a hardware firewall is recommended so it takes the burden off your system CPU/RAM and resources to do the work.

Know what ports are open and why, know how to block and unblock an IP. These are basic things you need to understand in the daily security of your system. If someone from an IP begins a brute force attack you want to know how to stop them, right away.

2) Update your kernel and OS

Make sure your server is using current, updated software. Use the stable version which has been tested more than any beta and update as soon as possible. An old kernel can lead to an easy target for your server. If you’re not sure then ask your provider for the latest update.

3) Monitor Logs

Do you know what logs record which activities? How often are they updated and rotated?
LogWatch is a great tool to email you the daily reports of your systems activity of anything it determines unusual, EG repeated failed logins. Besides using this you should check your logs manually to see what’s up. Tail –f /var/log/messages and view your Apache logs as well. More >

WHM Skins

On Cpanel Servers Skins are located at:
/usr/local/cpanel/lang/

If on any server some sking file is missing you can copy from another server that has all skins in its /usr/local/cpanel/lang/ directory and copy it to the server without skin.
and name it spanish etc the lang. name

Then chown it to:
chown -R root.wheel languagename

How do i Backup and Restore my site ?

You can take site backups very easily from cpanel-

SITE BACKUP:

1)Login to cpanel

2) Click on “Backup” Icon

3) You can see lot of options on this screen.

If you want to take complete site backup including emails click on “Download Today’s Home Backup” Link and save.

SITE RESTORE:

To restore site choose “Restore a Home Backup” and browse backup file. It should be tar.gz extension file. Then hit restore button.

Your site will be restored as per backup.

«12
    • Recent comments
    • Popular posts
    • Archives
    • Tags
    • Categories
    • cPanel Hosting (5)
    • Domains and DNS (1)
    • Email Related Stuff (1)
    • PHP Stuff (2)
    • Reseller Hosting (1)
    • Server Security (1)
    • VPS Hosting (2)
    • WHM Help (2)
    • Windows Hosting (2)
    • Wordpress Hosting (1)
    asp.net hosting backup backups cheap hosting cloud cpanel cron dns domain-hosting ehostpros ehostpros.com Enkompass firewall hotlink ip OpenVZ package Paralles permissions php reseller restore safe-mode server skins spam vps website whm windows wordpress
    • April 2011 (1)
    • February 2011 (1)
    • August 2010 (4)
    • July 2010 (4)
    • June 2010 (4)
    • May 2010 (1)
    • How do i Backup and Restore my site ? (0)
    • WHM Skins (0)
    • Secure Your Server in ten steps (0)
    • How to disable the safe mode for particular domain (0)
    • How to run a PHP script on cron? (0)
    • What is IP Deny Manager (0)
    • How to create your own hosting packages in WHM ? (0)
    • Windows Hosting control panel from Cpanel (0)
    • What is DNS propagation? (0)
    • What are file and folder permissions? (0)
  • Unlimited Web Hosting
  • Resources

    • Cheap India Hosting
    • Cheap Web Hosting
    • Cheap Web Hosting UK
    • Fast Web Hosting
    • India Web Hosting
    • Web Hosting Coupons
    • Web Hosting Reviews
Hosted by eHostPros.com