Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, August 03, 2010

Install LAMP on Server CentOS 5.5

      LAMP is an acronym for a solution stack of free, open source software, originally coined from the first letters of Linux (operating system), Apache HTTP Server, MySQL (database software), and PHP, principal components to build a viable general purpose web server.

1. Install MySQL
# yum install mysql mysql-server
Adding MySQL to startup
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start
Create MySQLadmin User and Password
# mysqladmin -u root password YourPassSQL
# mysqladmin -h HostNameServer -u root password YourPassSQL
You can find HostNameServer on terminal console  [root@HostNameServer ~]#


2. Install Apache.
# yum -y install httpd
Adding Apache to startup, so it can automatic loaded if system restarted.
# chkconfig --levels 235 httpd on
# service httpd start
To check Apache has installed on server go to http://YourIPAddress/ and if you see as in the screenshoot that means Apache has been installed on your server.

If you get message "No Route To Host" that means you must open port 80 that still closed by firewall.
To open port 80 simply do this step:
# vi /etc/sysconfig/iptables
Add this command and save (to save press key "Esc" and then type ":wq")
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT
And then restart IPTABLES
# service iptables restart


3. Install PHP
# yum install php php-mysql php-mbstring php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
Restart Apache
# service httpd restart
To check php has been installed on server simply do following step:
# vi /var/www/http/php/index.php
and type following php code:
<?php
phpinfo();
?>
Save and go to http://YourIPAddress/php 
if php has been installed on your server, you will see a page like this:


DONE!!!
Now you can build a website on your server.

Monday, August 02, 2010

Install ptunnel on Server CentOS 5.5 for Tunneling via ICMP

      Ptunnel is an application that allows you to reliably tunnel TCP connections to a remote host using ICMP echo request and reply packets, commonly known as ping requests and replies. It is not a feature-rich tool by any means, but it does what it advertises. So here is what it can do:

  • Tunnel TCP using ICMP echo request and reply packets
  • Connections are reliable (lost packets are resent as necessary)
  • Handles multiple connections
  • Acceptable bandwidth (150 kb/s downstream and about 50 kb/s upstream are the currently measured maximas for one tunnel)
  • Authentication, to prevent just anyone from using your proxy
    

      PTunnel will not work in the condition that when an outgoing/incoming ping not allowed, or filtered by a gateway somewhere along the way. Also, it does not involve any congestion control. But a good thing is that it is open source and supports both Linux, Windows & Mac. For Windows, you will also need WinPcap.

There is the step for installing ptunnel 0.71:

ON SERVER

# yum -y install gcc*
# yum -y install libpcap*
# mkdir /tmp
# cd /tmp
# wget http://www.cs.uit.no/~daniels/PingTunnel/PingTunnel-0.71.tar.gz
# tar -zxvf PingTunnel-0.71.tar.gz
# cd PingTunnel
# make
# make install

On server  CentOS 5.5 32bit

# ptunnel &



On server  CentOS 5.5 64bit

# ptunnel > /dev/null 2 >&1 &


Open Port on Server (8000 or whatever it that will be used for tunneling)

# setup

and then choose Firewall configuration >> Customize

do as shown in the picture:



ON CLIENT

ptunnel -p ptunnel.example.org -lp 8000 -da ssh.example.org -dp 22

If you using ptunnel client on windows, make sure you copy ptunnel.exe to folder system32 before running that command on command prompt and WinPcap has installed on your system.

ON SSH CLIENT

Using PuTTY or Bidvise Tunnelier to login to your SSH.

Setting on SSH Client:
Host : 127.0.0.1
Port : 8000