Home | Looking for something? Sign In | New here? Sign Up | Log out
Showing posts with label Server. Show all posts
Showing posts with label Server. Show all posts

Monday, September 1, 2014

How to Set Up Your Own Instant Messaging Server

Instant messaging is not just for personal use. It is also a great way for employees to communicate with one another in the corporate world. If you are in IT, then setting up an instant messaging server can be a great benefit to your company. And the best part is that you can set one up without spending a dime. In the following tutorial, I would like to guide you through the easy process of installing my personal favorite IM server software, Openfire.

Openfire is an open source IM server software that uses the Jabber protocol. This means that any IM client that supports jabber can connect to your server.
Step 1: Figure out which computer you want to make your IM server. The good thing is that Openfire uses very little resources. You can view the requirements here.
Step 3: Run the setup wizard.
Step 4: When the installation finishes, you will run Openfire for the first time. Click “Launch Admin” to bring up the configuration.
Step 5: Next, choose your language and click “Continue”.
Step 6: Now you will configure your server settings. The “Domain” will be what you want to call your Openfire server. Leave the default ports unless you would rather use something else.
Step 7: Next, you will be able to choose your database settings. For the easiest setup, choose “Embedded Database”.
Step 8: Next, you will choose how you want to control your users. If you have an LDAP server you can configure Openfire to work with it. For the easiest setup, choose “Default”.
Step 9: Next, you will set up your administrator account.
Step 12: Click on the “Users/Groups” tab to manage your users.
Step 13: Now go to another PC and install your favorite Jabber client. You can view a list of them here. You can connect to your new IM server by using the server name (domain) and ports you specified in step 6.
If you have any experience setting up an IM server please feel free to share.

How to Host a Web Site from Your Computer

In the following article I am going to show you how to host a web site from your own computer. Why would you want to do this you might ask? Well for one, it’s free. It’s also great for hosting small web sites or sharing large files with friends. However, if you are planning on running a site with high traffic I would not recommend this. Just follow these simple steps and you will have your own web server up and running in no time.

Step 1: Go to http://www.snapfiles.com/get/hfs.html and download HFS (Http File Server).
Step 2: Double-click the hfs.exe file that you downloaded. If you have Windows Firewall enabled you will be prompted with a security warning. Click “Unblock” to allow HFS to pass through the firewall.
Step 3: This is the tricky part. The default port that HFS uses is port 80. If your ISP blocks port 80 then you will need to change it to something else. To change it you must turn HFS off. You can do so by clicking the “On” button in the upper left corner. When you are done, turn it back on. If you are behind a router or firewall then you will have to set up port forwarding. If you need help with this go to http://www.portforward.com/. Here you can choose the type of router you have and then choose the program you want to set up port forwarding for such as Http File Server-HFS. It will walk you through the exact steps to set up forwarding.
Step 4: Now you can test your settings to see if they work. Go to the menu and click “Self Test”. If it is successful then your settings are correct. You should now be able to point your web browser to your IP address to see files or pages you are sharing.
Step 5: Now I’m going to tell you how to assign a domain name for your web site. Since you don’t have a DNS server running on your computer, you will need to get DNS service from somewhere else. To do this, we are going to use a service called DynDNS. DynDNS offers a variety of subdomain names to use for free for your website. Go to https://www.dyndns.com/account/entrance/to create a DynDNS account. Login with the account you have created and click on the services button. If you have a dynamic IP address that changes, click on “Dynamic DNS” and then “Add Dynamic DNS”. Choose a subdomain and domain name. Then add the host. Now you have a domain name that you can use and give out instead of your IP address. If you would like to use your own domain name, DynDNS offers a custom DNS service for this as well for a yearly fee.
Step 6: Now go to https://www.dyndns.com/support/clients/ to download the DynDNS Updater. This is to automatically update your Dynamic DNS account in case your external IP address ever changes.
Now you can host a web site from your computer. If you want to change the default page that comes up when you browse to your site, right click on the little icon that looks like a house in the Virtual File System. Click “Default file mask…” and type the name of the file that you want to be served when someone browses to your website such as index.html. If you would like HFS to start automatically when you log into Windows, put a shortcut to it under Start – Programs – Startup. Also be sure to save your Virtual File System settings so HFS will remember the files you are hosting next time you open it up. If you have any more questions check out HFS’s

Thursday, August 14, 2014

How to Install PHP on Windows

Hopefully, you now have a working local installation of Apache on your Windows PC. In this article we will install PHP 5 as an Apache 2.2 module.

Why PHP?

PHP remains the most widespread and popular server-side programming language on the web. It is installed by most web hosts, has a simple learning curve, close ties with the MySQL database, and an excellent collection of libraries to cut your development time. PHP may not be perfect, but it should certainly be considered for your next web application. Both Yahoo and Facebook use it with great success.

Why Install PHP Locally?

Installing PHP on your development PC allows you to safely create and test a web application without affecting the data or systems on your live website. This article describes PHP installation as a module within the Windows version of Apache 2.2. Mac and Linux users will probably have it installed already.

All-in-One packages

There are some excellent all-in-one Windows distributions that contain Apache, PHP, MySQL and other applications in a single installation file, e.g. XAMPP (including a Mac version), WampServer and Web.Developer. There is nothing wrong with using these packages, although manually installing Apache and PHP will help you learn more about the system and its configuration options.

The PHP Installer

Although an installer is available from php.net, I would recommend the manual installation if you already have a web server configured and running.

Manual Installation

Manual installation offers several benefits:
  • backing up, reinstalling, or moving the web server can be achieved in seconds (see 8 Tips for Surviving PC Failure) and
  • you have more control over PHP and Apache configuration.

Step 1: download the files

Download the latest PHP 5 ZIP package from www.php.net/downloads.php
As always, virus scan the file and check its MD5 checksum using a tool such as fsum.

Step 2: extract the files

We will install the PHP files to C:php, so create that folder and extract the contents of the ZIP file into it.
PHP can be installed anywhere on your system, but you will need to change the paths referenced in the following steps.

Step 3: configure php.ini

Copy C:phpphp.ini-recommended to C:phpphp.ini. There are several lines you will need to change in a text editor (use search to find the current setting).
Define the extension directory:
extension_dir = "C:phpext"
Enable extensions. This will depend on the libraries you want to use, but the following extensions should be suitable for the majority of applications (remove the semi-colon comment):

extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo.dll
extension=php_pdo_mysql.dll
extension=php_xmlrpc.dll
If you want to send emails using the PHP mail() function, enter the details of an SMTP server (your ISP’s server should be suitable):

[mail function]
; For Win32 only.
SMTP = mail.myisp.com
smtp_port = 25

; For Win32 only.
sendmail_from = my@emailaddress.com

Step 4: add C:php to the path environment variable

To ensure Windows can find PHP, you need to change the path environment variable. From the Control Panel, choose System, (then “Advanced system settings” in Vista), select the “Advanced” tab, and click the “Environment Variables” button.
Scroll down the System variables list and click on “Path” followed by the “Edit” button. Enter “;C:php” to the end of the Variable value line (remember the semi-colon).
PHP path environment variable
Now OK your way out. You might need to reboot at this stage.

Step 5: configure PHP as an Apache module

Ensure Apache is not running (use “net stop Apache2.2″ from the command line) and open its confhttpd.conf configuration file in an editor. The following lines should be changed:
Line 239, add index.php as a default file name:

DirectoryIndex index.php index.html
At the bottom of the file, add the following lines (change the PHP file locations if necessary):

# PHP5 module
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"
Save the configuration file and test it from the command line (Start > Run > cmd):

cd Apache2bin 
httpd -t

Step 6: test a PHP file

Create a file named index.php in Apache’s web page root (either htdocs or D:WebPages) and add this code:

<?php phpinfo(); ?>
Ensure Apache has started successfully, open a web browser and enter the address http://localhost/. If all goes well, a “PHP version” page should appear showing all the configuration settings.

Friday, August 8, 2014

PHP Connect to the MySQL Server

Use the PHP mysqli_connect() function to open a new connection to the MySQL server.

Open a Connection to the MySQL Server

Before we can access data in a database, we must open a connection to the MySQL server.
In PHP, this is done with the mysqli_connect() function.

Syntax

mysqli_connect(host,username,password,dbname);

ParameterDescription
hostOptional. Either a host name or an IP address
usernameOptional. The MySQL user name
passwordOptional. The password to log in with
dbnameOptional. The default database to be used when performing queries
Note: There are more available parameters, but the ones listed above are the most important.
In the following example we store the connection in a variable ($con) for later use in the script:
<?php
// Create connection
$con=mysqli_connect("example.com","peter","abc123","my_db");

// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>


Close a Connection

The connection will be closed automatically when the script ends. To close the connection before, use the mysqli_close() function:
<?php
$con=mysqli_connect("example.com","peter","abc123","my_db");

// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

mysqli_close($con);
?>

Technology News

Online Money

Review

Motor