当前位置: 首页 > news >正文

大美南京网站南宁企业建站模板

大美南京网站,南宁企业建站模板,西宁最新通告今天,seo外包优化摘要: 2023-12-29 服务器开发-Centos部署LNMP环境 centos7.2搭建LNMP具体步骤 1.配置防火墙 CentOS 7.0以上的系统默认使用的是firewall作为防火墙#xff0c; 关闭firewall#xff1a; systemctl stop firewalld.service #停止firewall systemctl disable fire… 摘要: 2023-12-29 服务器开发-Centos部署LNMP环境 centos7.2搭建LNMP具体步骤 1.配置防火墙 CentOS 7.0以上的系统默认使用的是firewall作为防火墙 关闭firewall systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2.安装以及配置nginx 1可直接使用服务器内自带的yum源进行安装。 yum install -y nginx 2修改nginx默认配置文件。 cd /etc/nginx/ #nginx的默认配置目录 mv nginx.conf nginx.conf.swf #将通过yum安装自动生成的配置文件换名不再使用。 mv nginx.conf.default nginx.conf #将default文件修改为加载配置文件 3启动nginx并访问。 systemctl start nginx.service #启动nginx systemctl stop nginx.service #停止 systemctl restart nginx.service #重启 systemctl enable nginx.service 此时使用公网IP访问即可打开nginx的默认欢迎页面。 3.安装php环境以及依赖扩展并开启php 1安装环境。 yum install -y php-fpm php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash yum install php php-fpm php-mysql -y 2启动php-fpm。 systemctl start php-fpm.service #启动php-fpm systemctl enable php-fpm.service #设置开机启动 3修改配置文件使nginx兼容php。 vim /etc/nginx/nginx.conf 在location内添加上index.php 把php识别之前的#注释给去掉就可以了并且改一下fastcgi_param location / { root html; index index.php index.html index.htm; }error_page 500 502 503 504 /50x.html; location /50x.html { root html; }location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } 4重启nginx和php-fpm systemctl restart php-fpm.service systemctl restart nginx.service 5访问phpinfo验证 进入nginx默认根目录 cd /usr/share/nginx/html/ vim index.php ?php echo phpinfo(); ? 此时访问公网IP/index.php可看到php的探针页面 4.安装mysql并连接php进行验证 1centos7以上的系统默认数据库为MariaDB需要下载mysql源进行安装。 wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-community-release-el7-5.noarch.rpm yum install -y mysql-community-server 成功安装之后重启mysql服务: systemctl start mysqld 2安装后的mysql数据库是没有密码的可进入数据库后授权设置密码。 mysql -u root mysql use mysql; mysql update user set passwordPASSWORD(这里输入root用户密码) where userroot; mysql flush privileges; mysql exit 3编写php测试mysql是否可连接的代码并访问。 vim /usr/share/nginx/html/test.php ?php $linkmysql_connect(localhost,root,刚才所设置的数据库密码); if(!$link) echo FAILD!error; else echo OK!You succeeded.; ? 保存后此时访问IP/test.php可看到 至此基于centos7.2系统所安装的LNMP环境已经全部搭建完毕。
http://www.hkea.cn/news/14432012/

相关文章:

  • 海南住房建设厅网站wordpress 附件下载
  • 杭州设计 公司 网站建设保定建站价格
  • 好的网站开发自学网站海口网站建设q479185700棒
  • 苏州网站排名方案广州设计公司排名榜
  • 岳阳网站建设联系方式讯美 深圳网站建设
  • 服装网站建设规划方案重庆市建设工程安全管理协会
  • 手绘风格的网站在线A视频网站l一级A做爰片
  • 临沂电商网站建设wordpress神级插件
  • 建设互联网站是什么广州站图片
  • 系部网站建设研究方案wordpress 注册邀请码
  • 希尔顿酒店网站建设的优点长沙网站建设企业
  • 企业一站式网站建设网站建设方案汇报
  • 大型网站开发合同网络维护工作
  • 青县网站建设咨询搜索网页怎么制作
  • 天津网站建设学习表白网页设计代码大全
  • 广西上林建设局网站网页微信怎么登录
  • 山西省建设厅网站打不开哈尔滨网站建设 熊掌号
  • 爱站查询开发网站 需求
  • 公司网站建设岗位品牌营销策划书
  • 湘潭网站建站公司怎么做网站不被发现
  • 嘉兴市做网站优化建设工程造价网
  • 自开发网站网站网站制作需要多少钱
  • 网站建设模板htmlvi设计思路怎么写
  • 网站黑名单卖家电商平台有哪些
  • 找别人做网站一定注意什么1G免费网站空间
  • 网站系统名称h5制作方法和步骤
  • 做h5长图网站个人网页制作模板图片代码
  • 昆明几大网站产品质量推广营销语
  • 惠州市住房和城乡建设厅网站wordpress本地调试修改域名
  • 网站服务器到期了怎么续费wordpress 全局播放器