interview question and answer

May 25, 2012

Test and Configure PHP installation on Fedora server.

Test and Configure PHP installation on Fedora server.

This step by step article show the configuration and confirmation of PHP module on Fedora Core operating system, please note that this configuration may vary base on the operating system and software version version.


1. Confirmation of the PHP installation.

[root@localhost ~]# rpm -q php
php-5.1.6-3
[root@localhost ~]#

Creating PHP information page.


1. Open the default DocumentRoot directory of Apache web server, usually under "/var/www/html/" using x-terminal.

open nautilus using x terminal

[root@localhost ~]# cd /var/www/html/
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# nautilus ./
[root@localhost html]#

2. Then create new empty file by right clicking on mouse button inside the html directory, then click on Create Document -> Empty File.

create empty text document

3. Then rename this empty file to test.php.

rename file test.php

4. Then open the test.php file using text editor, the figure below show that by right clicking mouse button on the test.php file you can choose your favorite text editor to edit the test.php file with.

open with text editor


5. By using your own choice of text editor, start edit and write the code below:
Note: "gedit" is the editor that show in figure below:

phpinfo();
?>

gedit text editor

6. Click save and exit the text editor.

Testing the PHP test.php page.


1. Click on menu tab, Applications -> Internet -> Firefox Web Browser to open web browser, then write http://127.0.0.1/test.phpin address field, then click Go to start browsing and display the PHP configuration.

PHP information page

2. If you see PHP Version 5.1.6 page, the PHP module are running and functioning on your web server, scroll down on the test.php page to view the all PHP configuration and information on the server site.

3. You can try to access the test.php using the same URL from client PC too.

4. Now the testing of installation and configuration of PHP completed :-) .

Note: If the blank page appear after you click go on the address bar, check the permission for the test.php file.

[root@localhost html]# pwd
/var/www/html
[root@localhost html]# ll
total 8
-rw------- 1 root root 22 Feb 24 20:30 test.php

Change the permission of the test.php file to be readable by all / world.

[root@localhost html]# chmod 755 test.php

Confirmation of the permission change.

[root@localhost html]# ll
total 8
-rwxr-xr-x 1 root root 22 Feb 24 20:30 test.php
[root@localhost html]#

The configuration of PHP file are located in "/etc/php.ini", you can edit the PHP configuration file manually.

Related:

Keywords: PHP installation, PHP configuration, PHP information, PHP information page, PHP page, display PHP information, testing PHP installation, php, fedora php.

Fedora Core Telnet, Rlogin and Ftp Server Configuration.


Setup and configure Remote Server on fedora core Linux, the step by step configuration focus on configure the Telnet, Rlogin and Ftp server.

Configure Telnet server


The step by step process of telnet server installation and configuration.

1. Insert and mount the Fedora installation cd rom or dvd.

[root@fedora ~]# mount /dev/cdrom

2. Go to the RPM directory.

[root@fedora ~]# cd /mnt/cdrom/RedHat/RPMS

3. Find the telnet installation package, and execute command below to start the installation process.

[root@fedora ~]# rpm –Uhv telnet-server-0.17-20.i386.rpm

4. Umount and the cd rom.

[root@fedora ~]# cd /
[root@fedora ~]# umount /dev/cdrom

Auto start telnet server.


Execute the command below to make sure that the telnet server is automatically start upon the boot up of your Fedora server.

[root@fedora ~]# /sbin/chkconfig --level 35 telnet on

Confirmation of automatic start

[root@fedora ~]# /sbin/chkconfig --list telnet

Test the connection to telnet server


Execute command below to connect to your telnet server, please change the ip address to your telnet server address.

[root@fedora ~]# telnet 193.0.0.13

Red Hat Linux release 7.2 (Enigma)
Kernel 2.4.7-10 on an i686
login: kimura

Password:
Last login: Fri May 17 15:07:38 on :0
[kimura@RedHatA kimura]$

Other setting


[root@fedora ~]# vi /etc/securetty

pts/0
pts/1

[root@fedora ~]# less /etc/issue.net
Red Hat Linux release 7.2 (Enigma)
Kernel \r on an \m

Rlogin


Rlogin Installation


[root@fedora ~]# mount /dev/cdrom
[root@fedora ~]# cd /mnt/cdrom/RedHat/RPMS
[root@fedora ~]# rpm –Uhv rsh-server-0.17-5.i386.rpm
[root@fedora ~]# cd /
[root@fedora ~]# umount /dev/cdrom

Setting of automatic start


[root@fedora ~]# /sbin/chkconfig rlogin on
[root@fedora ~]# /sbin/chkconfig --list rlogin //Confirmation of automatic start

Execution of rlogin


[root@fedora ~]# rlogin 193.0.0.13

FTP Server (File Transfer Protocol)


Installation


[root@fedora ~]# mount /dev/cdrom
[root@fedora ~]# cd /mnt/cdrom/RedHat/RPMS
[root@fedora ~]# rpm –Uhv wu-ftpd-2.6.2-5.i386.rpm
[root@fedora ~]# cd /
[root@fedora ~]# umount /dev/cdrom

Setting of automatic start


[root@fedora ~]# /sbin/chkconfig wu-ftpd on
[root@fedora ~]# /sbin/chkconfig --list wu-ftpd /
[root@fedora ~]# man ftpaccess

Configuration file Ftpaccess


[root@fedora ~]# less /etc/ftpaccess

deny-uid %-99 %65534- //User who prohibits access,/etc/passwd, 099 65534-65535
deny-gid %-99 %65534-  //Group which prohibits access,/etc/group,
allow-uid ftp
allow-gid ftp

guestgroup ftpchroot  //Specification of guest group
// The root directory is changed to the home directory
// Ftpchroot does not exist in initialization
// Example of /etc/group 
// ftpchroot:x:1000:kimura
// Group ID of ftpchroot adds user kimura as 1000
              
class all real,guest,anonymous *     
//Specification of user class
//real (Real user), guest (User who belongs to guest group), anonymous(Anonymous user)
// * (Host's address and domain name)

email root@localhost
loginfails 5     
// Frequency by which log in can be retried
// The server cuts the connection when failing in log in five times

readme README* login  
// readme File name Timing by which content of file is output   
readme README* cwd=*   
// Immediately after login, All directories

message /welcome.msg login
message .message cwd=*

compress yes all   
tar yes all
// Compression by compress,
// The permission of the archive by tar is specified for the class

chmod no guest,anonymous  //Guest group,Anonymous user
delete no anonymous
overwrite no anonymous
rename no anonymous

log transfers anonymous,guest,real inbound,outbound 
// Forwarding, Direction of forwarding, It is both in default

shutdown /etc/shutmsg   
// Specification of file which describes shutdown schedule
// It is possible automatically to make, and to delete with ftpshut and ftprestart

Keywords: configure telnet, configure rlogin, configure ftp, fedora core ftp server, fedora core rlogin server, fedora core ftp server, telnet server, rlogin server, ftp server, setup telnet, setup rlogin, setup ftp, Linux Remote Server.



Step By Step Ubuntu 9.04 (Jaunty) LAMP Server Setup

Step By Step Ubuntu 9.04 (Jaunty) LAMP Server Setup

In around 15 minutes, the time it takes to install Ubuntu Server Edition, you can have a LAMP (Linux, Apache, MySQL and PHP) server up and ready to go. This feature, exclusive to Ubuntu Server Edition, is available at the time of installation.The LAMP option means you don’t have to install and integrate each of the four separate LAMP components, a process which can take hours and requires someone  who is skilled in the installation and configuration of the individual applications. Instead, you get increased security, reduced time-to-install, and reduced risk of misconfiguration, all of which results in a lower cost of ownership.New pre-configured installation options have been added to the Ubuntu Server. Mail Server, Open SSH Server,Samba File Server, Print Server, Tomcat Java Server,Virtual Machine Host and Database Server options join existing LAMP and DNS options for pre-configured installations, easing the deployment of common server configurations.

Ubuntu LAMP server Install the following Versions
Ubuntu 9.04 (Jaunty Jackalope)
Apache 2.2.11
Mysql 5.1.30
PHP 5.2.6-3
First you need to download server version of Ubuntu version from here after that create a CD and start booting with the CD Once it starts booting you should see the following screen in this you need to select your language and press enter
Now you need to select “Install Ubuntu Server” and press enter
Select your language and press enter
Select your location and press enter
If you want to try to have your keyboard layout detected by pressing a series of keys you need to select yes option.If you want to choose from a list click no
Select Origin of keyboard and press enter
Select keyboard layout and press enter
Detecting hardware to find CD-ROM Drivers in progress
Loading additional components in progress
Detecting Network hardware in progress
Configures the network with DHCP if there is a DHCP server in your network
Enter your server Hostname
Clock setup is in progress
Starting up the partitioner in progress
You have to partition your hard disk in this example i have selected use entire disk option.If you want to do manually you can choose manual option and press enter.Make sure you have swap partition in place
Warning message about data lost on your hard disk
Write the changes to disk here you need to select yes and press enter
Creating ext3 file system in progress
Installing base system in progress
You need enter the Full name of the user you want to create for your server in this example i have created ruchi user select continue and press enter
Enter your user account name here
Entered the password for ruchi user select continue and press enter
Confirm password for ruchi user
If you choose weak password this will prompt similar to the following screen
If you want to configure encrypted private directory select yes and press enter
Configuring the package manager select continue and press enter
Configuring package mirror this will be related to your country option
Select how do you want to configure automatic update press enter
Now it will start Installing software and here you need to select the server options here i have selected as LAMP for our LAMP server installation.If you want to select each package separately select “Manual package selection” option (This is new in jaunty server)
At the time of software installation it will prompt for mysql server root password enter root password of your choice and select continue
Confirm mysql server root password and select continue
Software installation is in progress
Installing GRUB Boot loader in progress
Finishing installation in Progress
Installation complete message here you need to remove your CD select continue and press enter it will reboot your server
After rebooting you can see the following screen prompt for username
This will complete the Ubuntu Jaunty LAMP Server Installation and your server is ready for installing applications which supports apache,mysql and php.
One more new feature i really like was after logging in it shows you system stats like CPU,Memory,Disk,Swap,No.of processes,No.of users logged in and no.of security updates available
Configuring Static ip address in Ubuntu server
If you want to install vim editor use the following command
sudo apt-get install vim-full
Ubuntu installer has configured our system to get its network settings via DHCP, Now we will change that to a static IP address for this you need to edit
Edit /etc/network/interfaces and enter your ip address details (in this example setup I will use the IP address 172.19.0.10):
sudo vi /etc/network/interfaces
and enter the following save the file and exit (In vi, ESC, then ZZ to save and exit)
# The primary network interface
auto eth0
iface eth0 inet static
address 172.19.0.10
netmask 255.255.255.0
network 172.19.0.0
broadcast 172.19.0.255
gateway 172.19.0.1
Now you need to restart your network services using the following command
sudo /etc/init.d/networking restart
You need to setup manually DNS servers in resolv.conf file when you are not using DHCP.
sudo vi /etc/resolv.conf
You need to add look something like this
search domain.com
nameserver xxx.xxx.xxx.xxx