cd /usr/local/
wget http://downloads.sourceforge.net/project/pcre/pcre/8.37/pcre-8.37.tar.gz
tar -xvf pcre-8.37.tar.gz
cd pcre-8.37
./configure
make&&makeinstall
pcre-config --version
cd /usr/local/
wget http://nginx.org/download/nginx-1.17.9.tar.gz
tar -xvf nginx-1.17.9.tar.gz
cd nginx-1.17.9
./configure
make&&makeinstallmkdir -p /home/www/blog
chmod777 /home/www/blog/
chmod777 /home/www/
cd /usr/local/nginx-1.17.9/conf
vim nginx.conf
location / {
root /home/www/blog;
index index.html index.htm;}
配置Git仓库
adduser gitchmod740 /etc/sudoers
vim /etc/sudoers
在如下位置添加
gitALL=(ALL) ALL
vi指令执行之后按i进入输入模式
编辑完成之后按一下esc
然后输入:wq即可退出
chmod400 /etc/sudoers
sudopasswdgit
Changing password for user git.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
切换git用户并且建立密钥
sugitcd ~
mkdir .ssh
cd .ssh/
vi authorized_keys
# 添加自己的密钥chmod600 ~/.ssh/authorized_keys
chmod700 ~/.ssh/
创建git仓库
cd ~
git init --bare blog.git
vi ~/blog.git/hooks/post-receive
# 添加进去git --work-tree=/home/www/blog --git-dir=/home/git/blog.git checkout -f
chmod +x ~/blog.git/hooks/post-receive