• We Recommend Cheap Web Hosting Seller for lowest cost hosting.

You can use mod_rewrite. You’d create an .htaccess with the following content

RewriteEngine On

# Http to https
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] 

This should redirect ALL your http traffic to https. This does require that you have mod_rewrite installed. You also may want to hardcode your site url where %{HTTP_HOST} is incase HTTP_HOST is empty in the headers.

ls -l === This Will List All Files/Directories In Your Current Directory
ls -al === Lists All Files & Information
ls -alR === Lists All Files & Information In All SubDirectories
cd === Changes Directory
clear === Clears The Screen
cp [oldfilepath] [newfilepath] === Copies File From A Directory->Another
cp -r [oldpath] [newpath] === Copy folders
rm [filepath] === Removes A File
rm * === Removes All Files In A Directory
rm -rf [directory-name] === Removes all files AND subdirectories
mkdir [dirname] === Creates A New Directory
mv [oldfilepath] [newfilepath] === Moves A File/Directory
ln -s [oldfilepath] [newfilepath] === Create a symbolic link
wget http://domain/file.ext === Download a file from a remote server
reboot === Reboot the server
vi [filename] OR pico [filename] OR nano [filename] === Edit a file
ps -x === Show your background processes
du -sh [directory] === Shows a human readable summary for the size of a directory

[cmd] | grep [string] - this will parse all of the output from [cmd] and show only the lines that contain [string], very useful for machines with lots of processes when you only want to find one. ie: ps -ax | grep named … this would show the process entry for the dns server.

pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout. All the criteria have to match. For example,

pgrep -u root sshd

will only list the processes called sshd AND owned by root.
On the other hand,

pgrep -u root,daemon

will list the processes owned by root OR daemon.

pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout.

Compression
unzip [filepath.zip] === Unzips A .ZIP File
tar -xvf [filepath.tar] === Untars A .TAR File
gzip -d [filepath.gz] === Ungzips A .GZIP File
tar -xvjf [filename.tar.bz2] === Extract A .tar.bz2 File

Permissions
0 = — No Permission
1 = –X Execute-Only
2 = -W- Write-Only
3 = -WX Write & Execute
4 = R– Read-Only
5 = R-X Read & Execute
6 = RW- Read & Write
7 = RWX Read, Write & Execute

You Need To Set This On Files For
Owner - The File Owner
Group - People On The Server
User - Everyone

Its normally best if you want to keep a file really secure, to keep Group as “0″ to stop people on the server from looking/changing it!

System Information Commands

du === Shows Disk Usage
netstat === This Tells You Who Is Connected To The Server + Hostname
netstat -n === This Tells You Who Is Connected To The + IP
kill === Kill A System Process
top === Gives You System Information (e.g. Processes, RAM usage etc)
ps === Shows Currently Running Processes
ps U [username] === Shows Currently Running Processes By A User
last === Tells You The Last User To Login

Have you ever wondered how most forums you visit enable custom tags? Well, the answer lies here. Your input is replaced using the eregi() function before / after it is added to the database.

2‘, $message);
$message = eregi_replace(’([i](.+)[/i])’, ‘2‘, $message);
$message = eregi_replace(’([u](.+)[/u])’, ‘2‘, $message);

// Output the message
echo $message;
?>

Now that you have seen the code, you will be wondering, how does it work? how can you add your own unique tags? Well, we can do this as easily as anything!

eregi_replace('([u](.+)[/u])', '2‘, $message);

The above has taken 3 inputs. They are listed below.

Pattern - ‘(\[u](.+)\[/u\])’

This defines what you are searching for. You can see the tags here are backslashed. [u] is what it is required to be in order to process it sucessfully as [ and ] are regarded as special characters for searching. Lets imagine we want to use [strike] [/strike]. This input must be regarded as ‘(\[strike](.+)\[/strike\])’.

Replacement - ‘ <u>\2</u>’
Now, we need to define the tags that we want to replace it with. <u></u> are shown here. But there will be something that may confuse you, " \2 " . In our string that means "put whatever was between the two BB style strike tags here".

$message
This is what we want to replace! So lets put our nice new tag and apply it to the code we showed you earlier!

2‘, $message);
$message = eregi_replace(’([i](.+)[/i])’, ‘2‘, $message);
$message = eregi_replace(’([u](.+)[/u])’, ‘2‘, $message);
$message = eregi_replace(’([strike](.+)[/strike])’, ‘2‘, $message); 

// Output the message
echo $message; 

?>

To enable php error reporting on a server that does not have it registered by default, create an .htaccess file in your working directory with the following contents:

php_flag display_errors on

That’s it! Now, your domain will report all php errors even IF the server your working on doesn’t report them by default.

Some Definitions

A Domain Name is a human language representation of an IP address.

An IP Address is what every computer on the internet uses to address itself to the other computers on the the Internet (using the network protocol called TCP/IP. IP (v4) Addresses look like 123.123.123.12

When someone types in a domain name like www.domain.com, their browser communicates with a series of root domain name server that act as a dictionary and provides the IP address associated with that domain name. Then the browser can use that IP to communicate to the server that the website is hosted on.

TLD (or Top Level Domain) is the last part of a domain name… the com, net, org, two letter county domains, and the several other TLDs out there.

SLD (or Second Level Domain) is the most human readable part of the domain name. In a domain name like www.domain.com, domain is the SLD. An SLD can have any alphanumeric character in it (a-z, 0-9), dash or minus ( - ), and underscore ( _ ). But it cannot have spaces between characters.

Sub-Domain (also called third level domains) are technically called Canonical Domains (or CNAMEs) for short. Sub-Domains are like having an extra domain name and can be almost anything you like. In a domain name like subdomain.domain.com, subdomain is the sub-domain. It works the same as a regular domain name.

A-Records (or Address Record) is the basic and most important DNS record. A-records point to an IP address. Your short domain name (without the www), NS, and FTP should have A-records. Subdomains sometimes have A-Records too. A-records can point to any IP-address.

CNAME-Records (or Canonical Domains) include subdomains and Aliases, CNAMEs are used to point to a domain name or to a file in a domain. However, CNAMEs should always point to an A-record, not another CNAME. It is a common practice to create a CNAME for www and for subdomains that are actually hosted by your domain. CNAMES can also be used as temporary aliases to point your domain to another domain.

Note: when pointing a CNAME, always put a period after the domain (ie: ftp -> CNAME -> domain.com.)

MX-Records (or Mail Exchange) point to the name of an email server and holds a preference number for that server. MX-records must point to an A-record or in some situations an IP-address.

Example DNS Record:

Host Name          IP Address/URL          Record Type

@                  123.123.123.12          A-Record
www                domain.com.             CNAME

ftp                123.123.123.12          A-Record
mail               123.123.123.12          A-Record
ns1                123.123.123.12          A-Record
ns2                123.123.123.13          A-Record
subdomain1         domain.com.             CNAME
subdomain2         domain.com.             CNAME

MX-Record: mail -> domain.com. -| Preference = 10

@ is short domain (domain.com)
Put period after domain name

Related Link: Auto Insurance Guide

Advertisement

The benefits of online learning are open to every one. There are hundreds of sites offering online training as well as study guides regarding latest courses like 640-863 as well as 350-018. The helping materials about Microsoft exams such as 70-554 are also accessible online. These online courses and exams not only benefit students from all over the world but also help the working people. As employees of any web hosting firms providing reliable services of domain hosting and domain parking can improve their services through passing these exams and can offer more steadfast backup along advanced hosting plans.