MyServer

部署

安装Docker

安装Docker-Compose

Docker方式安装Nginx

# 备份Nginx
tar -zcvf nginx.tar.gz nginx/ \
--exclude nginx/download \
--exclude nginx/upload \
--exclude nginx/log \
--exclude nginx/toolclis

# 创建目录
mkdir -p nginx/{download/,upload/,log/,toolclis}

# 解压
tar -zxvf nginx.tar.gz -C /data

# 运行
docker run -d --name nginx0 --restart unless-stopped \
-v /data/nginx/html:/usr/share/nginx/html:ro \
-v /data/nginx/toolclis:/usr/share/nginx/toolclis \
-v /data/nginx/upload:/usr/share/nginx/upload \
-v /data/nginx/download:/usr/share/nginx/download \
-v /data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf \
-v /data/nginx/conf/conf.d/:/etc/nginx/conf.d/ \
-v /data/nginx/log:/var/log/nginx \
-v /etc/localtime:/etc/localtime:ro \
--net="host" nginx:1.19.10

ln

cd ~
ln -s /data/nginx/toolclis/alias.txt .
ln -s /data/nginx/html/doc/doc.sh .

cd /data/nginx/html/doc
ln -s ../../toolclis/alias.txt .

Trilium

WordPress

Django

python3.6 -m pip install Django-2.1.15-py3-none-any.whl
python3.6 -m pip install pyotp-2.3.0-py2.py3-none-any.whl 
python3.6 -m pip install WeRoBot1.12.0.zip 

python3.6 manage.py runserver 0.0.0.0:8088
nohup python3.6 manage.py runserver 0.0.0.0:8088 &

jupyter

tar -zxvf jupyter_linux_py3.tar.gz
cd jupyter_linux_py3/
pip3 install --no-index --find-links=. -r requirements.txt

nohup jupyter notebook --ip=0.0.0.0 &

/lib64/libc.so.6: version `GLIBC_2.18' not found (required by /lib64/libstdc++.so.6)

curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar -xvf glibc-2.18.tar.xz
cd glibc-2.18/
mkdir build
cd build/
../configure --prefix=/usr
make -j$(nproc)
make install
strings /lib64/libc.so.6 | grep ^GLIBC_


curl -O https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.xz
tar -xvf gcc-10.2.0.tar.xz
cd gcc-10.2.0
mkdir build
cd build
../configure --prefix=/usr/local --enable-languages=c++ --disable-multilib --with-gmp --with-mpfr --with-mpc
make -j$(nproc)  # 使用所有可用的处理器核心进行编译,加速编译过程
make install

ln -s /usr/local/lib64/libstdc++.so.6.0.27 /usr/lib/libstdc++.so.6
ldconfig -p | grep libstdc++.so.6

strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX_
strings /usr/lib64/libstdc++.so.6 | grep GLIBC_
strings /usr/lib64/libstdc++.so.6 | grep CXXABI_

安装Harbor

FRP

IntelliJIDEALicenseServer

killall IntelliJIDEALicenseServer_linux_amd64
./IntelliJIDEALicenseServer_linux_amd64

http://81.68.115.174:1027

其他

crontab

0 */1 * * * cd /data/nginx/download/clash; wget --no-check-certificate https://gitlab.com/free9999/ipupdate/-/raw/master/clash/config.yaml -O config.yaml
0 */1 * * * cd /data/nginx/download/hysteria; wget --no-check-certificate https://gitlab.com/free9999/ipupdate/-/raw/master/hysteria/config.json; sed -i 's/127.0.0.1:1081/0.0.0.0:1081/' config.json

端口

Port        program
22          sshd
80          docker nginx0
443         docker nginx0
1027        IntelliJIDEALic

7000-7005   frps

8000        python3 django mysite
8001        java jenkins
8080        node trilium
8888        python3 jupyter-notebook

# 弃用
88          docker-proxy goharbor/nginx-photon
4433        docker-proxy goharbor/nginx-photon
3306        docker-proxy wordpress_mysql
8000        docker-proxy wordpress_apache