手动搭建lamp(centos7+apache2.4+mysql5.6.26+php7)P2

浏览:2223 发布日期:2017/08/02 分类:技术分享 关键字: lamp apache(httpd)部署
PART2 (A)

apache简介
apache在centos的发行版里面的名称是httpd,在ubuntu的发行版上还是apache。而且在centos7里面安装httpd,很简单。

开始:
1.直接安装
yum install -y httpd

2.目录
安装目录:/etc/httpd
配置目录:/etc/httpd/conf/httpd.conf

3.修改配置文件 <Directory "/var/www/html">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All  #这是关键的地方,如果不改成All,就没法重写路径,无法正常访问tp框架

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>
4.启动apache(httpd)
systemctl start httpd 开启

5.开机自启动:
systemctl enable httpd

6.这时候就能通过ip地址访问服务器了(例:http://47.88.170.95)
这里可能会有其他问题导致无法访问:
1)系统防火墙(firewalld)
2)服务商的安全策略(阿里云有)
备注:以上的我总结为端口问题,这有个端口扫描网址:http://tool.chinaz.com/port/

7.其他用到命令:
systemctl start httpd 开启
systemctl stop httpd 关闭
systemctl restart httpd 重启
systemctl status httpd 状态
systemctl enable httpd 开启自启动
systemctl disable httpd 关闭自启动


其他PART的虫洞:
linux:http://www.thinkphp.cn/topic/edit/id/50594.html
apache:http://www.thinkphp.cn/topic/50595.html
msql:http://www.thinkphp.cn/topic/50596.html
php7:http://www.thinkphp.cn/topic/50597.html

最佳答案
评论() 相关
后面还有条评论,点击查看>>