分类: BSD
2009-04-21 13:26:31
cd /usr/ports/databases/mysql50-server
make install clean
mysql_install_db
chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/
/usr/local/bin/mysqld_safe -user=mysql &
Note: If you encounter Command not found error, use command rehash to update OS path environment variables.
echo ‘mysql_enable=”YES”‘ >> /etc/ rc.conf
mysqladmin -u root password newpassword
Replace newpassword with your own desired password.
------------------------------------------------------------------------
Installing Apache HTTPD Web Server 2.2
cd /usr/ports/www/apache22
make install clean
echo ‘apache22_enable =”YES”‘ >> /etc/ rc.conf
/usr/local/sbin/apachectl start
or
/usr/local/etc/rc.d/apache22.sh start
------------------------------------------------------------------------
Installing PHP Hypertext Preprocessor Scripting Language 5 and PHP 5 Extensions
cd /usr/ports/lang/php5
make install clean
cd /usr/ports/lang/php5-extensions
make config
make install clean
AddType application/x- httpd-php .php
AddType application/x- httpd-php-source .phps
A web server has been setup with the FreeBSD with Apache, MySQL and PHP. The document root of the web server (where you should put your HTML and PHP files is at /usr/local/www/apache22/data/ and you will need a SecureFTP (SFTP) client such as WinSCP to upload your files to web server securely.