LAMP - Linux Apache Mysql PHP is the most common and easy setup for web hosting. It took me a while to clear some tedious problems I faced though. To make sure I don't have to dig out the net in near future, I'd better jot down the command I used for anyone's reference.
After some annoying time, I changed my setup to YUM, then it was as fast as switching the lamp on...
## to resolve DNS: ##
vi /etc/resolv.conf
search localdomain
nameserver 202.45.84.58
nameserver 202.45.84.59
## to add repository information to YUM ##
## gpgcheck=0 to make sure the unsigned mysql-devel can be installed ##
vi /etc/yum.repos.d/dag.repo
[dag]
name=Dag PRM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=0
enabled=1
## to install LAMP ##
yum install httpd httpd-devel
yum install mysql mysql-server mysql-devel
yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
service httpd start
service mysqld start
## to configure mysql ##
/usr/bin/mysqladmin –u root password ‘111111’
/usr/bin/mysqladmin –u root -p111111 password ‘222222’
/usr/bin/mysql –u root –p
> use mysql;
> DELETE FROM mysql.user WHERE user=’’;
> FLUSH PRIVILEGES;
> GRANT ALL PRIVILEGES ON my_db.* TO ‘user‘@’localhost’ INDENTIFIED BY ‘222222’;
Files under /var/www/html is then php enabled~ :)
Eric