What are the various runlevels in linux OS?

Following are the run-levels which you could refer:

0 — Halt

1 — Single-user mode

2 — not used (user-definable)

3 — full multiuser mode

4 — not used (user-definable)

5 — full multiuser mode (with an X-based login screen)

6 — Reboot

 

If you use a command line login screen, then you are in run level 3.

 

If you use a graphical login screen, you are operating in run level 5.

The default run level can be changed by editing the /etc/inittab file.

 

It contains a line near the top of the file similar to the following:

Id:5:initdefault:

Change the number in this line to the desired run level.

 

You will have to reboot the system for the changes to take effect.

How to create password protecting directories?

1) Create a .htaccess file and specify the following code in it,

 

AuthType Basic

AuthName “Administration”

AuthUserFile /home/support/.htpasswd

require valid-user

 

2) To create a passwd file, use the following .htpasswd generator.It should allow you to generate a

 

username /  encrypted password pair.

 

http://www.desilva.biz/apache/pwdweb.html

 

The .htpasswd file will contain your username(s) and encrypted password(s) and will usually look like this:

 

Christopher:En7Cr9pT2Ed/u

Mak3m0n3y

 

Place the .htaccess file in the directory that is to be protected.

 

And place the .htpasswd outside the directory that is to be protected.

 

Example:

If you want to protect a directory “blog” under a particular domain

then the .htaccess file should be placed in the “blog” directory and the .htpasswd

the file should be placed in the “html ” directory.

 

Note that all the directories that are created under the blog directory will also get protected.

 

 

 

And execute the command grpconv to rebuild the file.

 

You can now create the new account, without any error message.

How will I resolve the below database error?

There seems to have been a slight problem with the database.

Please try again by pressing the refresh button in your browser.

 

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

 

We apologize for any inconvenience.

 

For this login to your server as root user and check the following paths for MySQL. Sock

 

/var/tmp

/tmp

/var/lib/mysql/

/usr/local/lib/

 

If you don’t get it, please create it.

 

Please note that mysql. Sock is symlink.

How will you check and confirm that your server is using suPHP?

 

It’s very simple to verify this. Have a simple ‘php info’ script.

Create a file named ‘phpinfo.php’ under the public_html of your domain

Insert the following code:

<? php
phpinfo();
?>

Access the file in your browser using the link http://yourdomain.com/phpinfo.php

At the top section search the line ‘Server API’.
If you see CGI’ then your account is hosted on a server with suPHP.
If it shows ‘apache’ then you are NOT on a suPHP server.

PHP as an Apache Module?

When PHP runs as an Apache module, PHP files work under the Apache user/group known as “nobody”. For example, when a PHP file needs to write to another file or create/remove a file, it does so under the name “nobody”. In order to allow “nobody” to do this, you need to set specific permissions on the file/directory, such as 777 – which translates to read/write/execute by user/group/world. This is insecure because you have not only allowed the web server (Apache) to read/write to the file, you have also allowed everyone else on the server to read/write to the file as well!

Due to the above conditions, when a PHP file creates or uploads a new file to your account, the new file will be owned by the user “nobody”. If you FTP into your account, all files owned by “nobody” will not be available for you to move, rename or delete. In this case, the only way to remove the “nobody” owned files would be through a file on the server or to contact support and ask for the file ownership to be changed back to your username.

How to change SMTP server IP (Exim IP) on WHM server

Login to WHM

  • Click Exim Configuration Editor
  • Check the box next to:
  • “Send outgoing mail from the ip that matches the domain name in /etc/mailips (*: IP can be added to the file to change the main outgoing interface)”
  • Save Changes
  • Then edit the file /etc/mailips
  • from shell and add: *: #ReplacewithnewIP#
  • service exim restart

Login to Shell

  • Access the Exim configuration file:

nano /etc/exim.conf

  • Locate remote_smtp
  • The default setup will look like:

remote_smtp:
driver = smtp
interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch{/etc/mailips}{$value}{}}}{}}
helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_ho stname}}

  • Change to:

remote_smtp:
driver = smtp
interface = 12.14.12.14 # Change to your server IP address.

  • Save changes and exit.
  • Restart Exim

If there is an exim update when you upgrade your cPanel server you will need to re-enter the interface again.