当前位置:Gxlcms > 数据库问题 > www服务器假设linux+apache+mariadb+php

www服务器假设linux+apache+mariadb+php

时间:2021-07-01 10:21:17 帮助过:3人阅读

/ "/var/www/myfilename/"   #让你放在/var/www/myfilename下的文件也可以单独成网站,如输入网页地址:localhost/myfilename,开始

  <Directory "/var/www/myfilename">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>   #这七句需要自己添加,介绍

3.配置php

  /etc/httpd/conf.d/php.conf  并没有什么好更改的

  vim /etc/php.ini

  (1)display_errors=Off

   display_startup_errors=Off

  这两段为On时会记录下错误信息,错误文件记录在/var/log/httpd/error_log和/var/log/messages下,很适合调试时使用,会记录下php网页中错误的语句

  (2)拓展软件httpd-manual,输入localhost/manual查看apache的使用手册

     mod_perl、mod_python、mod_ssl让www服务器支持perl、python、ssl

3.启动和关闭httpd

  (1)这种方式笔者不能用,会提示无此httpd文件,如果有人知道原由望告知笔者,万分感谢!启动:/etc/init.d/httpd start(或者stop关闭、restart重启),开机自启动:chkconfig httpd on

  (2)启动:/usr/sbin/apachectl start(stop关闭、restart重启)。

  (3)查看服务是否启动:netstat -tulnp | grep ‘httpd‘

  (4)测试php网页是否可用:vim /var/www/html/phpinfo.php  内容输入<?php phpinfo ();  ?>调用php的函数phpinfo()

4.数据库mariadb的设定(咋一看有点像matlab有木有)

  这个真是耗费了我好多的时间,不认识什么鬼的童鞋,笔者建议自行google补脑,笔者给你一预防针,mariadb和mysql的命令一样的(笔者不敢保证)。

  安装MariaDB-server和MariaDB-client,方法有很多但官网上的是最简单的,https://downloads.mariadb.org/mariadb/repositories/#mirror=neusoft进去后自行选择系统和版本。仔细阅读 Copy and paste it into a file under /etc/yum.repos.d/ (we suggest naming the file MariaDB.repo or something similar)这句话,就是:

  vim /etc/yum.repos.d/MariaDB.repo内容输入

  # MariaDB 10.1 CentOS repository list - created 2015-11-16 12:52 UTC

  # http://mariadb.org/mariadb/repositories/

  [mariadb]

  name = MariaDB

  baseurl = http://yum.mariadb.org/10.1/centos7-amd64

  gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

  gpgcheck=1

  然后保持yum install MariaDB-server MariaDB-client安装即可

www服务器假设linux+apache+mariadb+php

标签:

人气教程排行