[zt]OpenBSD6.1 nginx mariadb drupal8 安装
发表于 : 2017-06-24 11:08
[zt]OpenBSD6.1 nginx mariadb drupal8 安装
https://xalttz.com/node/5
https://xalttz.com/node/5
NetBSD & OpenBSD Chinese forum
https://store.keda.io/
二、添加pkg_add镜像,并编辑doas.conf权限$ doas disklabel -p g sd0
16 partitions:
# size offset fstype [fsize bsize cpg]
a: 2.0G 64 4.2BSD 2048 16384 12958 # /
b: 10.0G 4209024 swap # none
c: 931.5G 0 unused
d: 10.0G 25173856 4.2BSD 2048 16384 12958 # /home
e: 4.0G 46154720 4.2BSD 2048 16384 12958 # /tmp
f: 30.0G 54540672 4.2BSD 2048 16384 12958 # /usr
g: 875.5G 117451264 4.2BSD 8192 65536 52238 # /var
三、安装nginx,php7,php-pdo_mysql,php-gd,都选择7.0版本$ vi /etc/installurl
https://mirrors.tuna.tsinghua.edu.cn/OpenBSD
$doas vi /etc/doas.conf
permit USERNAME as root
完了之后做相应的链接ln -sf ...$doas pkg_add nginx php php-pdo_mysql php-gd
使mysql到chroot环境$doas pkg_add mariadb-server
$doas mysql_install_db
$doas /etc/rc.d/mysqld start
$doas mysql_secure_installation
五、安装composer,并创建我们drupal工程$doas vi /etc/my.cnf
将/var/run/mysql ——》/var/www/var/run/mysql
$doas mkdir -p /var/www/var/run/mysql
$doas chown -R _mysql:_mysql /var/www/var/run/mysql/
由于composer的官方速度简直是龟速,现在用我们国内的镜像。$doas pkg_add composer
$doas pkg_add php-zip //选择5.6版本 并作想应的链接,因为composer需要
可以加上-vvv看它的过程。$doas composer config -g repo.packagist composer https://packagist.phpcomposer.com
进入/var/www/htdocs
$doas composer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir --stability dev --no-interaction
七、创建nginx适用的drupal8.conf1.Create a new database for your site. (Change the username and databasename.)
mysql -u username -p -e "CREATE DATABASE databasename CHARACTER SET utf8 COLLATE utf8_general_ci";
MySQL/MariaDB prompts for the 'username' database password, and creates the initial database files.
2.Log in and set the access database rights:
mysql -u username -p
MySQL/MariaDB prompts for the 'username' database password.
3.At the MySQL/MariaDB prompt, create the user and set the permissions using the following command:
CREATE USER username@localhost IDENTIFIED BY 'password';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON databasename.* TO 'username'@'localhost' IDENTIFIED BY 'password';
并作相应的修改,如使用443端口,用https。进入/etc/nginx ,$doas mkdir vhost
$doas git clone https://github.com/gz818/oneinstack-ngi ... config.git
九、OVER!1.修改localhost为127.0.0.1,强制mysql使用TCP。由于现在的mysql在chroot环境,这是最简单的方法。还可以做个链接。
2.如果遇到translation无法下载,可以在https://localize.drupal.org/translate/languages/zh-hans下载相应的版本。
LyuBing 写了: "1TB的U盘"是从哪看出来?
不论是真U盘,还是SSD或移动硬盘,这样架设和部署webserver总觉得有些别扭。$ doas disklabel -p g sd0
16 partitions:
# size offset fstype [fsize bsize cpg]
a: 2.0G 64 4.2BSD 2048 16384 12958 # /
b: 10.0G 4209024 swap # none
c: 931.5G 0 unused
d: 10.0G 25173856 4.2BSD 2048 16384 12958 # /home
e: 4.0G 46154720 4.2BSD 2048 16384 12958 # /tmp
f: 30.0G 54540672 4.2BSD 2048 16384 12958 # /usr
g: 875.5G 117451264 4.2BSD 8192 65536 52238 # /var