1.>>>>> update
portsnap fetch extract
pkg install sudo
2.>>>>>Install Apache24
pkg install apache24
sysrc apache24_enable=yes
service apache24 restart
3.>>>>>Install Mysql
pkg install -y mysql55-server mysql55-client
sysrc mysql_enable=yes
service mysql-server start
mysql_secure_installation (设置root用户密码,默认安装完成root无密码)
4.>>>>>Install Redis
pkg install redis
sysrc redis_enable=yes
service redis start
5.>>>>>Install php70
pkg install -y php70 php70-bz2 php70-ctype php70-curl php70-dom php70-exif php70-fileinfo php70-filter php70-gd php70-hash php70-iconv php70-intl php70-json php70-mbstring php70-mcrypt php70-pdo_mysql php70-openssl php70-posix php70-session php70-simplexml php70-xml php70-xmlreader php70-xmlwriter php70-xsl php70-wddx php70-zip php70-zlib php70-opcache mod_php70
安装完成后 执行php-m 查看发现php-gd模块安装失败,需要如下方式解决
cd /usr/ports/graphics/png
make install ALLOW_UNSUPPORTED_SYSTEM=yes
如果失败,执行如下命令
cd /usr/ports/graphics/png/work/libpng-1.6.35
make install
6.>>>>>modify configure files
修改/usr/local/etc/apache24/httpd.conf文件
取消以下两行注释
-
LoadModule ssl_module libexec/apache24/mod_ssl.so
-
LoadModule rewrite_module libexec/apache24/mod_rewrite.so
加入以下内容
-
<IfModule php7_module>
-
<FilesMatch "\.(php|phps|php7|phtml)$">
-
SetHandler php7-script
-
</FilesMatch>
-
DirectoryIndex index.php
-
</IfModule>
在该文件的与
之间,添加如下内容
-
AddType application/x-httpd-php-source .phps
-
AddType application/x-httpd-php .php
保存修改后的文件
/usr/local/apache24/modules.d创建新文件
-
# cd /usr/local/etc/apache24/modules.d
-
# touch /usr/local/etc/apache24/modules.d/001_mod_php.conf
-
# nano /usr/local/etc/apache24/modules.d/001_mod_php.conf
在001_mod_php.conf文件中添加如下内容
-
<FilesMatch "\.php$">
-
SetHandler application/x-httpd-php
-
</FilesMatch>
-
<FilesMatch "\.phps$">
-
SetHandler application/x-httpd-php-source
-
</FilesMatch>
修改php.ini文件
-
$ cd /usr/local/etc
-
$ cp php.ini-production php.ini
-
$vi /usr/local/etc/php.ini
修改如下配置
-
find cgi.fix_pathinfo=0 change from =0 to =1
-
find date.timezone = Asia/Shanghai
-
find post_max_size= change it to 1999M
-
find upload_max_size= change to 1999M
取消如下注释
-
opcache.enable=1
-
opcache.enable_cli=1
-
opcache.interned_strings_buffer=8
-
opcache.max_accelerated_files=10000
-
opcache.memory_consumption=128
-
opcache.save_comments=1
-
opcache.revalidate_freq=1
保存
7.>>>>>重启服务
service apache24 restart
service redis restart
至此,基本安装完成,可在基础上安装nextcloud,后续文章介绍
阅读(3911) | 评论(0) | 转发(0) |