免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1206 | 回复: 0
打印 上一主题 下一主题

Apache, PHP, and MySQL [复制链接]

论坛徽章:
2
丑牛
日期:2013-09-29 09:47:222015七夕节徽章
日期:2015-08-21 11:06:17
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-09 09:51 |只看该作者 |倒序浏览
General Information
This guide will teach you how to set up a basic web server with Apache, PHP support, and MySQL for the database.  
There are a couple of ways to do this, but this guide will use the easier method with the ports system.
Requirements
  • In order for public access to your website, you must have a valid domain name.
  • A text editor (for this guide we will use Nano)
    Installation
    Section A -- Apache
    #
    #
    cd /usr/ports/www/apache13
    make install cleanApache now gets started on system boot from rc.conf so let's add the respective entry:
    #
    echo 'apache_enable="YES"' >> /etc/rc.conf
    Note:  For Apache2 users:  Use the following instead.
    #
    #
    #
    cd /usr/ports/www/apache2
    make install distclean
    echo 'apache2_enable="YES"' >> /etc/rc.conf
    Section B -- PHP
    #
    #
    cd /usr/ports/lang/php4
    make configYou will be prompted to add module support.  At this time select the Apache support.
    #
    #
    #
    make install distclean
    cd /usr/ports/lang/php4-extensions
    make install distcleanSelect which options you would like compiled into PHP and select OK.
    Section C -- MySQL
    #
    #
    #
    cd /usr/ports/databases/mysql41-server
    make install clean
    echo 'mysql_enable="YES"' >> /etc/rc.conf
    Configuration
    Now we need to make sure Apache is configured for your website and that the PHP module is configured in the Apache config file.
    #
    #
    cd /usr/local/etc/apache
    nano httpd.conf
    Make sure you see the following lines uncommented:
    LoadModule php4_module     libexec/apache/libphp4.so
    AddModule mod_php4.c
         DirectoryIndex index.php index.html index.htm
    Add the following lines for virtual hosts:
    ServerType standalone
    ServerName domain.tld
    NameVirtualHost 192.168.0.2
         ServerName domain.tld
         ServerAlias www.domain.tld
         ServerAdmin admin@domain.tld
         DocumentRoot /path/to/website/files
    Start the servers:
    #
    #
    /usr/local/etc/rc.d/mysql-server.sh start
    /usr/local/sbin/apachectl start
    Enjoy your webserver!


    本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4206/showart_523045.html
  • 您需要登录后才可以回帖 登录 | 注册

    本版积分规则 发表回复

      

    北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年举报专区
    中国互联网协会会员  联系我们:huangweiwei@itpub.net
    感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP