CentOS 5.2 Setup

raspgiantsneckServers

Dec 9, 2013 (3 years and 4 months ago)

157 views


CentOS 5.2

Setup

Install CentOS to support The FOG Project

and
Joomla

CMS
!


This document will step you through the CentOS installation and
configuration process required to support running

FOG or

Joomla!


Dwayne Trouille

2/19/2009


2


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

Table of
Contents



Introduction





3


Installation Process_____________________________________________________________


3


First Login a
nd Applying Update
s
______________________________________________


7



Enable the Apache Web Server, MySQL Server and FTP Server


8


Adding the ATrpm Repository to YUM on a CentOS
5.2


8


Adding the DAG Repository to YUM on CentOS 5.2


8


Add and Update re
quired services and modules_________________________


9


Edit the PHP.ini file to Enhance Site File Management

10


MySQL Admin Password and Database Management

10


Installation of PhpMyAdmin

11


Configuring PhpMyAdmin

12


Using the PhpMyAdmin Web Console

1
2


Secure Access to your PhpMyAdmin Directory_________________________________

14


Configure VSFTP Server

15


Create a

PHPINFO Page

16


How to use php

i

17


Verify Joomla!

requirements are met

17












3


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

Install CentOS 5.2 to host

FOG 0.25 and

Joomla!

1.5.9


Coming from a Windows and Apple background it took some serious work to figure out how to use
Linux as a
FOG and/or
Joomla!

server. While working with Linux I found it very helpful to utilize the
Gnome Desktop where possible or even necessary for u
s amateurs
, therefore you will find a mixture of
using the Gnome Desktop in conjunction with Terminal Console commands
.


This document will step you through the process of building a Linux server with the required
modules
and services to support

FOG or

J
oomla!
. Afterwards,

you will

manually configure additional services
required for
Joomla!

or FOG

to operate correctly. Once your server is ready, the process of installing
and configuring
FOG or
Joomla!

is provided within a separate document depending on
your goal.


Before moving on you need to understand this document will not

cover ever
y possible issue when
setting up

a
FOG or
Joomla!

server, but should get you up and running in a reasonable amount of time.
Anyone that has dabbled in Linux knows the doc
umentation is usually written by
tech
-
geeks that skip

the steps they
assume everyone should know.
This
document will hopefully fill many of those gaps to
help Linux amateurs like myself

(Tech
-
Geek wanna be)
.


CentOS is the free version of
RedHat Enterpris
e Linux. You will not find the name
Redhat anywhere
within this Operating System
until you run a

command to find the version number
. Therefore, anyone
that has ever used Redhat RPM’s will find they work just fine in CentOS, just make sure the RPM you
dow
nload is designed to work with RedHat Enterprise version 5.x.

Note: RPM stands for
R
edHat
P
ackage
M
anager.


Installation Process

1.

Download the CentOS 5.2 ISO file from
http://www.centos.org/
. Note: you will need to
be
aware of what type of computer you are installing the CentOS. Your typical Intel 32bit
processors will use the ins
talls found in the i386 listing while 64bit use x64.

2.

Create a CentOS installation DVD using the ISO file just downloaded. Most basic pack
ages of
CD/DVD burning software will burn an ISO to Disc but if for some reason yours does not, go
download
the free version of Deepburner from
http://www.snapfiles.com/reviews/Deep
Burner/deepburner.html
.

A DVD burner is required.

3.

Once the install DVD has been burned, start
up
/boot
-
up

your computer
using

the DVD. Most
modern computer
s

are capable of starting up from a bootable CD/DVD but each computer is
different and I can’t expla
in how to get this working if your computer doesn’t boot from the
DVD automatically. If you have a problem look at your BIOS setup options and owners
manual.

4.

A menu page will display installation choices.
Choose to install CentOS in Graphical Mode by
pre
ssing
enter
.

5.

Skip

the CD

Media
Testing screen.

Note: Testing your media is a good idea, and should be
done at least once to ensure the integrity of your install.

6.

The first screen simply provides a link to release notes, click
Next

to continue.

7.

Set the ap
propriate
language

and click
Next
.

8.

Choose
the correct

keyboard language

for you system and click
Next
.

9.

A
n

Install CentOS or Upgrade option may appear if the computer you are using has a previous
version of CentOS already installed. If CentOS has never bee
n installed you should not see this
option. If this screen appears, choose
Install CentOS

and
Next
.

10.

Partition your Hard Drive by choosing “
Remove all

Partitions on selected drives and create
4


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

default layout


and click
Next

as shown below
.




11.

Do not

che
ck the Review an
d modify partitioning layout. Just c
lick
next
.

12.

A

Warning
will appear that you have chosen to remove all partitions,
select
Yes
.


13.

At the Network Devices Screen,
select Edit.

14.

Leave the
Enable IPv4 Support

checked, choose the
manual configura
tion options
, then type
an
IP Address

and
Netmask

that’s accessible on your network.

Note:
By default both IPv4 and IPv6 are enabled. If like most
,

you will not have an IPv6
address so you should be able to uncheck the box for IPv6 to disable its feature.

15.


Click
OK
.



16.

While still in the Network Devices screen
you may
set the hostname of your server. This
c
ould
be the Fully Q
uali
fied Domain N
ame

(FQDN)

if
you intend t
o access using the internet. If

the
server will only be used internally you may leave i
t at the default setting.

17.

In the Miscellaneous Settings
,

if not using DHCP assign a Gateway, Primary and Secondary
DNS
, then click
Next
.

18.

Choose the
Time Zone

region

and

leave the “
System clock use UTC
” checked then

click
next
.

It is important that Time Zo
ne and Date/Time be accurate for
Joomla!

to operate correctly.

19.

Set
root password

and
write it down somewhere

for use later
.

Click
Next
.

20.

At the

Software Repository
screen

choose

Customize now
” located at the bottom,

then
click
N
ext
.

21.

The following screensh
ots display a custom application selection proven to support a
FOG or
J
oomla!

installation.


5


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

L
inux Distributions already include the
A
pache webserver,
M
ySQL, and
P
HP
applications

(
LAMP
),

required by
FOG and
Joomla!
. Therefore, simply add the MySQL and Apa
che
Webserver during the resources

step. However, review

the options for MySQL and Webserver
to ensure

you
find and select all PHP and
MySQL plugins
.

If not sure, do not uncheck any
options only add options as recommended here.







Leave GNOME to provide a GUI



Add Emacs. R
emove Games

& Office Productivity







Add Development Libraries

& Tools









Select FTP, MySQL,





and Legacy Software Development


Web Server

& Legacy Network Server





For the Servers Repository select MySql Database then choose Optional Packag
es and check
mod_auth_mysql,
php
-
mysql

and qt
-
mysql
. Select Web Server and add any Optional Packages
that tie in
PHP or MySql. My install had all PHP and MySQL packages enabled by default.

For FOG servers
, also select Legacey Network Server and add optional packages tftp (trivial
File Transfer Protocol) and xinetd.











6


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

Sel
ect Administration Tools, Java, Legac
y

Software Support, System Tools,

and
X Window System


Leave Virtualization, Clustering and Cluster Storage at default, unchecked.

Now select
Next
.

The installation will check for dependencies then

you will be prompted to click
next

to begin
installati
on.


22.

Once the installation is complete
, remove your DVD and

select the
Reboot

button.




23.

After the
server reboots a setup agent will
load

and a Welcome screen will appear. Select
Forward
.

24.

By default Firewall

is enabled, but should be disabled especiall
y on a test server
.
Select
Forward

and a
t the warning prompt simply choose
Yes

to over
-
ride the existing firewall.

25.

At the
SELinux

Screen select
Disabled

and then Forward. At the warning prompt select
Yes

to
reboot your system after firstboot to relabel s
ystem files.

26.

When the Kdump screen opens you can choose to enable or not enable Kdump.
If your server
is only used for testing and is very slow it’s best to not enable kdump.

27.

In the Date and Time Screen s
et correct
date/
time
. By default it will display
time in a 24hour
format or often called Military time.
Remember that 0100
-
11:00 is AM and 12:00
-
23:00 is PM.
Therefore, for example 13:00 = 1:00pm while 01:00 = 1:00am.




7


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

28.

While still in the Date and Time Screen select the Network Time Protocol Tab and
E
nable
Network Time Protocol
.
Notice below the NTP Servers list you have advanced options.
Expand this and check Synchronize system clock before starting service and uncheck Use Local
Time Source. This is the best way to ensure your server time is set co
rrectly which is very
important when using
Joomla!
.

Click Forward.
Note:
Internet Access
is required

as it will
contact an NTP server to synchronize time.



29.

In the Create User Screen provide a username and password that can be used to access this
serve
r without Administrative rights

then click
Forward
.
You can always logon as root in the
event you need quick admin access or use the su command
from a terminal console

to
accomplish administrative tasks.

30.

At the Sound Card screen simply

click
Forward

since

a server typically does not require audio.

31.

The Addition CD’s screen provides you the option off adding addition software but for a simple
Joomla!

Server you do not need to add anything more at this point. Simply click the

Finish


button
,

answer the rebo
ot prompt
by clicking

OK

and the server will restart.


First Login

and A
pplying

Updates

1.

Once the startup process is complete you will be given a login prompt for the gnome desktop.
To make configuration easier l
ogin as username

root

with password assigne
d during
installation
.

However, if you’re a stickler for using the best security practices go ahead and
login as the user created without root privileges knowing you will need to su root at various
stages to complete tasks, but I will not be explaining wh
en that is necessary.

2.

One of the first things you’
ll want to do is run updates. You may notice an informational
balloon displaying at the top right of your Desktop stating
“U
pdates
A
vailable

. Go ahead and
select “View Updates” which launches the Package

Updater, then click “Apply updates” before
going any further.
Note:

You may run updates form a Termin
al Console using the
yum update

command,

which seems to be faster, but for now the Package Updater will do fine.

Just know

all updates required followi
ng this first time update will be
explained using

the YUM command.


3.

Following Dependencies check you’ll

get an “Import key?” prompt
. C
lick
Import Key
.

4.

Once updates are complete you will
be prompted to restart, choose
Reboot now
.

8


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

Enable

the
Apache Web Ser
ver,
MySQL Server
,
FTP Server

and TFTP Server


Using

Gnome Desktop GUI to enable required services.




Go to System


Adm
inistration


Services and select the Background Services Tab.



Locate then check the httpd service and click Start.



Locate then check the

mysqld service and click Start.



Locate then check the vsftpd service and click Start.



Locate then check the xinetd service and click Start

(FOG Only)
.



Close the Service Configuration and choose to Save the Changes.


Optionally,

use a Terminal Console to
S
top, Start
, Restart and set
services
to Auto
Start:



From Gnome Desktop select Applications > Accessories > Terminal



Type,

service httpd stop

or
service httpd start

or
service httpd restart

or

chkconfig httpd on



Type,
service mysqld stop
or

service m
ysqld start
or

service mysqld restart

or

chkc
o
nfig mysqld on



Type,
service vsftpd stop
or

service vsftpd start
or

service vsftpd restart

or

chkconfig

vsftpd on



Type,

service xinetd stop
or

service xinetd start
or

service xinetd restart
or

chkconf
ig xinetd on



TFTP can only be set to auto start so Type,

chkconfig tftp on

(FOG Only)


Note
: If you do not see any one of the above services then you forgot to check it during the CentOS installation.
They can be easily added from the Gnome Desktop by s
electing Applications > Add/Remove Software then browse
to Servers and select eith
er FTP Server, MySQL Database,

Web Server

or Legacy Network Server,

depending on
which is missing.

Or open a Terminal console and
type
yum install vsftp.i386
, mysql
-
serv
er.i
386, httpd.i386 or
tftp
-
server.i386
depending on which server your need,

then press enter.


Adding

the ATrpm Repository to

YUM on a CentOS
5.2

It’s sometimes necessary to look at a different Repository for files need in Linux Servers. The
standard CentOS

repository will not have all files required for Joomla! to run correctly therefore
you need to add addition yum repositories to the yum configuration file that do have the needed
files. The listing below explains how to add the ATrpm repository to your
yum config file.



Open a Terminal Console from Desktop by selecting Applications > Accessories > Terminal



Import
ATrpms' signing key

using
:


rpm
--
import
http://ATrpms.net/RPM
-
GPG
-
KEY.atrpms



While in Ter
minal Console
use a
cd /etc

to change to the etc folder

and use the gedit utility to edit
yum.conf
file
by using the following command syntax:
gedit yum.conf




Copy and paste the text below at the end of the text in the yum.conf file, then save the chang
es.

[atrpms]

name= CentOS
-
$releasever
-

ATrpms

baseurl=http://dl.atrpms.net/el$releasever
-
$basearch/atrpms/stable

gpgcheck=1

gpgkey=http://ATrpms.net/RPM
-
GPG
-
KEY.atrpms



From the Terminal Console r
un
yum update

and notice ATrpms repository is listed as a mi
rror site.

Adding the DAG Repository
to

YUM on CentOS 5.2

The DAG repository is a collection of RPM add
-
on’s that can be added to various Linux
distributions update services. CentOS comes with YUM (
Y
ellow dog
U
pdater
M
odified)

a
package manager now used i
n all redhat version
s. Since not all RPM add
-
ons are

provided
through the CentOS or Redhat Repositories, it is beneficial to add the DAG Repositor
y to
your YUM Configuration

as an additional repository search location for RPM’s.

Unlike the
ATrpms reposit
ory you will only need to install the rpmforge rpm.

9


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.


The following will explain how to install DAG on your CentOS server using both command
line or the GUI Desktop interface.




Find and download the most current version of rpmforge from
http://dag.wieers.com/rpm/packages/rpmforge
-
release/



For CentOS 5.2, I used the Redhat Enterprise Linux 5 version for i386 file named
rpmforge
-
release
-
0.3.6
-
1.el5.rf.i386.rpm



The rpm can be download from a linux terminal using

the command


wget
http://the_full_path
, or you can download using the Gnome Desktop and Fi
refox
browser.



Install the rpm using this example replacing the filename with the one you downloaded
rpm

ivh rpmforge
-
release
-
0.3.6
-
1.el5.rf.i386.rpm

or if using the Gnome Desktop
s
i
mply download using the Fi
refox browser and double
-
click
the rpm file.



On
ce the install is complete run
yum update

from a terminal console
and notice the
rpmforge

repository is listed on the Mirror search list.



Add and update required services and modules

Update

and install

the vital
module
s

required for
Joomla!

to run correc
tly by using the command
syntax listed below from a Terminal Console. To open a Terminal Console go to Applications >
Accessories > Terminal. You will see a command line displayed similar to that seen in DOS. From
the Terminal

Console use the following
command syntax to update and install required modules.


1.

Check for and install any PHP, MySQL and Apache updates using the following:

>
yum update php

>
yum update mysql

>
yum update httpd


2.

Install

the Libmcrypt file by running
:


>
yum search libmcrypt

(
This
causes YUM to search for libmcrypt
)

>
yum install libmcrypt.i386

(This will install libmcrypt.i386)

When prompted for approval to download package, type y and press enter.


3.

Install the
php
-
eaccelerator, recommended if

you install the Joomlawiki.

> yum ins
tall php
-
eaccelerator.i386


When prompted for approval to download package, type y and press enter.

>

service httpd restart

(restarts the apache web server)


4.

Install and enable the Graphics Library for PHP, GD Library by using the following command:
>
y
um install php
-
gd



When prompted for approval to download package, type y and press enter.

>
service httpd restart

(restarts the apache web server)


5.

Install ffmpeg for video convertion capabilities. Only needed with Joomla! if wanting to
distribute v
ideo files.
Not required for FOG
.

>
yum install ffmpeg.i386

10


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

6.

Php
-
mbstring
will be required when

installing PhpMyAdmin

for MySQL database management.

>

yum install php
-
mbstring

If you have problems getting yum to install Php
-
mbstring you can download
the RPM

from the

CentOS website but
it must

matc
h the Php
-
common version
. Install the RPM using the
following syntax: >rpm

i rpm_name_here.rpm


Edit the PHP.ini fil
e to
Enhance Site File Management

for Joomla!

(Not required for FOG)


1.

To e
dit the php.ini file
open

the

Computer icon on the

Gnome De
sktop and navigate

to
Filesystem/
etc
then locate and double
-
click the
php.ini

file.

If you cannot open the php.ini file
using that method then open a terminal console, navigate to
/etc
, type

the command

gedit
php.ini


which should open the php.ini file in the gedit text editor.

2.

Open the php.ini file (double
-
click) then locate the
post_max_size=8M

and change to
20M
.

Tip:

To find these entries quickly
,

select the Find button at the top of the gedit page, enter
post_max_s
ize then click find. Repeat for the next entry.

3.

Locate the
upload_max_filesize=2M

and change to
4
0M
.

4.

Locate the
max_execution_time = 30
and change to
300
.

5.

Locate the
max_input_time = 60
and change to
120
.

6.

Locate the
memory_limit = 16
M
and change to
50
M
.

7.

Locate the
post_max_size = 8M
and change to
40M


8.

Save and close the php.ini file
.

9.

R
estart the httpd (Apache) service to force a php
.ini

reload using the Services in Gnome or the
following command from a Terminal Console: >
service httpd restart



MySQL Ad
min Password

and Database Management

(If building FOG server skip this)

Before creating a database for

your Joomla! installation, it’
s important to change the default
MySQL password. The reason is that by default the password is blank and anyone with MySQ
L
knowledge will know this and your database can easily be compromised.


The following steps will take you through creating a new MySQL password and how to create a
database from the command line. However, you may find it much easier to create the datab
ase with
a utility call PhpMyAdmin explained just below these steps. The choice is yours but make sure to
change the MySQL password in this section before moving on to installing the PhpMyAdmin
application that follows.


1.

The default settings for MySQL ser
ver admin access is through the MySQL Admin user account
root with a blank password. This is not very secure, therefore a password needs to be set using
the following command syntax from within a Terminal console:

m
ysqladmin

u root password
NEW_PASSWORD_
HERE


2.

Test your new password by using the following syntax to login as sqladmin:

m
ysql

u root

p

Upon pressing enter you should be prompted for a password.


3.

Now that you are in MySQL with Admin privileges
you may
create a new database using the

following syntax

unless you plan to use PhpMyAdmin covered later.

c
reate database
database_name_here
;

The ending semi
-
colon is required.

Example:

create database joomla01
; (This will create a database named joomla01)

11


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

4.

To see your databases from the com
mand link use the following command and notice
below is
an

example of what you will see
in the screenshot
.


show databases;



5.

While logged in as MySQL Admin
you may
create a new mysql user and password for your
new database using the following syntax

unle
ss as mentioned earlier you plan to use
PhpMyAdmin.

CREATE USER ‘
username
’@’localhost’ IDENTIFIED BY ‘
password_here
’;

Note: Do not put spaces between the username and host information or between the
hyphen and the semicolon at the
end. Spaces only go betw
een word
s listed in bold. This
syntax is not case sensitive.


6.

Now
you may
grant the user privileges to the new database using the following syntax:

GRANT ALL PRIVILEGES ON my_database.* TO
‘user
name
’@’localhost’
IDENTIFIED BY ‘
user
_password’ WITH GRANT OP
TION;


7.

To leave the MySQL Admin simply type exit and press enter.


Installation of PhpMyAdmin

(Optional for FOG server)


PhpMy
Admin makes the task of creating

databases and database users easy by providing a web
based Management Console to complete the ver
y same tasks just used for creating a database and
assigning user privileges.

While almost a necessity for Joomla! it’s optional for FOG.


1.

Before installing PhpMyAdmin ensure the php
-
mbstring module was installed earlier. If not
sure simply run the follow
ing command form a Terminal Console:

>
yum
install

php
-
mbstring

(Answer any prompts during the install)


2.

On your server use the Firefox browser and go to
http://www.phpmyadmin.net/

then download
myphpadmin versi
on 2.11.9.2 or earlier for your server. I downloaded the tar.gz version but it
really shouldn’t matter which you choose.
At the time of this document revision the current
version of PhpMyAdmin was 3.0, however it requires PHP version 5.2. The CentOS 5.2

installation comes with PHP version 5.1.6 and therefore the reason you should download
phpmyadmin version 2.11.9.2 or earlier. As a recommendation you may want to download the
version that is for “English only” since the file is smaller.

3.

The MyPhpAdmin

tar.gz file will download to the Gnome desktop, so simply double
-
click to
auto
-
launch File Roller a GUI untar utility.

4.


Click the Extract button in File Roller.


12


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

5.

In the Extract in folder list choose other, then navigate to Filesystem/var/
www/html/ (Double
-
click to open
), then select open. Now select
“All files”

under the Files list and
“Re
-
create
folders”

under Actions. Now click the Extract button.
Note: Tar files are suppose

to r
etain
their permission

and therefore the correct permissions for PhpMyAd
min should have been
applied at the time of extraction.

6.

Navigate to the newly created PhpMyAdmin directory by opening the Computer icon on the
Desktop then navigate to /Filesystem/var/www/html and find the PhpMyAdmin folder that will
be named similar to yo
ur tar file. Next, right
-
click the new phpmyadmin directory and rename
to something a little easier to remember such as phpmyadmin.
Note:

Keep in mind files in
Linux are case sensitive and if you add capital letters you will need to remember when
accessi
ng via a web browser.

Tip:

While in the www folder right
-
click the html folder and
choose Make Link, then drag the link out to your Desktop since you will be visiting this location
many more times.

7.

From Terminal Console go to /var/www and use chown

R a
pache html to ensure apache has
ownership of phpmyadmin folder and files.


Configuring


Php
MyAdmin

(Skip if using with FO
G server. No mysql password required
)


PhpMyAdmin is setup by default to log into a standard MySQL server installation, but since you
have changed the MySQL Admin password adjustments have to be made to the PhpMyAdmin
config.inc.php file. To correct this perform the following:


1.

Assuming

that you’
re
still

in

your phpmyadmin folder simply
open and find the
config.sample.inc.php file.

2.

Now
copy the config.sample.inc.php file so that you have a backup.

To copy use a right
-
click
and choose copy then right
-
click again and choose paste.

3.

Rename the config.samle.inc.php file to config.inc.php.

Remember to use right
-
click,

then
rename,

much easie
r.


4.

Open

(double
-
click),

and edit the config.inc.php. Look for the following lines:

/*Authentication Type*/

$cfg[‘Servers’] [$i] [‘auth_type’] = ‘cookie’;


Change above line to:

$cfg[‘Servers’] [$i] [‘password’] = ‘
mysqladmin password here
’;



Note:

Typ
e your new password in place of
mysqladmin password here

leaving the
apastrophe’s
.


5.

Save and close.



Using the PhpMyAdmin Web Console

(Not necessary for FOG but allows database viewing)

PhpMyAdmin allows you to easily create, edit and view MySQL databases

and users.


1.

On Server o
pen Firefox and type in localhost/php
my
admin then press enter
.

2.

Look in the blue column to the left and find the database created from command line should be
listed unless you skipped that step.

13


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.



3.

C
reate

a new
Joomla
database
in

the

phpmyadmin console

by locating the field Create new
database and typing in a new database name, then click the create button.
A message stating:
“Database your_database_name has been created”.
Note:

S
ome
Joomla
forums have
recommended keeping the name

down to four characters

but

I have not experience issues

with
larger filenames
.

4.

Find and select the Home button that has an icon of a house. You should now see your new
database in the list of databases.

5.

While in PhpMyAdmin create a user

account that has

privi
le
ges to your new database by first
selecting you
r

database which in
my example
s named joomla01.

6.

Once the database has been selected locate the
P
rivileges
T
ab

at the top right and select.

Note:
If you
created
a user when going through the mysql comm
and line instructions earlier, you will
find that user account already listed in the
users list
.

7.

If you don’t see an option to Add User in the center of the page look to the right
and
if pre
sent
choose

Open ne
w

PhpM
yAdmin window

. For
some
reason this wi
ll allow you to see all
users and provide you the Add a new User option.

8.

Select

Add a new User


then i
n the Login information category
, provide a name for this new
user, you may leave Host set to

Any ho
s
t

, and provide a password.

9.

In the Database for use
r categ
ory leave set to


None

.

10.

In the Global privileges choose all Data and Structure privileges

but no Administration.
. It is
easiest to select the
Check All

then
uncheck all the Administration privileges
.

Once the
privileges are set
find and click the

Go button at the bottom right of screen.

11.

Notice a message stating “You have added a new user” should be displayed.

12.

To verify
the new user has been assigned privileges to a database,
select that database and
choose privileges again
for a listing of users
.


14


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

13.

Notice, the new user does not have All Privileges or the Grant right.
Note:

If later you wish to
give this user additional privileges
,

simply locate the edit option under the

Action


Column
and you will be allowed to adjust privileges just as when crea
ting the user.


Secure Access to your PhpMyAdmin Directory

The configuration just provided for PhpMyAdmin setup can leave your database wide open for
someone to destroy. One method to limit access to the PhpMyAdmin directory is through use
of
.htaccess
.
The following will provide a quick run through on how to setup .htaccess on the
phpmyadmin directory only.


1.

At server using the desktop go to /var/www/html/phpmyadmin unless you chose a
different name and path.

2.

Right
-
Click inside the phpmyadmin directory a
nd select Create Document > Empty File.

3.

Open the empty file paste the following text inside and edit only the bolded area.


AuthName "
Secure Area
"

AuthType Basic

AuthUserFile
/path/to/your/directory/
.htpasswd

require valid
-
user


Note
: You may change Secure

Area to anything, such as Members Only. The
AuthUserFile path must start from root to your actual file, so on a CentOS server it
would be /var/www/html/phpmyadmin/.htpasswd


4.

Save your changes and once file is closed, rename

file as

.htaccess

5.

Right
-
Click
inside the phpmyadmin directory and choose “Open in Terminal”.

6.

From the terminal type
htpasswd
-
c .htpasswd
username
(username should be the
name of a user you wish to give access to the phpmyadmin directory.)

7.

Once you have pressed enter you should be pro
mpted for a password and then again for
a confirmation.

8.

The

dot in front of these two files make them invisible or hidden as system files. To
view them in terminal type
ls

al

then press enter and they will show in a list with
ownership and permissions di
spayed.

9.

To ensure permissions are set correctly for each file run the two following commands:


chmod 644 .htaccess


chmod 644 .htpasswd

10.

Now use your desktop and go to Computer > Filesystem > etc > httpd > conf and
double
-
click the
httpd.conf

file.

11.

Click th
e find button and search for .htaccess.

12.

Next find the statement AllowOverride None and change to
AllowOverride All
.

13.

Save the changes.

14.

Restart your Web Server through either System > Administration > Services or from a
terminal using the command
service htt
pd restart

15.

Now go to a browser and access your phpmyadmin page again and if all is set correctly
you should be prompted to login. Remember to use the username and password created
in the .htpasswd file.




15


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

Configure VS
FTP
Server

(Not a requirement for FO
G but may come in handy later)

Even though VSFTP is already installed and running
, you still have not given any users access to
login or directed the FTP server to your eventual location of the
Joomla!

server. The following
process will ensure the Joomla
web directory will be accessible through FTP.


1.

First create a FTP user for
joomla!

using the following example:

1.

From Terminal type
useradd
ftpuser

(This creates a user named
ftpuser
)

2.

Type
passwd
ftpuser

(This prompts you to assign a password)

2.

On

the
Ce
ntOS
open the Computer icon found on the Desktop

and

navigate

to
the vsftpd folder
at
Filesystem
/etc/vsftpd

3.

Op
en the
ftpuser
s

file
using a double
-
click if using the Desktop or type gedit/ftpusers from the
terminal console. C
omment
out root by placing a #

in front
the username

if you want root to
have FTP access

then save
.

Note:
This list determines which users are not allowed to login via
FTP

and any user you wish to use FTP cannot be listed here
.

Generally, security dictates that
you do not use root un
less absolutely necessary, therefore this is why it is not allowed FTP
access by default.

4.

Using the same method as
i
n step 3, o
pen the
user
_li
st

and make sure

the user account created
earlier is listed here

then save
. In my example a user called
ftpuser

w
as created and should
have been entered in this file. For root to have FTP access you would need to have root listed in
this list as well.

5.

Open the
vsftpd.conf

file and add the following lines

at the bottom
:

u
serlist_deny=
N
O

(This syntax is case sensiti
ve. Must be lower
-
case)

l
ocal_root=/var/www/html/

(This syntax is case sensitive. Must be lower
-
case).



Note 1:
This is the path
you intend to place your

joomla!

files

which in my example is at the
root of your web

directory

(html)

instead of within i
t
s own folder
.

If

you

choose to place

your
joomla!

files in a folder within the root web directory called joomla, your location would be
/var/www/html/joomla


Note

2
:

If you plan to setup a Moodle Server with a Unified login provided from your
Joomla!

user

database
,

you will
want

to place all the
Joomla!

files on the root web directory instead of
in a folder at the root web. This is because later you will be required to place a Moodle
subdirectory within your
Joomla!

web and it’s much easier to figure out
the path.




6.

Restart the FTP Server
to apply changes
using either the Desktop option or Command line
option

as shown below
:



Desktop: System > Administration > Services > VSFTP, then restart.


Command line:
service vsft
pd restart








16


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.

7.

Test your FTP se
rver by using either of the following methods:


Method 1
-

Open any Web browser and type
ftp://username@server_hostname_or_IP_Address



Once prompted for a password supply and you should conn
ect to your server.

Method 2
-

Download an FTP Client such as CoreFTP LE from
http://www.coreftp.com/
. Open


CoreFTP and enter your FTP site hostname or IP Address, the username created



earlier and password. If all went well you gained access to your www root through


ftp.


8.

If you see the PhpMyAdmin folder your FTP Configuration is correct.


Create a PHPINFO Page

(Not required for FOG but very informative)

A Phpi
nfo file is just that, a listing of your PHP configuration including all additional modules
displayed in a graphical web page layout. This
verifies PHP is setup and running properly plus
displays what components are installed and enabled.


To
build a PHPI
NFO page you will

create a file in any basic text editor
. Add

the single line entry of
<?

p
hpinfo(); ?>
, then name the file phpinfo.php and
save

inside your
Joomla!

or web
r
oot folder.
Once in place you can use any web browser to open the phpinfo.php whi
ch should display all
services
PHP

is configured to use.

See below for detailed instructions.


Here’s how it’s done from the Server Desktop:


1.


Go to Computer > Filesystem > var > www > html.

2.


Using your mouse, right
-
click inside the html folder and choose


Create Document

> Empty
File
”.

Note: If you plan to install
Joomla!

in a sub
-
directory within html then create your
phpinfo file there instead.

3.

Name the empty file
phpinfo.php

then press enter to save.

4.

Open the empty
phpinfo.php
file (Double
-
Click).

5.

Add

the following line of text

and save
: <?

phpinfo(); ?>




Note
, I got this to work using the following
combinations

as well:

<?phpinfo() ?>

and



<? phpinfo() ?>

6.

Right
-
Click withi
n

the html folder and choose “Open in Terminal”, now type the followin
g
command:
chown apache phpinfo.php

Press enter to execute.

Note: This changes the owner from being root to being apache so that the web service can
execute the script and display the results in a web browser.

7.

On the server, open Firefox and enter the
following URL:
http://localhost/phpinfo.php

You
should see a listing of your PHP Version, Build Date and much more.

Note: You can also access this from any client computer by replacing localhost with the serv
er
IP Address

or a FQDN if

one has been assigned.









17


Create your own Web 2.0 Presence with
Joomla!




Author
:

Dwayne Trouille

Date:
February, 19, 2009

Revised



ETC
-

Valdosta Ga.


How to use php

i


If you prefer command line the following command will pr
ovide php configuration details


s
imil
a
r

to that of the phpinfo web script.


1.

Open a Terminal Console.

2.

Ty
pe the following command syntax:
php

i

Press
enter

to execute
.

3.

All the PHP configuration information will be listed and can be scrolled through using a mouse
scroll wheel or
the window scroll bar if within

the Gnome Desktop.


Verify
Joomla!

requirements

are met



Joomla!

like most other Open Source solutions seems to work
better with certain server and
services versions. Therefore, it’s important to know how to d
etermine what versions you are
running on your server. The following commands will provide

information that will help in
determining if your server will meet the minimum requirements for running a
Joomla!

1.5.7 site.


cat /etc/redhat
-
release

(There is a space after cat)

Tells the version of Redhat/CentOS

httpd

v



(The v argumen
t is Lower
-
Case) Tells the version of Apache Web Server

mysql

V

(The V argument is Upper
-
Case)

Tells the version of MySQL Server

php

v


(The v argument is Lower
-
Case)

Tells the version of PHP

df

h


Lists
Hard Drive
Storage Size,
Used and
Available, in that order.



Note: Most of the commands above are case sensitive.


Use the techniques listed above to find and compare against the
Joomla!

minimum versions
requirements table below.


This table was created from a simil
ar table
on

the joomla.org website

Software

Min.
Requirement

Recommended

Latest
Options

Web Site

PHP

4.3.10

4.4.7

5.x series

http://php.net

MySQL

3.23.x or above


5.x series

http://dev.mysql.com/downloads/mysql/5.0.html

Apache

1.3 or above


2.2 series

h
ttp://httpd.apache.org/

mod_mysql





mod_xml





mod_zlib






You must ensure that you have the MySQL, XML, and Zlib functionality enabled within your PHP installation. This
is controlled within the
php.ini

file and can be verified using the phpinfo.
php file created earlier.

Below is an
example of what you should hope to find.



A phpinfo screenshot showing xml and zlib are enabled.