Organize your recent experience of building lamp
Installing Apache
1. Installing Apache
yum -y install httpd
2. Apache Configuration httpd.conf
find / -name httpd.conf
Find Apache
configuration file by command httpd.conf
(default in/etc/httpd/conf/httpd.conf)
Edit httpd.conf
File
vi /etc/httpd/conf/httpd.conf
Modify DocumentRoot "/xx/xx/xxx"
, in which directory the project will be "/xx/xx/xxx"
changed to which directory, for example DocumentRoot "/var/www/html"
, will also be
modified to
.
See if 成功
the installation (boot Apache
, and view Apache
status)
service httpd start service httpd status
Display OK
Description安装成功
Install MySQL
1. Install MySQL
yum -y install mysql mysql-devel mysql-server mysql-libs
2. View MySQL version
rpm -qi mysql-server
3. Database Character Set settings
4. Start MySQL
service mysqld start
5. Create the root administrator
mysqladmin -u root password 密码
6. Configure MySQL Boot service
chkconfig --add mysqld (在服务清单中添加mysql服务) chkconfig mysqld on
7. Log in to MySQL
mysql -u root -p 回车输入密码
Install PHP
1. Install PHP
yum -y install php
2. Installing PHP Extensions
yum -y install php-mysql php-gd php-imap php-ldap php-odbc php-mbstring php-devel php-soap php-cli php-pdo yum -y install php-mcrypt php-tidy php-xml php-xmlrpc php-pearyum -y install php-pecl-memcache php-eaccelerator
3. Restart Apache
service httpd restart
4. Testing
/var/www/html/
under Create index.php
file, and writephpinfo()
The browser accesses the index.php
file, if phpinfo
the output information,安装成功
The above describes the Linux built lamp environment yum, including Apache, the installation of Apache content, I hope the PHP tutorial interested in a friend helpful.