Showing posts with label centos. Show all posts
Showing posts with label centos. Show all posts

Saturday, March 10, 2012

Testing Webserver (httpd) at VirtualBox

Now, my challenge is to browse websites hosted in CentOS which is running in a VirtualBox window. Already installed httpd, php, mysql, perl etc. and they are working fine. I could manage to test a script using text based web browser lynx.

Now, I am going to try from host pc using graphical browser. I'll have to define a ip address at guest CentOS then try to browse it.

Before starting, I have to change network settings of virtual box for CentOS installation. I changed it at virtualBox>Settings>Network>Attached to, choose "Host-only Adapter" then clicked "Ok". Now it's ready for doing the rest.

I forgot the way how to change ip, searching, but finding nowhere. What happened!! Better keep searching my notes of my B.Sc networking classes. I don't know where to find them. Wow, I have found those notes, but they are about Red Hat, I have to make them useful for my current CentOS.

Yeah, I can now browse hosted files from guest pc. Let me tell what I have done:

First, I have checked virtual host-only network ip address of host pc.
Then, I have edited ip address of guest "centos" by the following command prompt codes:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

pressed "i" for inserting text into the script, started from at end of the lines there. Added these following lines:

BOOTPROTO=static
IPADDR=192.168.56.5
NETMASK=255.255.255.0
GATEWAY=192.168.56.1

For your information 192.168.56.1 is the ip address of host-only network card (virtual).

Then restarted network by the following command prompt code:

service network restart

Then, went to my graphical browser at host, and got the default centos-apache page. And also could browse my hosted files.

Friday, March 9, 2012

Real approach to install php/mysql on linux-apache web server

Hi, I have just found out that working on lampp in linux is not a real approach of working on PHP based software development. Recently, I need to use some multimedia encoder/decoders to compile some of my scripts, but lampp could not help me. We usually use lampp to install the whole working environment fast and in one click, but when we need some extra things to be included with this, it may not help and consume time to start.

I am using CentOS to make a real web server (for test scripts), it has a nice built in package manager YUM. I have already installed "Apache 2" for creating web server. It was easy and fast, apache (httpd) comes with centOS disks as default. I used the following line to install it.

yum install httpd

Then, I had to install php, php command line, perl, mysql to make the server ready for lamp development environment. This installation process required Internet connection and I used following line to install the whole thing.

yum install php php-cli mysql

It automatically searched all dependencies and the mirror from which they will be installed.

I didn't check the environment yet, but hope, it will help me fine.

Tuesday, February 28, 2012

Installing XAMPP/LAMPP in Linux

For Ubuntu:

Start Terminal.

If you have already updated you apt repository then enter write "apt-get install lampp" in terminal and press enter. XAMPP will be installed automatically.

But, if you don't have updated apt repository, then write "apt-get update" in terminal and press "Enter".

Sometime it becomes difficult to install software from Bangladesh. For solving this problem go to "System Settings" from start menus. Then, go to "Software Sources" from Settings menus. Click "Ubuntu Software" tab. change the source of Download from "Download From" drop-down filed. Choose Main Server to avoid problem of online software installation using "apt-get". Don't forget to update apt by writing "apt-get update" at terminal and pressing enter.

For CentOS:

First check if your "wget" command is installed for the system. If not, login to terminal as root and then write "yum install wget" and press enter. Then press y and enter to approve installation of "wget".

Then, download installation file for XAMPP.
write "wget http://www.apachefriends.org/download.php?xampp-linux-1.6.8a.tar.gz" and press Enter, installation file will be stored in current file directory.

After the download is complete, install XAMPP using the command: tar xvfz xampp-linux-1.6.8a.tar.gz -C /opt

If you want to start XAMPP at the start of the machine Command the following commands:

lvl=`egrep :initdefault: /etc/inittab|cut -d: -f2`

cd /etc/rc.d/rc${lvl}.d

ln -s /opt/lampp/lampp S99lampp

ln -s /opt/lampp/lampp K01lampp


Starting, Restarting or Stopping XAMPP Server:

First go to root directory: cd /

Then for starting XAMPP server: opt/lampp/lampp start

for re-starting XAMPP server: opt/lampp/lampp restart

for starting XAMPP server: opt/lampp/lampp stop