Thursday, May 9, 2013

How to build a virtual web server and enable access from external network (Windows 8, CentOS 6, VMware Workstation)

I am faced with a task where I have to build a development webserver on a notebook, spesifically a Lenovo ThinkPad Twist (Intel Core i7, 8GB RAM, Windows 8 64-bit).
I would not use werbserver package such as XAMPP werbserver, PHPTriad, etc, to avoid incompatibility issues at the time of deployment later.
It means, I must build a pure web server environment, and for that I would use CentOS operating system.

Since the ThinkPad Twist already came with an original Windows 8, so I'm not going to use a dual-boot approach. The only way is to install CentOS virtual guest host on Windows 8 with VMware Workstation.

Concern that must be achieved are:
  • Host OS is Windows 8 64-bit 
  • Guest OS is Linux CentOS 6.4 Final 
  • Apache web server running on Guest OS
  • MySQL database server running on Guest OS 
  • The web server on Guest OS must be accessible from the Host OS 
  • The web server on Guest OS must also be accessible from the external network, for colaborative development needs. (Allows access to SSH, HTTP, and MySQL to Guest webserver) 

 I will explain how to make it, step by step:

Devices :  

  1. Lenovo ThinkPad Twist (Intel Core i7, 8GB RAM, Windows 8 64-bit) as the host, also installed VMWare Workstation 9.0 with 64-bit CentOS 6.4 as a guest OS that will act as a webserver. Let assume the IP address for this notebook is 
  2. Lenovo ThinkPad X100e (AMD Athlon Neo MV-40, 2GB of RAM, Windows 7 64-bit), act as the client computer that needs access to webserver. The IP address is


I'm not going to explain how to install CentOS guest OS, I assume you've understand how to install a guest OS in VMWare Workstation. Maybe, if there is some free time, I will write it in a separate article.

Once the OS has been installed in VMWare Centos, it is advisable to install VMWare Tools.
Next step, is to install the necessary packages:

Apache2 Webserver:
yum install httpd
chkconfig - levels 235 httpd on
/etc/init.d/httpd start

MySQL database server:
yum install mysql-server mysql
chkconfig - levels 235 mysqld on
/etc/init.d/mysqld start

yum install php
/etc/init.d/httpd restart

MySQL Support in PHP5:
yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc
/etc/init.d/httpd restart

Enable SSH daemon:
chkconfig - levels 235 sshd on
service sshd start

Let's make sure everything is going well:
[root@localhost ~]# service httpd status; service mysqld status; service sshd status
httpd (pid 2490) is running ...
mysqld (pid 2355) is running ...
openssh-daemon (pid 3760) is running ...

Then, try to direct your browser to http://localhost

Apache2 Test Page

NAT Settings: 

OK, next we will configure the NAT (Network Address Translation) in VMWare Workstation.
First, give a static IP on the guest OS. In this case, I give the IP address with Please write down the IP somewhere, we will need it later.

On VMware, choose Edit > Virtual Network Editor menu. In the dialog that appears, select VMnet8 adapter with external NAT connection, then press the NAT Settings button.

On NAT Settings, we will do some port forwarding. The principle, if there is a request to port XXX on the host OS, it will be forwarded (forwarding) to YYY ports in the guest OS.

We will forward some ports  as follows:
Host IP Port Guest IP Port 8888 80 3333 3306 2222 22

The final result will be like this:

Now back to the host OS (Windows 8), I open the browser, navigate to, and hooplaa... it works !
So how to access the webserver from external network? Simple, just point your browser to the IP address of the host computer and adding the port number that we've specified above. For example htpp://

For SSH access, use the IP address on port 2222
For accessing MySQL Databases remotely, use IP address on port 3333

OK guys, i hope this article will helps :-)
drop me ur comment

Sunday, May 5, 2013

CentOS : yum install problems - [Errno 14] Could not open / read file

Today I've just finished installing CentOS guest in VirtualBox for development server needs. As usual, the first thing I did was to install my favorite file editor / commander , the Midnight Commander (mc). But a strange thing happened when I tried to install mc:
[root@localhost ~]# yum install mc
Loaded plugins: fastestmirror, refresh-PackageKit, security
Loading mirror speeds from cached hostfile
 * Base:
 * C6-media:
 * Centosplus:
 * Extras:
 * Updates: ossm.utm.myfile :///media/CentOS/repodata/repomd.xml: 
[Errno 14] Could not open / read file :///media/CentOS/repodata/repomd.xml
Trying other mirror.file :///media/cdrecorder/repodata/repomd.xml: 
[Errno 14] Could not open / read file :///media/cdrecorder/repodata/repomd.xml
Trying other mirror.file :///media/cdrom/repodata/repomd.xml: 
[Errno 14] Could not open / read file :///media/cdrom/repodata/repomd.xml
Trying other mirror.Error: Can not retrieve repository metadata (repomd.xml) for repository: c6-media. 
Please verify its path and try again
After searching for the cause, I can solved this problem quite easy. First, edit this file :
[root@localhost ~]# vi /etc/yum.repos.d/CentOS-Media.repo
Find a line labelled "enabled=1", then change its value into "enabled=0" (without quotes). Save the file, and try to repeat the installation.
[root@localhost ~]# yum install mc
Loaded plugins: fastestmirror, refresh-PackageKit, security
Loading mirror speeds from cached hostfile
 * Base:
 * Centosplus:
 * Extras:
 * Updates:
Setting up Install Process
Resolving Dependencies-> Running transaction check---> Package mc.x86_64 1: El6 will be installed
-> Finished Dependency Resolution
Dependencies Resolved================================================== 
Package Arch Version Repository Size===================================
 mc x86_64 1: el6 base 1.6 M
Transaction Summary
Install 1 Package (s)Total download size: 1.6 M
Installed size: 5.4 M
Is this ok [y / N]: y

Downloading Packages:mc- | 1.6 MB 00:42
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: 1: mc- 1/1
  Verifying: 1: mc- 1/1Installed:
  mc.x86_64 1: el6
[root@localhost ~]#

Saturday, May 4, 2013

Huawei Mobile Partner for Windows 8

Huawei - Windows 8

The first problem I've experienced when trying Windows 8 for the first time is when I try to stick my HSDPA USB modem, Huawei E160E into my notebook and Windows 8 does not recognize it at all.

The problem is because the default driver inside the modem is not compatible with Windows 8. The solution is to upgrade the Mobile Partner's
software with the latest version (currently version UTPs). You can download it here

Done! My Huawei E160E now is recognized well by Windows 8!
This driver also compatible with any types of Huawei's modems.

Hopefully this can help you whom experiencing similar problems