Вы находитесь на странице: 1из 4

How to install LAMP, phpMyAdmin and VsFTP on CentOS 5.

3
Using Yum
We will now look at the wonderful and exciting way to install LAMP, phpMyAdmin and VsFTP on CentOS
5.3 utilizing Yum! Hoorray! =)

#Update Your Package


yum update

# Install Mysql Packages


yum install mysql-server mysql mysql-devel
/etc/init.d/mysqld start

# By default mysql has the no passward. To change the password in command shell write the following
commands

NOTE: Setting this password and user will be using at your phpmyadmin login account
mysql
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD(’your_password’) WHERE user=’root’;
mysql> FLUSH PRIVILEGES;

# Install php and common packages


yum install php php-gd php-imap php-mysql php-pear php-xml phpxmlrpc curl libxml2 php-mbstring php-
mcrypt

#Install NANO editor on terminal (My favorite editor and easy to use)

yum install nano

# Install VSFTP
yum install vsftpd
# Modify the conf files it depends on you.
nano /etc/vsftpd/vsftpd.conf
nano /etc/vsftpd/user_list
nano /etc/vsftpd/ftpusers
/etc/init.d/vsftpd start

# Install phpMyAdmin
cd /usr/share/
wget http://files.directadmin.com/services/all/phpMyAdmin/phpMyAdmin-2.11.9.5-all-languages.tar.gz

Or copy a link from here http://files.directadmin.com/services/all/phpMyAdmin/

tar xvfz phpMyAdmin-2.11.9.5-all-languages.tar.gz


mv phpMyAdmin-2.11.9.5-all-languages phpmyadmin
rm phpMyAdmin-2.11.9.5-all-languages.tar.gz
cd phpmyadmin/
cp config.sample.inc.php config.inc.php
nano config.inc.php
>> $cfg['blowfish_secret'] = ‘TypeAnything_for_Secure’;
nano /etc/httpd/conf.d/phpmyadmin.conf
>> Alias /phpMyAdmin /usr/share/phpmyadmin
service httpd restart

# Check your web-site


cd /var/www/html/
ls
cat > index.php
<?
phpinfo();
?>
http://ipaddress/

# Setup Auto Start


setup
Select Service -> httpd, mysqld, vsftp

Creating a user and its directory call public_html and accessed to /var/www/html/

We need to go to change the configuration of httpd.conf at:

Nano /etc/httpd/conf/httpd.conf

Find the UserDir disable in there and put # infront of it so it would be looked like this

#UserDir disable

Giving access from /var/www/html to /home/user/public_html we need to change it at

UserDir and put public_html (remember put what directory name as you want it to be)

UserDir public_html

Save and close your httpd.conf and restart the httpd services by

service httpd restart

To a user account type

adduser username

passwd username ( to set password )

To create directory in /home/username call public_html

mkdir /home/username/public_html

(NOTE: Since you have installed vsftpd above right now you can have ftp account as same as the username and
password you have created. )

Uploading your file to /home/username/public_html by using any FTP software with your hostname: IP
address, username and password with 21 ports. You will see a directory call public_html then go inside of it
and upload your files there. Once you have succeed uploading your file, you can start browsing from your
browser by your http://IPaddress/~username

Yay!! It done eh? Not yet

Once you have your hosting working fine with apache, php, mysql, ftp, phpmyadmin and even able to access
your site by your http://ipaddress/~username you might want to have your domain name lets say
www.mydomain.com to link to your http://ipaddress/~username or /home/username/public_html instead of
having to remember IP Address.

IT IS NOT HARD, but ALMOST if you are newbie

1. I will be introducing using zoneedit as DNS Server and have your domain name pointing to
zoneedit.
2. I will be introducing using directly from your domain manager.

LET’S START WITH ZONEEDIT.COM

1. Go to zoneedit.com and create one account since it is FREE you can have only 5 zone.
2. Change your domain name server. nameserver1: ns4.zoneedit.com and nameserver2:
ns13.zoneedit.com. Sometime this might be changed due to the time. So in order to make it clear try
to add zone in zoneedit.com it will ask you put your domain name there. Put your domain name and
click on add. Once you haven’t change your nameserver on your domain side it won’t work and it
will tell you their nameserver to put on your domain name server.
3. After you have changed your domain name server to zoneedit nameserver, you are not able to add
zone in zoneedit. Im sure you know how to do it.
4. Click on IP address (A) and you will be asked to put www and IP address (your vps/server ip) and
click Add new ip address.
5. Yay you have done it and you need to wait at least 24hours

LET’S START WITH YOUR DOMAIN MANAGER

1. Go to your domain manager


2. Im sure there is A record and CName of WWW Record, change them to your vps/server ip address
and it is done.

CONFIGURATION ON YOUR VPS

1. Edit the configuration file of httpd.conf by using nano /etc/httpd/conf/httpd.conf


2. Add these lines at the bottom of the file

<VirtualHost *:80>
ServerAdmin info@aisolution.biz
ServerName aisolution.biz
ServerAlias *.aisolution.biz
DocumentRoot /home/aisolution/public_html
<Directory /home/aisolution/public_html>
Options FollowSymLinks
</Directory>
</VirtualHost>

Add more if you have more domain names

3. Don’t forget uncomment on #NameVirtualHost *:80 so on the configuration file should be look like
this
NameVirtualHost *:80

The Save and Close your configuration file.

4. To restart your httpd please type service httpd restart


5. Yay it is done!! @_@ once your domain resolved with your zoneedit and zoneedit resolved with
your vsp IP and then you are rock.
6. Use nslookup www.mydomain.com if you are a windows user

THE END

Вам также может понравиться