Skip to content

Latest commit

 

History

History
196 lines (112 loc) · 2.8 KB

Ubuntu.md

File metadata and controls

196 lines (112 loc) · 2.8 KB

Ubuntu

目录

安装 Ubuntu

[安装 Apache](#安装 Apache)

[安装 PHP](#安装 PHP)

[安装 MySQL](#安装 MySQL)

[安装 Webmin](#安装 Webmin)

安装 Ubuntu

WSL

微软应用商店搜索并安装 ubuntu

文件系统根目录

C:\Users\86176\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs

安装常用工具

sudo apt install unzip
sudo apt install unrar

参考

安装 Apache

更新下软件源

sudo apt-get update

安装

sudo apt-get install apache2

网站根目录 /var/www/html

访问 127.0.0.1

重启

sudo /etc/init.d/apache2 restart

常见问题

Failed to enable APR_TCP_DEFER_ACCEPT

sudo vi 打开 /etc/apache2/apache2.conf,在文件的最底部加上一行以下内容:

AcceptFilter http none

参考

安装 PHP

sudo apt-get install php7.0

建议中看到有 7.2,取消安装 7.0

sudo apt-get install php7.2
php -v

安装 Apache 模块

先搜索

apt-cache search libapache2-mod-php 

选择安装一个版本

sudo apt-get install libapache2-mod-php7.2

编写一个测试文件

cd /var/www/html
sudo vim test.php
# sudo gedit test.php

test.php

<?php
phpinfo();

安装扩展

sudo apt-get install php7.0-mysql
sudo apt-get install php7.0-mbstring

安装 Composer

sudo apt-get install composer
composer

参考

安装 MySQL

sudo apt-get install mysql-server mysql-client
mysql -v

参考

安装 Webmin

在Ubuntu中安装功能最强大的管理工具Webmin

常见问题

文件和目录权限

ls -l
# 或 ll

sudo chmod 777 folder
# 修改

参考

dpkg was interrupted

sudo dpkg --configure -a
sudo apt-get update
sudo apt-get upgrade
# sudo apt-get -f install