Archive for Linux Web Hosting

How to Reset Plesk Admin Password Using Shell

Passwords are very case sensitive and most of the times it happens that users forgets important passwords. Here in this tutorial we are going to show how to reset plesk root password using shell and command prompt.

Reset Plesk Root Password with Shell : Plesk Linux

This can be done using the “ch_admin_passwd” binary.

[root@plesklinux root]# cd /usr/local/psa/admin/bin/

[root@plesklinux bin]# ./ch_admin_passwd —help

./ch_admin_passwd: Utility to set Plesk adminstrator’s password

Gets password from the environment variable PSA_PASSWORD

Password should be from 5 to 16 symbols and must not contain login name, whitespace, quotes or national characters

[root@plesklinux bin]# export PSA_PASSWORD=’newpass’

[root@plesklinux bin]# echo $PSA_PASSWORD
newpass

[root@plesklinux bin]# ./ch_admin_passwd

[root@plesklinux bin]# export PSA_PASSWORD=

[root@plesklinux bin]# cat /etc/psa/.psa.shadow
newpass

[root@plesklinux bin]#

Reset Plesk Admin Password Using Command Prompt: Plesk Windows

Plesk Windows Root Password can also be retrieved and reset with the help of the plesksrvclient binary located in the %plesk_bin% directory.

Open your Windows Command Prompt and type the following command and hit the Enter button:

cd %plesk_bin%

It will enter in to the directory where the Plesk’s Bin folder is located.

In order to get the existing root password, enter:

plesksrvclient.exe -get

It will show the existing password on a popup window. To copy it on clipboard click the Ok button.

To set a new password, enter above command without “-get”:

plesksrvclient.exe <NEWPASS>

It will enable you to insert a new desired password for your Plesk Admin login.

cPanel Web Hosting

How to Use sudo to Assign Root Access to a User on a Linux Server

Using sudo to Assign Root Access to a User on a Linux Server

Attimes you are required to offer Root access for a particular account having limited privileges on a server. You must follow the below steps to assign Root Access to a particular user using sudo.

Step 1 : Login to the server as root.

Step 2 : Run the following command :

root@host [~]# visudo

Step 3 : The screen displayed would be of the sudoers file in the vi editor. You must include the belwow line into this file to assign complete root privileges to an account (in our case it is accountname).:

accountname ALL=(ALL) ALL

Step 4 : If you do not intend to offer the complete access but be able to run a particular list of commands, you may create a command alias in your sudoers file, for example:

User_Alias ADMINS = accountname
Cmnd_Alias HTTPD = /etc/init.d/httpd
ADMINS ALL = HTTPD

With this, you should be able to create a group of users whom you can then assign command aliases to. You only need to ensure that the users are separated using a comma (,).

The Cmnd_Alias would show you a list of different commands that the users of a particular Alias can run. You may then choose the user alias and assign the command alias.

The above would ask the user to enter his/er password each time sudo is run. Though if don’t want the system to ask for a password each time, you may replace ADMINS ALL = HTTPD in the last line with the following :

ADMINS ALL = NOPASSWD: HTTPD

Incase you need any assistance with this, please contact our support department via. 24×7 Live Chat available at www.eukhost.com

Affordable web hosting

httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName | Solved

The ‘yum’ package manager can be used to Install the apache web server on an Fedora web server. Known for it flexibility and stability, Apache is considered to be one of the highly popular and widely used web-servers in the Industry. There isn’t a web server that hosts more websites than what Apache does. Moreover, finding support for it is just meters away, one can find a number of tutorials on this topic over the World Wide Web.
The information offered below would help users understand the steps to get rid of the warning :

httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

To initiate the the process, we’d first check the IpTables

You need to be careful with the primary step ie. before you install a web server. This is to ensure that browser is capable of reaching it.

Usually, if you have a firewall running on a server, it may carry out its task of blocking traffic to ports 80 and 443 which are usually used for regular and secure connections respectively. So, you must first check the firewall rules using the below command :

sudo /sbin/iptables -L

Check whether the ports 80 and 443 are open. Well, if you do not have a firewall installed on a server yet, there is no question of making any changes to it.

If you find that the ports are closed the following rules should be set in iptables configuration:

iptables -I INPUT -p tcp –dport 80 -m state –state NEW,ESTABLISHED -j ACCEPT
iptables -I OUTPUT -p tcp –sport 80 -m state –state ESTABLISHED -j ACCEPT
iptables -I INPUT -p tcp –dport 443 -m state –state NEW,ESTABLISHED -j ACCEPT
iptables -I OUTPUT -p tcp –sport 443 -m state –state ESTABLISHED -j ACCEPT

How to Install Apache on Fedora ?

The procedure to Install a basic apache is simple, use the following command for the same :

sudo yum install httpd mod_ssl

This command would install apache and couple other packages to support few of the required option.

Setting the ServerName

You may probably encounter a warning such as “httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName”. Such a warning is usually shown by “httpd” as it is a default name of an apache process when it’s running, therefore you must look for in a ps list or top.

To get past this warning you are first of all required to create a “custom” directory in apache’s configuration directory. The following command should help you do that :

sudo mkdir /etc/httpd/conf/custom

Now create a config file to store your server name:

sudo nano /etc/httpd/conf/custom/preferredserver_name.conf

You must now include the below line into the servername.conf file

ServerName preferredserver_name

NOTE : You must replace the “preferredserver_name” with the name of your choice. Make sure that you do not use domain name as we’d be using it to create virtual hosts later.

Then, you must save the file.

Now, make amendments to the the main apache config file, use the following command to access it:

sudo nano /etc/httpd/conf/httpd.conf

Scroll down to the end and insert the below code:

Include /etc/httpd/conf/custom/*.conf

Save the changes made to httpd.conf.

This completes the installation of apache.

Use the below command to start automatically upon reboot.

sudo /sbin/chkconfig httpd on

Make sure that the ServerName is included in the httpd.conf file and the host name is correctly specified:

hostname preferredserver_name

Once the server is Rebooted, you shouldn’t see the Warning message again.

Cloud Servers in the UK

Using Yum Commands to Disable and Remove Package Repositories on CentOS

YUM also called as Yellowdog Updater, Modified is a default package management system which is mostly used in all versions of CentOS to install and update packages and repositories. With the help of “yum” a user can maintain their OS and applications updates very easily. In this tutorial, we are going to see how to disable and remove package repositories on CentOS using yum.

Disabling a Package Repository

Usually, the package repositories are located in the definition files, which can be found in the directory named /etc/yum.repos.d . In order to disable the file, you need to modify the proper file and set the below given parameter.

enable = 0

The above parameter will keep the repository, however it will disable it until you decide to use it in future.

Removing the Repository Completely

If you wish to remove the repository completely, simply delete the aforesaid file.

How to Clear the YUM Cache?

Generally, when a package is downloaded, installed and then it is removed there is a possibility that the package may still be memorized in the yum’s cache. In order to clean all the cached packages from the enabled repository cache directory, enter as root:

yum clean packages

In addition to that, to purge the old package information completely, simply run the following command.

yum clean headers

To clean any cached xml metadata from any enabled repository, enter:

yum clean metadata

If you wish to clean all the cached files from any enabled repository at once, enter:

yum clean all

To make sure that YUM has fresh data and functions perfectly all the time, you should “clean” it on a regular basis.

cPanel Web Hosting

How to Install Mod_Pagespeed on Centos ?

A Brief about mod_pagespeed ?

mod_pagespeed is basically an open-source module for Apache which does the task of optimizing the web-pages and its resources. Its an automated process and makes use of the filters for enhancment of web performance by re-writing the resources. Performance enhancement for Apache HTTP Server can easily be achieved using the module.
Multiple filters are included within this module that helps in optimizing JavaScript, HTML and CSS stylesheets. Moreover, even the images in the formats .jpeg and .png can be read by the filters. As a final result, users can find an improvement in the load time for webpages on a website.

How to install mod_pagespeed?

Step1 : Determine the Linux distros and the version on the server by using the following command:

uname -a

Step 2 : Download the latest version of mod_pagespeed from http://code.google.com/speed/page-speed/download.html

Lets consider a 64 bits CentOS Linux system for the procedure further

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_x86_64.rpm

Step 3 : Use the following command to install it:

rpm -i mod-pagespeed-*.rpm

Step 4 : Confirming the installed files :

rpm -ql mod-pagespeed-beta
/etc/cron.daily/mod-pagespeed
/etc/httpd/conf.d/pagespeed.conf
/usr/lib64/httpd/modules/mod_pagespeed.so
/var/www/mod_pagespeed/cache
/var/www/mod_pagespeed/files

Step 5 : You must now restart Apache using the below command

service httpd restart

How to Upgrade mod_pagespeed ?

Inorder to upgrade the mod_pagespeed module, you must first download the latest version and make use of the command “yum localinstall mod-pagespeed-*.rpm” for the purpose of installing http://code.google.com/speed/page-speed/download.html

Use the below commands to upgrade the package :

sudo yum update
sudo /etc/init.d/httpd restart

Affordable web hosting

Install Suhosin PHP Protection Security Patch on Linux

A number of open source application are preferred widely across the web, hence its security becomes a vital concern to the developers, providers and more importantly the users. Inorder to protect the applications developed in PHP, Suhosin is strongly recommended. The Suhosin patch offers great help with protecting the PHP based application from being completely exploited. The patch is considered to offer an advanced protection system for PHP installations. The main idea behind designing Suhosin was, to offer protection for servers against various attacks and other known issues in PHP.

How do I install Suhosin under different Linux Distributions ? (RHEL / CentOS / Fedora)

Step 1 : Download latest version of Suhosin, enter the following command for that purpose

# cd /opt
# wget http://download.suhosin.org/suhosin-0.9.32.1.tgz

NOTE : You must ensure that php-devel is installed:

# yum install php-devel

Step 2 : Then Compile Suhosin under PHP and RHEL / CentOS Linux using the below commands

# cd suhosin-0.9.32.1
# phpize
#./configure
# make
# make install

Step 3 : The Configure Suhosin onto the server, using the below command a configuration file of Suhosin would be created

# echo ‘extension=suhosin.so’ > /etc/php.d/suhosin.ini

Step  4 : Using the below command you must not restart the server

# service httpd restart

NOTE : Incase you have lighttpd activated on the server, you must use the below command to restart it

# service lighttpd restart

Step 5 : Now you must recheck whether Suhosin has been installed on the server. Using the below command you may do so

$ php -v

NOTE : You may run the following command to check for more details

<?php
phpinfo();
?>

Web_Hosting_UK

Automated Password Generator (APG) for Linux Distros

Security is one of most crucial concerns of the new generation of Internet. Various ways to strengthen security are developed day-by-day, one such tool is the APG which is considered to be among the simplest methods of tightening security over web hosting servers. As the name suggests, it offers the capability for generating complex and difficult-to-judge passwords. While some may feel comfortable building such a password manually, but this is tool is as good as doing it in the same way.

What is APG (Automated Password Generator) ?

APG or Automated Password Generator is a Linux program that helps webmasters and server administrators with creating random, secure passwords, through the SSH of server’s. A wide range of Linux distros use APG in their repository, its installation is as simple as its usage. It uses permutations and combinations of various characters, alphabets, numbers, in-combination to generate an unpredictable password.

APG is free open source software that can be downloaded from available for download from http://www.adel.nursat.kz/apg/ for Linux and its distros.

To check the existing settings, you may simply enter ‘apg’ in the command line after which you would see a prompt that looks like the following :

Please enter some random data (only first 8 are significant)
(eg. your old password):>

As you enter the password, you’d not be able to view the characters. After hitting the Enter button, apg would instantly generate six passwords, followed by their pronunciations. Note : Do not misunderstand this to be the passwords, its just a provision made to help you remember the password but are still in a much secure format.

Below is a list of such examples :

Ryatyiarp0 (Ryat-yiarp-ZERO)
AikAktevAj6 (Aik-Ak-tev-Aj-SIX)
Ephfeoc7 (Eph-fe-oc-SEVEN)
urfapDulm3 (urf-ap-Dulm-THREE)
rackVafasos9 (rack-Vaf-as-os-NINE)
RownotCict5 (Rown-ot-Cict-FIVE)

If you do not intend to view the pronounceable passwords, you may use the “-a” flag and add a “1? at the end, as shown below :

apg -a 1

The below would be an output after to run the command:

\+Nx9Hek`
G:89&2OO
uKHOwO-}%u
@q7GCi3Jh+
L5′S|eku

You may then configure other settings such as specifying the minimum length of the password (-min_pass_len) and the mode (-M), this helps you determine the types of characters allowed.

You may run ‘man apg‘ from the command line to check its documentation.

Affordable_Web_Hosting

Changing File Permissions Using cPanel Control Panel

How to change file permissions on a Linux Server ?

Permissions play a vital role in safe guarding your data over the world wide web. You can define the permissions according to your preferences based on the level of access you wish to offer to the users. As a part of security enhancement technique, you may sometimes need to protect the files from writing or editting. In that case the following tutorial may come in handy. The information would help you assign appropriate permissions to the files.

One of the simplest ways to assign permissions is via. cPanel File Manager.

The below steps must be followed for making the changes:

Step 1 – Go to File Manager in cPanel

Step 2 – Select the file to which you intend to assign permissions

Step 3 – Click the ‘Change Permissions’ link

Step 4 – Select the appropriate permissions

Step 5 – Hit the Change Permissions button

You may also refer the following video tutorial about File Manager. It should help you relate to the procedure well.

cPanel control panel is offered with all our Linux plans. If you need any assistance with changing the file permissions kindly raise a ticket from the client area stating your requirements in detail. Alternately you may contact our technical support department via. 24×7 Live Chat and seek assistance.

Web Hosting UK

Steps To Mount NTFS Partition In RHEL and CentOS version 5 or 6

The primary step for enabling NTFS Support for the CentOS Linux / RHEL edition 5.x and 6.x is to install the EPEL repository onto the server.
Use the below command to install EPEL repository in CentOS or RHEL versions

$ cd /tmp
$ wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
# rpm -ivh epel-release-6-5.noarch.rpm

What is NTFS-3G ?

NTFS-3G allows you to handle NTFS file systems of Windows OS variants with the needed safety. Its an open source POSIX read/write NTFS for your Linux installations.
It offers the capability to create, delete, rename, move files, directories, hard links, and streams. In-addition it also offers the ability to webmasters with read and write normal and transparently compressed files, that includes streams and sparse files. Special files such as the symbolic links, devices and FIFOs, ACL, extended attributes can be easily handled.

What is the process to Install NTFS-3G ?

You must be logged in as Root for the below command to work :

# yum install ntfs-3g

Checking the Name of an NTFS Partition

Entering the below commands would help you determine the name of an NTFS partition :
# fdisk -l /dev/sda
# fdisk -l /dev/sdb

Steps to Mount /dev/sda1 NTFS Partition at /mnt/ntfs

It is essential to load the fuse driver. The below command should help you do that :
# modprobe fuse

Now using the below command you must build a mount point:
# mkdir /mnt/ntfs

The following command would help you with mounting the ntfs partition :
# mount -t ntfs-3g /dev/sda1 /mnt/ntfs

Command for Unmounting the NTFS Partition

# umount /mnt/ntfs

Cloud Hosting Servers

Reconfiguring The Installed Debian Packages

Do you own a dedicated server running a  Debian or any other Linux distributions ? If yes, then you must be familiar with the command apt-get. People using Linux distributions like ubuntu server edition should know about such commands as these commands will help to make things easier.

Apt-get is a very usual command normally used to install and uninstall softwares. An example using the apt-get command is shown below:

# apt-get install packagename

Whenever a package or a software is installed on the server using the apt-get command, it holds default configuration files and when the package or software is in use it creates a different configuration file that includes custom information. In order to make it suit your requirements, you can adjust the configuration of that file manually. Most of the times, several situations will occur where you might make a mistake and due to that the software will stop functioning. In such case, if you have a deep knowledge about the file, you can fix the issue in the configuration file. This is the main reason why offsite backups are necessary whenever you make changes to any of your server files.

In case, if your forget to backup your files or don’t know how to fix the issue, you can always reconfigure the package. Reconfiguring the installed debian package will restore the original configuration when the package was installed. To reconfigure the installed package simply enter the following command:

# dpkg-reconfigure packagename

Using the above command will restore all the configuration settings. Once the restoration is completed the software installed on your uk web hosting server will start functioning properly however, the previous changes made to the configuration file will be lost.

« Previous entries Next Page » Next Page »