LAMP
L: linux
A: Apache(httpd)
M: Mysql/MariaDB
P:PHP/Perl/Python/
Fast architectural solution for LAMP combination:
http and php are integrated through modules;
LAMP architecture order:
1. Install the corresponding package;
Cent OS 6:
yum -y install httpd mysql-server php php-mysql
Cent OS 7:
yum -y install httpd mariadb-server php php-mysql
2. Create a virtual host;
1) cd /etc/httpd/conf.d
vim host2.conf
2) Create the corresponding directory:
# mkdir -pv /myvhost/vhost2
vim /mymyvhost/vhost2/index.php
vhost2 <br>
<?php
phpinfo();
?>
After editing, test the PHP function on the web side:
If successful, do a PHP database connection test:
Edit file:
vim /mymyvhost/vhost2/index.php
vhost2 <br>
<?php
$y = mysql_connect('172.16.1.25','myuser','123456');
if($y)
echo "yes";
else
echo "no";
?>
web test:
test was successful
Note: the user 'myuser' needs to be authorized in the database
which is:
mysql> grant all on *.* to 'myuser'@'172.16.%.%' identified by '123456'
1. Deploy the blog system:
Put the compressed package of the blog system under /myvhost/vhost2/
After decompression:
Access with the web side:
Then click the start now icon to log in, and then publish the blog post;
Deploy the forum system: the same blog
Web access:
Click the "I agree" icon to operate;
Note: If garbled characters appear, modify the main configuration file of httpd (/etc/httpd/conf/httpd.conf): Disable AddDefaultCharset UTF-8,
Add AddDefaultCharset GB2312;
Deploy the database system: operate the same as above
After logging in:
Then check locally whether the table is added successfully:
# mysql -p123456
use ytc
The ball table was added successfully;