Rabu, 02 Oktober 2013

LAMP on Centos

Keep House Clean (TIDAK HARUS DILAKUKAN)
service httpd stop
yum remove php php-*
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/webtatic.repo
/etc/yum.repos.d/epel.repo
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/webtatic.repo
vi /etc/yum.repos.d/webtatic.repo
[webtatic]
name=Webtatic Repository $releasever - $basearch
#baseurl=http://repo.webtatic.com/yum/centos/5/$basearch/
mirrorlist=http://repo.webtatic.com/yum/centos/5/$basearch/mirrorlist
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy
 
=====================start here ============================
APACHE
yum install httpd
service httpd restart
PHP5
yum install php php-mysql
service httpd restart
untuk mencoba silahkan ketikkan
echo "<?php phpinfo();?>" >> /var/www/html/info.php
untuk mencari modul gunakan perintah
yum search php-
MYSQL
yum install mysql-server
service mysqld start
/usr/bin/mysql_secure_installation
MAKE APACHE AND MYSQL AUTORUN
chkconfig httpd on
chkconfig mysqld on
JSON
yum update
yum install php-pear php-devel gcc make
pecl install json
echo "extension=json.so" >> /etc/php.d/json.ini
echo "extension=php_curl.dll" >> /etc/php.ini
echo "extension=ffmpeg.so" >> /etc/php.ini
echo "extension=json.so" >> /etc/php.ini
service httpd restart
PHPMYADMIN
CentOS/RHEL 6, 32 Bit (i386):
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
CentOS/RHEL 6, 64 Bit x86_64):
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
CentOS/RHEL 5, 32 Bit (i386):
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
CentOS/RHEL 5, 64 Bit (x86_64):
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
step 2
yum install phpMyAdmin
Troubleshooting : » #2002 – Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) The server is not responding (or the local server’s socket is not correctly configured). ( This means your mysql server service is stopped , you must start the service “service mysql start”) » You don’t have permission to access /phpMyAdmin/ on this server. Open /etc/httpd/conf.d/phpMyAdmin.conf file and find the lines “Deny from All ” and comment those lines and restart httpd service

Tambahan
Reset root password
/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set password=PASSWORD("mynewpassword") where User='root';
flush privileges;
quit
/etc/init.d/mysqld start
mencoba hasil reset
mysql -u root -p mysql;
select host,user from user;
quit
/etc/init.d/mysqld start
chkconfig
sudo /sbin/chkconfig httpd on
sudo /sbin/chkconfig --list httpd
httpd           0:off        1:off  2:on    3:on    4:on    5:on    6:off
FIREWALL
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
sudo service iptables save
check firewall status
sudo netstat -plunt
source : http://www.rackspace.com/knowledge_center/article/centos-apache-and-php-install

Tidak ada komentar:

Posting Komentar

Foto Propades