Apache, PHP, and MySQL
2009-05-13 13:15:29来源:未知 阅读 ()
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
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
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:Install Apache2
- OpenBSD 4.5 2009-05-13
- DragonFly BSD 2.2.1发布 2009-05-13
- NetBSD 5.0发布 2009-05-13
- Flash 9 for FreeBSD 7.1 2009-05-13
- FreeBSD下WEBCAM 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash