OpenSeaMap-dev:Server FreeBSD Forum: Unterschied zwischen den Versionen

Aus OpenSeaMap-dev
Wechseln zu: Navigation, Suche
(Add mysql configuration.)
(Forum installation.)
 
Zeile 2: Zeile 2:
  
 
Connect to the jail. Either via <tt>'ejzail-admin console <jail-name>'</tt> or via SSH.
 
Connect to the jail. Either via <tt>'ejzail-admin console <jail-name>'</tt> or via SSH.
 +
 +
=== Change hostname settings ===
 +
 +
vi /etc/rc.conf
 +
  hostname="forum.openseamap.org"
 +
 +
vi /etc/hosts
 +
  ::1                    forum.openseamap.org localhost localhost.my.domain
 +
  127.0.0.1              forum.openseamap.org localhost localhost.my.domain
 +
  127.0.0.11              forum.openseamap.org
  
 
=== nginx, php, mysql ===
 
=== nginx, php, mysql ===
Zeile 16: Zeile 26:
 
  screen -S ports
 
  screen -S ports
 
  portmaster -d -B www/nginx lang/php5 archivers/php5-zlib \
 
  portmaster -d -B www/nginx lang/php5 archivers/php5-zlib \
     ftp/php5-ftp graphics/php5-gd textproc/php5-xml \
+
     www/php5-session security/php5-hash textproc/php5-xml \
     graphics/php-magickwand databases/mysql56-server \
+
     databases/mysql56-server \
     php5-mysqli
+
     databases/php5-mysql
 
  exit
 
  exit
  
Zeile 33: Zeile 43:
 
   listen = /var/run/php.sock
 
   listen = /var/run/php.sock
 
   chroot = /var/www
 
   chroot = /var/www
 +
 +
install -d -o root -g wheel -m 755 /var/www
 +
install -d -o root -g wheel -m 755 /var/www/docs
 +
install -d -o www -g wheel -m 755 /var/www/tmp
  
 
Configure nginx.
 
Configure nginx.
Zeile 59: Zeile 73:
 
    
 
    
 
           location / {
 
           location / {
               root  /var/www;
+
               root  /var/www/docs;
 
               index  index.php index.html index.htm;
 
               index  index.php index.html index.htm;
 
           }
 
           }
Zeile 71: Zeile 85:
 
               fastcgi_pass  unix:/var/run/php.sock;
 
               fastcgi_pass  unix:/var/run/php.sock;
 
               fastcgi_index  index.php;
 
               fastcgi_index  index.php;
               fastcgi_param  SCRIPT_FILENAME  $fastcgi_script_name;
+
               fastcgi_param  SCRIPT_FILENAME  docs/$fastcgi_script_name;
 
               include        fastcgi_params;
 
               include        fastcgi_params;
 
           }
 
           }
Zeile 86: Zeile 100:
  
 
  mysql -u root
 
  mysql -u root
   CREATE DATABASE forum;
+
   CREATE DATABASE fluxbb;
   GRANT ALL ON forum.* TO forum@<local-jail-ip> IDENTIFIED BY '<password>';
+
   GRANT ALL ON fluxbb.* TO fluxbb@<local-jail-ip> IDENTIFIED BY '<password>';
 
   \q
 
   \q
  
=== phpBB ===
+
=== FluxBB ===
  
Fetch and unzip source files.
+
Fetch and extract source files.
  
 
  cd /var/www
 
  cd /var/www
  fetch '<nowiki>https://www.phpbb.com/files/release/phpBB-3.0.11.zip</nowiki>'
+
  fetch '<nowiki>http://fluxbb.org/download/releases/1.5.4/fluxbb-1.5.4.tar.gz</nowiki>'
  unzip phpBB-3.0.11.zip
+
  tar xfvz fluxbb-1.5.4.tar.gz
  mv phpBB3/* .
+
  mv fluxbb-1.5.4/* docs/
  mv phpBB3/.htaccess .
+
  rmdir fluxbb-1.5.4
rmdir phpBB3
+
  rm fluxbb-1.5.4.tar.gz
  rm phpBB-3.0.11.zip
+
 +
chown -R root:wheel /var/www/docs
 +
find /var/www/docs -type d -exec chmod 755 {} \;
 +
find /var/www/docs -type f -exec chmod 644 {} \;
  
 
Change owner for writeable folders.
 
Change owner for writeable folders.
  
  chown -R www cache files store config.php images/avatars/upload/
+
cd /var/www/docs
 +
  chown www cache
 +
chown www img/avatars/
  
 
== Maintenance ==
 
== Maintenance ==

Aktuelle Version vom 21. Oktober 2013, 10:49 Uhr

Installation

Connect to the jail. Either via 'ejzail-admin console <jail-name>' or via SSH.

Change hostname settings

vi /etc/rc.conf
  hostname="forum.openseamap.org"
vi /etc/hosts
  ::1                     forum.openseamap.org localhost localhost.my.domain
  127.0.0.1               forum.openseamap.org localhost localhost.my.domain
  127.0.0.11              forum.openseamap.org

nginx, php, mysql

Configure ports.

vi /etc/make.conf
  .if ${.CURDIR:M*/lang/php*}
  WITH_FPM=yes
  .endif

Install ports.

screen -S ports
portmaster -d -B www/nginx lang/php5 archivers/php5-zlib \
    www/php5-session security/php5-hash textproc/php5-xml \
    databases/mysql56-server \
    databases/php5-mysql
exit

Configure services to startup at boot.

vi /etc/rc.conf
  nginx_enable="YES"
  php_fpm_enable="YES"
  mysql_enable="YES"

Configure php-fpm.

vi /usr/local/etc/php-fpm.conf
  listen = /var/run/php.sock
  chroot = /var/www

install -d -o root -g wheel -m 755 /var/www
install -d -o root -g wheel -m 755 /var/www/docs
install -d -o www -g wheel -m 755 /var/www/tmp

Configure nginx.

vi /usr/local/etc/nginx/nginx.conf
  user  nobody;
  worker_processes  1;
  
  events {
      worker_connections  1024;
  }
  
  http {
      include       mime.types;
      default_type  application/octet-stream;
  
      server_tokens off;
  
      sendfile        on;
  
      keepalive_timeout  65;
  
      server {
          listen       80;
          server_name  forum.openseamap.org;
  
          location / {
              root   /var/www/docs;
              index  index.php index.html index.htm;
          }
  
          error_page   500 502 503 504  /50x.html;
          location = /50x.html {
              root   /usr/local/www/nginx-dist;
          }
  
          location ~ \.php$ {
              fastcgi_pass   unix:/var/run/php.sock;
              fastcgi_index  index.php;
              fastcgi_param  SCRIPT_FILENAME  docs/$fastcgi_script_name;
              include        fastcgi_params;
          }
      }
  }

Start services.

 service mysql-server start
 service php-fpm start
 service nginx start

Create database.

mysql -u root
  CREATE DATABASE fluxbb;
  GRANT ALL ON fluxbb.* TO fluxbb@<local-jail-ip> IDENTIFIED BY '<password>';
  \q

FluxBB

Fetch and extract source files.

cd /var/www
fetch 'http://fluxbb.org/download/releases/1.5.4/fluxbb-1.5.4.tar.gz'
tar xfvz fluxbb-1.5.4.tar.gz
mv fluxbb-1.5.4/* docs/
rmdir fluxbb-1.5.4
rm fluxbb-1.5.4.tar.gz

chown -R root:wheel /var/www/docs
find /var/www/docs -type d -exec chmod 755 {} \;
find /var/www/docs -type f -exec chmod 644 {} \;

Change owner for writeable folders.

cd /var/www/docs
chown www cache
chown www img/avatars/

Maintenance