β

Centos 7 搭建LAMP环境

Sobird 7 阅读

安装Apache

sudo yum install httpd

httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Jun 27 2018 13:48:59

配置ServerName
vi /etc/httpd/conf/httpd.conf

ServerName localhost:80

配置虚拟主机
vi /etc/httpd/conf.d/vhosts.conf
输入下面内容


<VirtualHost *:80>
  ServerAdmin i@sobird.me
  DocumentRoot “/home/sobird/www"
  <Directory /home/sobird/www>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
    Require all granted
  </Directory>
</VirtualHost>

启动

systemctl start httpd

设置开机启动

systemctl enable  httpd

安装PHP

yum install php php-devel

安装Mysql

yum install mariadb
yum install php-mysql

数据安全设置

mysql_secure_installation

安装phpmyadmin

yum install epel-release
yum install phpmyadmin
作者:Sobird
Since 1987
原文地址:Centos 7 搭建LAMP环境, 感谢原作者分享。

发表评论