LNMP搭建
来源:互联网 发布:手机爱淘宝1元口令 编辑:程序博客网 时间:2024/04/28 17:14
网络自启动:
1、 ifconfig查看网络设备号eno-xxxxxx
2、 cd /etc/sysconfig/network-scripts/
3、 ls
4、 vim /ifcfg-eno16777736
5、 ONBOOT=yes
OK
安装mysql:
cenos7 默认安装mariadb而不是mysql
先开启网络!!
1、通过yum在线安装:
1、yum -y install mariadb-server mariadb mariadb-devel
或yum install mariadb mariadb-server
2、systemctl start mariadb启动
3、systemctl enable mariadb 开机自启动
4、mysql_secure_installation 设置root密码等相关
5、firewall-cmd --permanent --add-service mysql防火墙加入mysql
6、systemctl restart firewalld.service 重启防火墙
7、iptables -L -n|grep 3306 查看防火墙又没开放3306
8、msyql -uroot -p 连接mysql
9、show databases; 查看数据库
2、设置数据库远程访问
1、mysql -uroot -p;链接数据库
2、use mysql;选择数据库
3、grant all privileges on *.* to‘root’@'%' identified by 'root';
4、flush privileges;刷新权限
3、安装nginx
1、 rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-
7-0.el7.ngx.noarch.rpm
2、 yum install nginx
3、systemctl start nginx.service
4、systemctl enable nginx.service
5、防火墙开启80端口firewall-cmd --zone=public --add-port=80/tcp --permanent
6、systemctl restart firewalld.service重启防火墙
7、systemctl start nginx.service
4、安装php 5.6
1、rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/7/x86_64/e/
epel-release-7-5.noarch.rpm
2、http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
3、yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
4、yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-common
5、php -v 显示版本
5、配置nginx:
1、cp nginx.conf nginx.conf.origin
2、vim /etc/nginx/nginx.conf:
user nginx;
worker_processes 1;
sendfile on;
tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
index index.php index.html index.htm;
3、cd /etc/nginx/conf.d
4、cp default.conf default.conf.origin
5、vim default.conf:
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
location ~ \.php$ {
# root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
include fastcgi_params;
}
6、systemctl start php-fpm.service
7、systemctl enable php-fpm.service
8、systemctl restart nginx.service
9、cd /usr/share/nginx/html/
10、vim index.php:
<?php
…………;
?>
6、配置php
1、vi /etc/php.ini #编辑
2、date.timezone = PRC #把前面的分号去掉,改为date.timezone = PRC
3、expose_php = Off #禁止显示php版本的信息
4、short_open_tag = ON #支持php短标签
5、open_basedir = .:/tmp/ #设置表示允许访问当前目录(即PHP脚本文件所在之目 录)和/tmp/目录,可以防止php木马跨站,如果改了之后安装程序有问题(例如:织梦内容管理系统),可以注销此行,或者直接写上程序的目录 /data/www.osyunwei.com/:/tmp/
6、:wq! #保存退出
7、systemctl restart mariadb.service #重启MariaDB
8、systemctl restart httpd.service #重启apache
- lnmp搭建
- lnmp搭建
- lnmp搭建
- LNMP搭建
- LNMP搭建
- LNMP搭建
- LNMP搭建
- LNMP 搭建
- LNMP搭建
- lnmp搭建
- LNMP搭建
- LNMP环境搭建
- LNMP环境搭建
- Virtualbox搭建LNMP
- LNMP环境搭建
- SUSE10下搭建LNMP
- LNMP环境的搭建
- 9、lnmp搭建
- iOS之UIGestureRecognizer手势识别
- ICTCLAS_api使用方法
- 第16周项目1-验证算法(5)直接选择排序
- MyBatis简介与配置MyBatis+Spring+MySql
- netty类图分析
- LNMP搭建
- java example实例01
- hadoop2.7.3 HA YARN 环境搭建
- Sentry 介绍
- Python--阿里云服务器CentOS 配置流程(三)
- 细数前端中的一些黑科技
- python 相对路径文件的操作
- style与theme
- 三种方式实现监听操作