Creating custom 404 page

Everyone at some point has been browsing trough google or their favorite search engine and clicked on a link just to go into a white page with the words ???404 Error??? up on top. After this the only thing you have is to hit the ???Back??? button on your browser. As a user, this means that you go backand try another link. As a developer do, it means that you lost a potential clients, and that you have a glitch in ξyour application that you are not aware of.

You can set upt a custom 404 page using your apache .htaccess file. Here is how to do this:

  1. Access your server via FTP
  2. Make sure that you can see hidden files
  3. Locate for .htaccess
  4. If .htaccess does not exist go ahead and create it
  5. Open the file
  6. Type: ErrorDocument 404 /404.php
  7. Save the file
  8. Now you can go and edit this file so that you can have a custom error page.

That is all that you have to do in order to set up your server to have a custom 404 page. Use your imagination on this one, for examle you can have a search function or related pages to what the user was looking for. You can also have this page email you so that you become aware of the situation.

Hope this helps, any questions or concerns can be submitted below.

Shell or SSH Commands and Beginner 101 Course

Using Shell or SSH connection to interact with your Linux server could be the most powerful tool you can have. This is because when you connect via this interface you are actually working from inside your server and this gives you more power and control over whatever you are doing.

To start off you need to contact your server provider and tell them that you want shell access enabled in your account. Some companies like goDaddy use telephone to confirm, others ask you to fax or email a copy of your drivers license. Most of them will have one way or another to do this.

After this you will need to get a telnet application like Putty which is Freeware by the way. Once you download this open it and enter your web address in the input box then click connect. It will ask you for your username and password, they are usually the same as your main hosting account credentials. After this you are good and it, very simple correct.

This interface looks like your regular MS-Dos Command Prompt, and don’t be scared it is very simple to use. Here is a list of commands to get you startes

  • pwd
    • Show you the directory you are in
  • ls
    • Shows you the files that are in your current directory
  • ls -al
    • Shows you all the files in the current directory with file permissions, sizeξmodificationξdate, owner and group names and name
  • cd /directoryname
    • Changes current folder to a new destination
  • df
    • Gives you a report of free space
  • rm {file}
    • Removes a File
  • rmdir /directoryname
    • Removes an empty Directory
  • rm *
    • Removes all non-protected files in your current directory
  • rm -r
    • Removes all non-protected files in your current directory and sub folders using recursion. Protected files will ask you for permission
  • ftp {ftp address}
    • Connect to an FTP server
  • get {filename}
    • Dowload a file from the ftp connection
  • put {filename}
    • Upload a file using the ftp connection
  • cp {filename} {newdir}
    • Copy a file into a new directory
  • cp * {newdir}
    • Copy all files from current directory into a new directory
  • cp *.txt {newdir}
    • Copy al .txt files into a new directory
  • vi {filename}
    • Opens the basic text editor and opens the file
  • mv {filename} {newdirectory}
    • Moves the file(s) to a new directory
  • mkdir {newdirectory}
    • Creates a new folder or directory
  • mkdir -p {directory1}/{directory2}/{directory3}
    • Creates multiple nested folders in one shot
  • who
    • Tells you who is connected to your server
  • cat /proc/meminfo
    • Shows your system’s available memory
  • history
    • This command will give you the last 10 commands you entered

This is just a list to get you started. Shell access is the only way that you will have complete control over what you and your applications are doing. You will be able to do much more from there so start geting used to it. There will be a series of tutorials that I will create about using the Shell Command Line so come back to check on us, my next Shell entry will be a tutorial in how to transfer files the right way, and without even using yourξbandwidth.

Please leave any comments or questions below.

Thank You,

Gilberto Cortez

Creating Private Name Servers using Plesk

Have you ever wondered how the hosting companies are able to give you one name server of their own for all of your domains? By doing this they allow the client or the user to just be able to their domain registrar and submit that name server, instead of having the client register their own ones for every domain. An example of private name servers is how RackSpace does this, it tells you to point all of your domains to ns.rackspace.com and ns2.rackspace.com instead of doing ns.mydomain.com and ns2.mydomain.com??_ Get it???

Here is what you will need in order to complete this:

  1. Dedicated server with Plesk installed on it
  2. Domain to use as master name server
  3. Access to that domain registrar

Here are the steps that you will need to do in your server in order to set your Private Name Servers:

  1. Log into your Plesk server
  2. Create a new account for the domain you will be using for your global private name servers
  3. Once created, got to DNS Setting
  4. Click on ???Add Record???
  5. Record Type = A, On Enter Domain type ???ns2??_ , on enter IP address type in your secondary IP address (It???s usually one more than your original server IP. If your server ip is 61.55.25.1 then your secondary IP will probably be 61.55.25.2)(Configuration varies with provider)
  6. Click OK
  7. Click on ???Add Record???
  8. Record Type = NS, On Enter Domain Name type ???ns2??_ , on Enter Nameserver type NS2.MYDOMAIN.COM (Where Mydomain.com is replaced by your chosen domain)
  9. Click OK
  10. On your DNS Settings landing page there should already be records for NS.MYDOMAIN.COM, double check. If they do not exist follow the above steps, just replace NS2 with NS.
  11. Once you complete the steps, make sure you have at least 4 records, 2 for NS.MYDOMAIN.COM and 2 for NS2.MYDOMAIN.COM
  12. On your main menu, click on Settings
  13. Click on change Host Name, and where it states Full Hostname enter your chosen domain and click OK
  14. From your server???s home page select DNS Settings. Click on the default NS settings and click on it.
  15. Where it states Enter Nameserver, enter NS.MYDOMAIN.COM, click OK
  16. Click on Add DNS Record and on the Enter Nameserver, type NS2.MYDOMAIN.COM. Record type will be NS.
  17. Server configuration is complete.

After setting your server up, all you need to do is go to your Domain Registrar, and using the Domain Manager register those two name servers and point them to your domain.

Now every time you set up a new domain it will have NS.MYDOMAIN.COM and NS2.MYDOMAIN.COM as name servers. Now you can give this to your client or go to your domain registrar and just change name servers without having to register them again.

??????

Get yourξSan Diego Website Design at a reasonable price. Services include: Web Development, Website Design, iPhone Development, Mobile Development, Cloud Application Development among others.

error

Enjoy this blog? Please spread the word :)