interview question and answer

Showing posts with label Fedora. Show all posts
Showing posts with label Fedora. Show all posts

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.



Fedora Core DNS Server using BIND


Setting and configure BIND as and Domain Name Sever (DNS) on Fedora Core Linux machine.

1. DNS (domain name system)
Correspondence of IP address and hostname
The  /etc/hosts file example

# IP Address Hostname Alias
127.0.0.1 localhost
192.168.42.1 apple www
192.168.42.2 desk desk.domain.cxm

Installation of BIND


BIND (Berkeley Internet Name Domain)

[root@tenouk ~]# mount /mnt/cdrom
[root@tenouk ~]# cd /mnt/cdrom/RedHat/RPMS
[root@tenouk ~]# rpm –Uhv bind-9.2.0-8.i386.rpm
[root@tenouk ~]# rpm –Uhv caching-nameserver-7.2.1.noarch.rpm
[root@tenouk ~]# cd /
[root@tenouk ~]# umount /dev/cdrom


Setting of client and server


edit the resolf.conf file to enable the client or server to find the DSN server.

[root@tenouk ~]# vi /etc/resolv.conf
search kimura.com
nameserver 10.10.0.235

Definition of IP address of DNS server which client uses

Setting the DNS server.


[root@tenouk ~]# vi /etc/named.conf
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
// The following code is added
zone "kimura.com" IN {
type master;
file "named.kimura.com";
allow-update { none; };
};

zone "0.10.10.in-addr.arpa" IN {
type master;
file "named.10.10.0";
allow-update { none; };
};

include "/etc/rndc.key";


[root@tenouk ~]# cp /var/named/named.local /var/named/named.10.10.0
[root@tenouk ~]# vi /var/named/named.10.10.0

$TTL 86400
@ IN SOA jmtist20.kimura.com. root.jmtist20.kimura.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS jmtist20.kimura.com.

235 IN PTR jmtist20.kimura.com.
236 IN PTR compaq.kimura.com.


[root@tenouk ~]# cp /var/named/named.local /var/named/named.kimura.com
[root@tenouk ~]# vi /var/named/named.kimura.com

$TTL 86400
@ IN SOA jmtist20.kimura.com. root.jmtist20.kimura.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS jmtist20.kimura.com

IN MX 10 jmtist20.kimura.com

jmtist20 IN A 10.10.0.235
compaq IN A 10.10.0.236

Start BIND service


Start, stop and restart the named service.

[root@tenouk ~]# /etc/rc.d/init.d/named start
[root@tenouk ~]# /etc/rc.d/init.d/named stop
[root@tenouk ~]# /etc/rc.d/init.d/named restart

or

[root@tenouk ~]# /sbin/service named start
[root@tenouk ~]# /sbin/service named stop
[root@tenouk ~]# /sbin/service named restart

Setting automatic start for named on runlavel 3 and runlevel 5..

[root@tenouk ~]# /sbin/chkconfig --level 35 named on

Confirmation of automatic start.

[root@tenouk ~]# /sbin/chkconfig --list named

Confirmation of bind.


Use the command example below to test your DNS server functionality.

[root@tenouk ~]# ping 10.10.0.235
[root@tenouk ~]# ping 10.10.0.236
[root@tenouk ~]# ping jmtist20
[root@tenouk ~]# ping compaq
[root@tenouk ~]# ping jmtist20.kimura.com
[root@tenouk ~]# ping compaq.kimura.com
[root@tenouk ~]# nslookup jmtist20.kimura.com
[root@tenouk ~]# nslookup compaq.kimura.com
[root@tenouk ~]# nslookup 10.10.0.235
[root@tenouk ~]# nslookup 10.10.0.236

Note:
SOA - Start of authority
NS - Name server
A - Address record
PTR - Pointer record
MX - Mail exchanger

Keywords: configure dns, setup dns, setup bind, linux dns server, fedora core dns server, setup dns server, fedora Bind server, fedora dns server.

Linux Windows Computer Technology Install Setup Linux Network Configuration Troubleshoot Linux Unix Linux Classes Linux Training