centos6服务器上通过docker安装Ubuntu的web桌面版
1.因为服务器的系统内核比较老,最新的docker镜像不能使用,选择旧版本
官方网站:https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc 版本tags:xenial 命令:docker pull dorowu/ubuntu-desktop-lxde-vnc:xenial
2.启动容器的命令
docker run -d -p 7700:80 -p 7701:5000 -p 7702:6800 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc:xenial 端口说明:7700是容器web桌面访问端口 7701是spiderkeeper的访问端口 7702是scrapyd访问端口
3.Ubuntu修改时区和更新时间
命令:date -R 发现时区不一致,我们是东八区 命令:tzselect 依次选择:Asia->China->Beijing->Yes 命令:cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 命令:date -s hh:mm:ss //修改时间
4.升级系统
命令:apt update
5.安装软件(可不安装)
命令:apt -y install openssl* git wget gcc automake autoconf libtool make bzip2 zlib libssl-dev 使用技巧:点击Clipboard-->粘贴命令-->桌面中右键选择Paste
6.安装python3的pip和模块
命令:apt-get install python3-pip 命令:pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple virtualenv 命令:virtualenv gongshang 命令:source ./bin/activate req.txt 命令:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r req.txt
req.txt内容如下: aniso8601==1.2.0 APScheduler==3.3.1 asn1crypto==0.24.0 attrs==19.1.0 Automat==0.7.0 certifi==2019.6.16 cffi==1.12.3 chardet==3.0.4 click==6.7 constantly==15.1.0 cryptography==2.7 cssselect==1.1.0 EasyProcess==0.2.7 fake-useragent==0.1.11 Flask==0.12.1 Flask-BasicAuth==0.2.0 Flask-RESTful==0.3.5 flask-restful-swagger==0.19 Flask-SQLAlchemy==2.2 hyperlink==19.0.0 idna==2.8 incremental==17.5.0 itsdangerous==0.24 Jinja2==2.9.6 lxml==4.4.1 MarkupSafe==1.0 mysql-connector-python==8.0.17 numpy==1.17.0 opencv-python==4.1.0.25 parsel==1.5.2 Pillow==6.1.0 protobuf==3.9.1 pyasn1==0.4.6 pyasn1-modules==0.2.6 pycparser==2.19 PyDispatcher==2.0.5 PyHamcrest==1.9.0 PyMySQL==0.7.11 pynput==1.4.2 pyOpenSSL==19.0.0 pyperclip==1.7.0 pyscreenshot==0.5.1 python-dateutil==2.6.0 python-xlib==0.25
7.安装谷歌浏览器
rpm下载:链接: https://pan.baidu.com/s/1GS7QccHo5qpZzBcVsa6c7A 提取码: jcgn deb下载:链接: https://pan.baidu.com/s/1zgRzqr7gLpURz74DHVkp3g 提取码: pzm9
apt-get install alien alien xxxx.rpm dpkg -i xxxx.deb
8.中文乱码(未生效)
apt-get install language-pack-zh-hans vi /etc/environment LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh:en_US:en" 再修改/var/lib/locales/supported.d/local(没有这个文件就新建,同样在末尾追加): en_US.UTF-8 UTF-8 zh_CN.UTF-8 UTF-8 zh_CN.GBK GBK zh_CN GB2312 最后执行命令: locale-gen
9.下载VMware Workstation 14.0.0 Pro for Linux(软件打开未成功,系统内核太低)
官方地址:https://my.vmware.com/cn/web/vmware/details?downloadGroup=WKST-1400-LX&productId=686 百度网盘:
10.安装gcc4.4.7(不用安装)
vmware无法启动,安装gcc4.4.7试试 官网下载:http://ftp.gnu.org/gnu/ 下载安装gmp-4.3.2 http://ftp.gnu.org/gnu/gmp ./configure -–prefix=/usr/local/gmp-4.3.2 make make install 下载安装mpfr3.1.4 http://ftp.gnu.org/gnu/mpfr ./configure --prefix=/usr/local/mpfr-3.1.4 --with-gmp=/usr/local/gmp-4.3.2 make make install 下载安装mpc-1.0.3 http://ftp.gnu.org/gnu/mpc ./configure --prefix=/usr/local/mpc-1.0.3 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-3.1.4 make make install 调整环节变量 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc-1.0.3/lib:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-3.1.4/lib 安装gcc-4.5.1 ./configure --prefix=/usr/local/gcc-4.5.1 -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c++ --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-3.1.4 --with-mpc=/usr/local/mpc-1.0.3 make make install 解决报错: apt-get install gcc-multilib export LIBRARY_PATH=/usr/lib/x86-linux-gnu make
报错:/usr/bin/ld: cannot find crti.o: No such file or directory 64位解决方法: ln -s /usr/lib/x86_64-linux-gnu /usr/lib64