Code Monkey home page Code Monkey logo

jianglab's Introduction

Homepage of Li-Xi Jiang lab

网站由Hugo驱动, 下面的内容主要说明在实验室服务器主机上的配置和维护。

配置

如果是第一次/重新部署到Ubuntu16.04上,需要进行配置,否则只需要进行维护。

安装Hugo

wget -c https://github.com/gohugoio/hugo/releases/download/v0.62.2/hugo_0.62.2_Linux-64bit.tar.gz # 可以下载其他版本
tar -zxvf *tar.gz
#cp ./hugo /usr/local/bin/ # 可以放到专门的程序目录中,也可以后面直接通过路径运行

拉取apache容器

安装docker-ce,然后sudo docker pull httpd

接着将配置文件从容器中拷贝出来

专门创建一个apache目录放置建站需要修改或提供的文件。

在里面新建2个文件夹:conflogs

以交互模式运行一个httpd容器,然后从外面拷贝配置文件到conf目录下。

docker run --name lab_website -idt httpd
sudo docker cp <容器名>:/usr/local/apache2/conf/httpd.conf /public/data/apache/conf/

克隆本仓库,在仓库根目录下运行hugo

public目录链接为apache下的www目录。

 ln -s jianglab/public/ www

然后使用sudo运行下面的代码。

 sudo ./run_website.sh jianglab_website

文件名:run_website.sh

docker run --name $1 -p 80:80 \
  -v /public/data/apache/www/:/usr/local/apache2/htdocs/  \
  --mount type=bind,source=/public/data/apache/conf/httpd.conf,target=/usr/local/apache2/conf/httpd.conf  \
  -v /public/data/apache/logs/:/usr/local/apache2/logs/  \
  -d httpd

此时就可以通过http://服务器ip/ 进行访问了。

下面展示下apache目录结构:

.
├── conf
│   └── httpd.conf
├── logs
│   └── httpd.pid
├── www -> jianglab/public/
└── jianglab
    ├── archetypes
    ├── config.toml
    ├── content
    ├── public
    ├── README.md
    ├── resources
    ├── static
    └── themes

维护

  • 停止jianglab_website容器。
  • 拉取和更新仓库。
  • 使用hugo重新生成页面。
  • 重新运行jianglab_website容器

特别感谢上海科技大学王诗翔以及biaslab,本网站主要根据他们的网站修改而来

jianglab's People

Contributors

shixiangwang avatar ytlogos avatar

Stargazers

 avatar

Watchers

James Cloos 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.