Coder Social home page Coder Social logo

vagrantfile's Introduction

Vagrantfile

这是一个基于 Ubuntu 18.04 LTS 的 Vagrant LEMP/LNMP 开发环境,可以运行 Typecho、WordPress 等程序。环境配置根据 Linode 官方教程搭建。

本配置在 Vagrant 2.2.*,虚拟机为 VirtualBox 6.0.* 下测试通过。安装步骤:

  1. 安装 VirtualBox 虚拟机及 Vagrant 程序
  2. 添加 box 镜像 vagrant box add ubuntu/bionic64,选择 virtualbox
  3. 执行建立环境 vagrant up

文件说明:

  • Vagrantfile:Vagrant 的配置文件
  • bootstrap.sh:镜像初始化时自动运行的脚本
  • sources.list:源镜像服务器
  • nginx/*:Typecho、WordPress 的 nginx 的参考配置文件

常见问题

链接数据库报错 Access denied

Access denied for user 'root'@'localhost' (using password: YES)

$ sudo mysql -u root -p

在数据库里执行:

UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root' AND plugin = 'unix_socket';
FLUSH PRIVILEGES;
\q

重启 MariaDB 服务:

$ sudo service mysql restart

方法来源 https://stackoverflow.com/a/35748657/620935

修改静态文件无法实时刷新

这是 VirtualBox 的一个 BUG,需要修改 nginx.conf 文件:

$ sudo vi /etc/nginx/nginx.conf

把里面的 sendfile off; 改为 sendfile on;

方法来源 https://www.vagrantup.com/docs/synced-folders/virtualbox.html

vagrantfile's People

Contributors

fenbox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.