1,apache
(1),安装apache
# yum install httpd
(2)查看apaceh版本
# httpd -v
(3)查看linux版本
# cat /etc/centos-release
(4),apache 配置文件
# vim /etc/httpd/conf/httpd.conf
(5), 允许端口访问
# # vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
(6),查看和运行apache
# systemctl status httpd.server
# systemctl start httpd.server
(7),修改根目录
# vim /etc/httpd/conf/httpd.conf
(配置以下路径为你想要的路径)
DocumentRoot "/var/www/html"
<Directory "/home/wwwroot/yunkus.com">
(8),查看防火墙
# systemctl status firewalld.service
2,PHP
(1),安装PHP
# yum -y install php php-mbstring php-pear
(2),设置时区(上海)
# vim /etc/php.ini
date.timezone ="Asia/Shanghai"
3,mysql
(1),卸载mysql
(查看已经安装的软件: # yum list installed | grep [软件名])
[root@localhost usr]# yum remove mysql mysql-server mysql-libs compat-mysql51
[root@localhost usr]# rm -rf /var/lib/mysql
[root@localhost usr]# rm /etc/my.cnf
(2),安装mysql
#yum -y install mysql-server mysql mysql-devel
(如果提示没有安装上mysql-server,就以下操作
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-server
)
(3),启动mysql
# system start mysql.service
转载自原文链接, 如需删除请联系管理员。
原文链接:lanm环境,转载请注明来源!