Ubuntu配置Apt、Git 、PHP Web

目录

1、配置apt数据源

2、配置git

3、phpstudy


1、配置apt数据源

cat /etc/apt/sources.list
# ubuntu21.10数据源
deb http://mirrors.aliyun.com/ubuntu/ impish main restricted
deb http://mirrors.aliyun.com/ubuntu/ impish-updates main restricted
deb http://mirrors.aliyun.com/ubuntu/ impish universe
deb http://mirrors.aliyun.com/ubuntu/ impish-updates universe
deb http://mirrors.aliyun.com/ubuntu/ impish multiverse
deb http://mirrors.aliyun.com/ubuntu/ impish-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ impish-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ impish-security main restricted
deb http://mirrors.aliyun.com/ubuntu/ impish-security universe
deb http://mirrors.aliyun.com/ubuntu/ impish-security multiverse

sudo apt-get update
sudo apt-get upgrade

2、配置git

使用Apt安装Git

Git软件包包含在Ubuntu的默认存储库中,可以使用apt软件包管理器进行安装。这是在Ubuntu上安装Git的最方便,最简单的方法。

如果要从源代码安装最新的稳定版Git,请转到本教程的“从源代码安装Git”部分。

安装非常简单,只需以具有sudo特权的用户身份运行以下命令即可:

sudo apt update
sudo apt install git

从源代码安装Git

从源代码安装Git的主要优点是您可以编译最新的Git版本并自定义构建选项。但是,您将无法通过apt软件包管理器来维护Git安装。

首先安装在Ubuntu系统上构建Git所需的依赖项:

sudo apt update$sudo apt install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev make gettext libz-dev libssl-dev libghc-zlib-dev

接下来,打开浏览器,访问GitHub上Git项目的镜像,并复制以.tar.gz结尾的最新发行版链接URL。在撰写本文时,最新的稳定Git版本是“ 2.26.2”:

我们将在/usr/src目录中下载并解压缩Git源代码,该目录是放置源文件的常用位置:

wget -c https://github.com/git/git/archive/v2.26.2.tar.gz -O - | sudo tar -xz -C /usr/src

下载完成后,转到源目录并运行以下命令来编译和安装Git:

cd /usr/src/git-*
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install
$git --version

以后,当您想升级到较新版本的Git时,请使用相同的过程。

配置Git

安装Git之后,您需要做的第一件事就是配置您的git用户名和电子邮件地址。 Git将您的身份与您所做的每次提交相关联。

要设置全局提交名称和电子邮件地址,请运行以下命令:

git config --global user.name "yu"
git config --global user.email yu@qq.com

您可以通过键入以下命令来验证配置更改:

git config --list

输出应如下所示:

user.name=yu
user.email=yu@qq.com

配置设置存储在~/.gitconfig文件中:

cat ~/.gitconfig

[user]
user.name=yu
user.email=yu@qq.com

 3、phpstudy

wget -O install.sh https://notdocker.xp.cn/install.sh && sudo bash install.sh

安装完成

==============运行状态=========================

webpanel running 
phpstudy running 

=================安装完成==================

请用浏览器访问面板:
外网:http://182.123.156.202:9080/EAE6F3
内网:http://192.168.131.132:9080/EAE6F3
系统初始账号:admin
系统初始密码:7QWp39BfZl
官网:https://www.xp.cn
如果使用的是云服务器,请至安全组开放9080端口
如果使用ftp,请开放21以及30000-30050端口

===========================================

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

人海中的海盗

你的打赏将是对我的激励

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值