Monday 22 April 2013

Auto fix for file permissions and ownership

suPHP and FastCGI require files and folders to have a specific set of permissions/ownership from other handlers. Without these permissions set you will see a lot of errors such as: “403 Forbidden”, “500 Internal Server Error”, or simply generic errors that commonly have the word ‘permission’ in them.

It can be very time consuming to track down and check file permissions across a whole server. Luckily, fixing this on a cPanel box can be scripted. This gives us a quick and very easy script you can wget to any cPanel server. Simply run the ‘fixperms’ script, specifying the user (or all users), sit back and watch the errors just disappear. I use this script daily in my administrative work and it never fails! It is simply a good generic fix if you cannot find your permission problem, or if you have just switched your handler and need a quick way to change every user account on the server.

***WARNING!!! The following scripts are intended for suPHP or FastCGI. If you are not running either of these two handlers, be aware of how the script works and the changes it makes. The code is posted at the end of this article; please take a moment to review it. For example, when running DSO, some files/folders may need to be owned by ‘nobody’ in order to function properly (such as in certain WordPress functions or PHP based file uploads). Running this fixperms will set everything to USER:USER. Under DSO, this is potentially not a problem for most sites, except a few core functions may not work. You can always change specific files later if any errors pop up.

Furthermore, it is highly recommended that you run a full backup of your server before running fixperms or any other script that makes changes to multiple files.

This ‘fixperms’ script is intended for cPanel servers only. It is dependent on cPanel’s internal scripts and file structure. If you’re on anything else (such as Plesk), it will simply fail to run. It won’t be able to do anything.

I know that criteria sounds very specific, but those two conditions cover a large number of the reseller/multi-user hosting servers out there. And that’s really the crowd that would benefit most from an automated script such as this.

That all being said, if you are running suPHP or FastCGI, press on; for this script will work flawlessly for you and potentially save you a TON of time & hassle.

Fixperms – for one single user



To use the fixperms script, simply log into your server as root, wget the file from our server, then run it. Type in the cPanel username and it will run only for that particular account.

It does not matter which directory you are in when you run fixperms. You can be in the user’s home directory, the server root, etc. The script will not affect anything outside of the particular user’s folder.

wget http://r6host.com/scripts/fixperms.sh
sh ./fixperms.sh -a USER-NAME

Fixperms – for all of the users
If you would like fix the permissions for every user on your cPanel server, simply use the ‘-all’ option:

wget boomshadow.net/tools-utils/fixperms.sh
sh ./fixperms.sh -all

Verbosity of Fixperms
By default, the script runs in a ‘quiet’ mode with minimal display. However, if you’re like me, you may want to see everything that is happening. You can turn on verbosity and have the script print to the screen everything that is being changed. I find this extremely useful when fixing large accounts that have many files. You can watch the changes as a sort of ‘progress bar’ of completion. The ‘-v’ option can be used per account or with all accounts.

For one single account:

sh ./fixperms.sh -v -a USER-NAME
For all accounts:

sh ./fixperms.sh -v -all

Tuesday 16 April 2013

DDoS attack

Short for denial-of-service attack, a type of attack on a network that is designed to bring the network to its knees by flooding it with useless traffic. Many DoS attacks, such as the Ping of Death and Teardrop attacks, exploit limitations in the TCP/IP protocols.

For all known DoS attacks, there are software fixes that system administrators can install to limit the damage caused by the attacks. But, like viruses, new DoS attacks are constantly being dreamed up by hackers.

According to this report on eSecurityPlanet, in a DDoS attack, the incoming traffic flooding the victim originates from many different sources – potentially hundreds of thousands or more.

This effectively makes it impossible to stop the attack simply by blocking a single IP address; plus, it is very difficult to distinguish legitimate user traffic from attack traffic when spread across so many points of origin.

Wednesday 10 April 2013

Clear/Flush DNS cache in Windows / Linux / Mac Machines

DNS

A DNS server resolves domain names into IP addresses. So when you request “eukhost.com” for example, the DNS server finds out the address for the domain, and sends your request the right way.

DNS Cache Problem

If you continually get DNS errors while trying to brows any site, but the same site on another computer on the same network is working fine. Then this problem is because of the DNS cache of the machine and you need to reload your DNS cache on that machine.

Please follow below steps to Clear/flush DNS cache in Windows / Linux / Mac Machines

To Clear/flush DNS cache in Microsoft Windows.




Start >> Run >> cmd


In command prompt, type




C:> ipconfig /flushdns

ORIn command prompt, type



C:> net stop dnscache
C:> net start dnscache

Once you run the command your Window DNS cache will Clear/flush.To Clear/flush the DNS cache in Linux, you need to restart the nscd daemon. You need login into the shell of your machine and type





root@server [~]# cd /etc/rc.d/init.d
root@server[/etc/rc.d/init.d]# ./nscd restart


Once you run the command your linux DNS cache will Clear/flush.To Clear/flush the DNS cache in Mac OS.
In your terminal, type
For Tiger Mac



$ lookupd -flushcache



For Leopard Mac



$ dscacheutil -flushcache

Once you run the command your DNS cache (in Mac OS) will Clear/flush.















Tuesday 9 April 2013

How to add My IP address to the firewall - ssh access

For security reasons, SSH access to your server is blocked at the firewall level. Before you can connect to your account via SSH, you will need to add your local IP address to the firewall.


  1. Find your IP address. Visit http://www.whatismyip.com  and note the IP address displayed. This is your IP address as seen by the rest of the internet.

  2. Log into your WHM (Web Host Manager)

  3. Click the "Add IP to Firewall" link (this link is one of the last links in the left menu in WHM).

  4. Enter your IP address in the "Allow Rule:" field and click the "Add Rule / Restart" button.



Please Note:
If your IP address does not stay the same each time you connect to the internet, you can add a range of IP address so that you do not need to add your new IP address each time it changes. We are unable to advise you with what your IP range is, however your Internet Service Provider should be able to assist you further. You will need to use CIDR formatting when adding a range of IP addresses. Please see the "Information on CIDR Formats" and "IP to CIDR Converter" links in the "Add IP to Firewall" page in WHM for further assistance.

Cloud Servers vs. VPS Platforms - What’s the Difference?

VPS (Virtual Private Server) has been one of the widely used and highly acclaimed technologies in webhosting industry. Its only due to the providers who offer affordable solutions and hence enable enterprises to cut down their expenditures. What the webhosting provider does is, using a virtualization technique, a single physical server is divided into limited number of logical partitions which is termed as the Virtual Servers.
This type of server is considered to have the qualities of both shared server hosting as well as the dedicated hosting.

One of the unique features of VPS Hosting is its capability to offer a dedicated like environment to users. Root access enables users to have complete access of the server hence allowing them to install applications and software’s of their choice. Before the evolution of this technology, this feature was only available with a dedicated server. But, since the cost of a single dedicated server is divided into number of VPS accounts, users can avail the packages at fairly affordable price.

Unlike the cloud hosting, the responsibility of a VPS needs to be borne by you. Initially you would need to get all your basics right, learn how you would secure your server, get the updates added and learn all sorts of maintenance techniques. There may be fluctuations in the performance of your VPS, in that case you should be able to identify the programs that are causing the spikes. But if you wish to get rid of all this, you can opt for a Managed Web Hosting service offered by a reliable web hosting provider.

On the contrary, Cloud hosting is one new solution that is comparatively pretty new to the hosting industry. It is known to offer scalability and reliability. A Cloud is basically a cluster of multiple servers, and the computing resources of these servers are shared between each other. Almost any number of servers can be added to a single cluster, hence, one can consider Cloud to offering limitless hosting.

These cluster of servers are connected with a fully redundant network hence decreasing the chances of downtime.

Based on the Cloud hosting account requirements, the resources get automatically allocated and de-allocated. Users are only required to pay only for the resources that they have actually used. Hence, Cloud hosting is considered to offer the best value for money.

Monday 8 April 2013

CSF - Limit FTP Access to Specific IP's Only on Server

If you are running CSF on your server and want to allow FTP access from certain IP address only, do the following:
1. Remove FTP ports (20,21) from a list of allowed incoming TCP ports (TCP_IN)

2. add IP addresses you want to allow FTP connections from to csf.allow


3. Restart CSF

Here is a quick CentOS script:


mv /etc/csf/csf.conf /etc/csf/csf.conf-`date +%d-%b-%Y`
cp /etc/csf/csf.conf-`date +%d-%b-%Y` /etc/csf/csf.conf
perl -pi -e 's/(s*TCP_INs*=s*.*?)("|,)20,21,(.*)/${1}${2}${3}/' /etc/csf/csf.conf
echo "198.xxx.xxx.xxx # Allow FTP access from this address" >> /etc/csf/csf.allow
service csf restart

Wednesday 3 April 2013

What is Managed Hosting?
As the name implies, managed hosting refers to the hosting plans that are administered by the webhosting service provider. In the webhosting industry, you will find competitive prices as each company charges their hosting plans according to the level of managed hosting provided by them. There are lowest to highest pricing hosting plans in hosting industry staring from shared hosting to Dedicated server and different high end hosting solutions. If the price range is high, it is very important to understand the value of the services that you would be receiving from managed webhosting packages.

Fully Managed Hosting:
Many webhosting companies use “Fully Managed Hosting” term while promoting their plans and services. The term itself implies that the hosting accounts are fully administered by the webhosting company.

Company offers technical support of certain level. Higher the price of the package more will be the level of support that you will receive by the company.

In fully managed service, your website and server is monitored round the clock so you don’t have to be concerned about the uptime and technical issues.

You can contact the technical support staff easily via telephone, live chat or email and get any unresolved issues fixed in a real time.

Some hosting providers have “Partial Managed web hosting” packages in market in which technical support is provided by company but some administrative functions are to be taken care by customers. So, it is strongly recommended to contact hosting company and check the services included in fully managed hosting service before signing up for any plan.

Who use managed webhosting services ?
The two basic reasons managed webhosting is used. It is used by both individuals and businesses to minimize the amount of hands on IT work that needs to be performed on the server in order to keep it maintained:

Limited IT Knowledge –

Some websites are highly popular and need a more robust webhosting solution. However, the business owner or the staff may concentrate on the business as opposed to the hosting solution and simply do not have the knowledge to administer the server space properly. They can then rely on the web hosting managed services to ensure everything is set up properly.

Limited Time –

Even if there are available resources they may be dedicated to other tasks and hence, there may not be enough time to properly administer the server as needed. Instead of a need for knowledge there is a lack of time available to devote to it, thus managed services are a convenience.

What is included in managed hosting services?
If you are considering paying the additional cost for managed services you want to know what is included in that cost. All web hosts have various services that they consider managed. Some provide particular services as part of a package and then some are available a la carte and only paid for whenever you need them. You may find:

Server monitoring

Backup services

OS optimization

Trouble shooting

Security auditing

On call maintenance

Hardware upgrading

Software installation

Control Panel setup

Reboots

Advantages of Managed Hosting:
Managed hosting is recommended for individuals and small businesses as it will be very expensive to hire a full-time in-house technician and webmaster to administer and maintain websites.

Uptime is very important for small businesses to maintain reputation of company. So, with managed hosting you do not have to worry about uptime as it is taken care by the webhost provider.

Managed hosting services are costlier than normal hosting plans but you will save yourself a lot of resources and time on administration and maintenance of website.

Monday 1 April 2013

With whom should I register my domain name?

You can buy your domain names from the cheapest company out there, but you are going to get what you pay for.

We recommend to buy your domain name with a company who you trust and who is available for contact when you need them. If you feel that we are the best company, we will treat you right, and never trap you into staying with our services.