Ubuntu18的一些简单配置

换源

首先,我们先更新源

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即可。
在这里插入图片描述
可以在这里查看自己切换输入法的设置:
在这里插入图片描述

发布了27 篇原创文章 · 获赞 1 · 访问量 812

猜你喜欢

转载自blog.csdn.net/weixin_44377940/article/details/104102026
今日推荐