Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Tuesday, July 29, 2008

Remote access to the server

Recently, I just learn how to remotely access to the server that located at Jaring data center. This could save time to go over there to do some minor thing such like restart services or apache.

I use an SSH server for Windows called something like WinSSHD, or something like that. Then I SSH in to the server using the Free software called as Putty.exe SSH client. In fact we can use Putty to set up tunnels for tunneling RDP and VNC through it. Then I SSH into the server and use the command line:

httpd -k restart

-or for previous version 2.2.x
apache -k restart

To restart the httpd service, in order to refresh the setting, i edited at php.ini
We can also kill apache with kill apache.exe or kill httpd.exe

We use sambar server for the mail server. It allows you to set up some rules that for example when an email with an exact line of text is placed in the body and/or subject line and is sent to a certain email address, it executes a script. Some .bat files need to be created to executed based on the rules in order to run the program smoothly, it is safe because someone would have to KNOW what the email address was, what the exact text was to execute these bat files. Further, you can lock these down with other rules such as the origin of the email, it must be from a certain sender.

Combine that with excellent spam and spoofing controls in sambar, it is a safe way to remotely restart my server, for example, by simply sending an email.

Beside these, you could shut the server down, bring it back online, what ever you like this way. But that being said, SSH is very secure.

Wednesday, April 16, 2008

Short and pertinent of title tags

Title tag is the description that appears on the top of the browser of your site, it is one of the most important factors determining the search engine results position.

<title>A Collection of PHP Website </title>

Sometimes, we can see part of the website repeat the common mistake such like using mismatch title with their website contents, this might make your website to be listed at whois as less relevancy of your title and your website contents.

Therefore, a good title tag should be short about 4 to 6 keywords long and pertinent to the content inside the page. To learn more about this, by simple choose a few good website and view source to know more the best ways of the naming of your title tag.

Setup a 301 Redirect

301 permanent redirect is a way to redirect from one webpage to another that is most efficient method and search engine friendly way for redirecting your website. you can perform the redirecting for some reason such like.

1. redirect an old website to a new address .
2. redirect to omit (www. ) or include (www. ).
3. setup several domains pointing.
4. beauty a URL structure change.

The basic example of the script such like single page redirect.

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.com/page.html");
exit();
?>



Include www. redirect

<?php
if (substr($_SERVER['HTTP_HOST'],0,3) != 'www')
{
header('HTTP/1.1 301 Moved Permanently');
header('Location: <a href="http://www.">http://www.'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'</a>]);
}?>


It is fun and interesting tips for your redirect webpages process.

Monday, November 19, 2007

How to copy HTML links with firefox

The solution for this problem can be found in Firefox extensions that allow you to copy HTML links on the fly; meaning that they enable you to copy simultaneously the link text and HTML, and once you paste it you will already get the HTML code ready to go.

The most used extension for this purpose is called CoLT. Basically you will need to right click on the link you want to copy, move the mouse over “Copy Text Link and Location As,” and then select “HTML Link.”

I have used it for a while, but I don’t link the fact that I need to go through two sets of menus. It adds one unnecessary step to the process.

Friday, November 16, 2007

What is XML?

There are a big knowledge about XML, and if you are web-programmer, you probably know that.

XML stands for Extensible Markup Language. Basically, it is a markup language created to transport structured data across different systems and platforms. There is an article over W3C titled “XML in 10 Points,” which gives an introduction to this language. The 10 points are:
  1. XML is for structuring data.
  2. XML looks a bit like HTML.
  3. XML is text, but isn’t meant to be read.
  4. XML is verbose by design.
  5. XML is a family of technologies.
  6. XML is new, but not that new.
  7. XML leads HTML to XHTML.
  8. XML is modular.
  9. XML is the basis for RDF and the Semantic Web.
  10. XML is license-free, platform-independent and well-supported.