搭建AMP on FreeBSD and install dokuwiki

1. Install FreeBSD Ports Collection
   #portsnap fetch
   #portsnap extract
If the Ports Collection is already installed, make sure to update it.
   #portsnap update
2. Install Apache
   #cd /usr/ports/www/apache22
   #make install clean
   #echo 'apache22_enable="YES"' >> /etc/rc.conf    //Set the apache start automatically at system boot.
3. Install MySQL
   #cd /usr/ports/databases/mysql55-server
   #make install clean
   #echo 'mysql_enable="YES"' >> /etc/rc.conf    //Set the mysql start automatically at system boot.
   #/usr/local/etc/rc.d/mysql-server start
   #/usr/local/bin/mysqladmin -u root password 'your_password'    //Set the password for root user.
4. Install PHP
   #cd /usr/ports/lang/php5
   #make config    //select "Build Apache Module"
   #make install clean
   #cd /usr/ports/lang/php5-extensions/
   #make config    //select "MySQL database support" and "MySQLi database support"
   #make install clean
5. Configuration
   #cp /usr/local/etc/php.ini-development /usr/local/etc/php.ini    //the configuration is suitable for development purpose,but not necessarily for production purpose
   #vim /usr/local/etc/apache22/httpd.conf
look for the following line:
   DirectoryIndex index.html
And change it so it reads as follows:
   DirectoryIndex index.html index.htm index.php
look for the following line:
#ServerName www.example.com:80
And change it like following:
ServerName your_domain:80
Edit /etc/hosts and add following line
Your_domain    Your_IP
Append the follow two lines to the end file in order to support PHP files
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Option step, uncomment the following line:
Include etc/apache22/extra/httpd-languages.conf
Then open the language settings file /usr/local/etc/apache22/extra/httpd-languages.conf and add the following line to the end of the file:
AddDefaultCharset On
Now restart apache
   #/usr/local/etc/rc.d/apache22 restart
6. Install Dokuwiki
1. Download dokuwiki
#tar -zxvf dokuwiki-stable.tgz
#cp -r dokuwiki /usr/local/www/apache22/data
#chown -R www:www /usr/local/www/apache22/data/dokuwiki
Open browse fill in your_ip/dokuwiki/install.php then do it as notes.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章