换源
首先,我们先更新源
apt-get update
进入/etc/apt/目录下,
cp sources.list sources.list.bak//备份
vi sources.list//编辑,如果没有vi,可以用apt-get install vim来安装vim
删除sources.list的内容后,将源换成阿里的。
下面是aliyun的源,也可以换成清华源,自行选择
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
然后再更新源即可
apt-get update
安装nginx
sudo apt-get install nginx
安装php
sudo apt-get install php
安装php-fpm
sudo apt-get install php-fpm//安装这个的作用是使nginx能够解析php文件
配置相关文件
输入php -v
查看php版本
一般来说php-fpm的版本是与php版本相同的
进入/etc/nginx/sites-available
编辑default
文件,将下面的注释符去掉
值得注意的是,php-fpm的版本需要根据你自己的版本进行修改,例如我的就是7.2。
这一行就是网页所在的根目录,根据自己需求更改
如果需要index.php作为默认页面,则需要加入index.php在下面这行
sudo service nginx start//如果是更改配置文件时nginx在运行,则需要用restart
sudo service php7.2-fpm start
然后再本地浏览器打开127.0.0.1
查看测试页面即可。
安装谷歌拼音
sudo apt-get install fcitx
sudo apt-get install fcitx-google-pinyin
一路yes和ok,安装完之后,输入
im-config
继续一路okyes,设置fcitx为默认输入法,然后重启。
启动后可发现右上角有一个键盘图标,点击
进入设置界面,点击“+”号,进入如图所示界面,将箭头处取消勾选,搜索pinyin然后点击ok即可。
可以在这里查看自己切换输入法的设置: