zoukankan      html  css  js  c++  java
  • ubuntu学习笔记

    20210907:

    镜像使用:

    ubuntu-21.04-desktop-amd64.iso

    默认root用户未开启、不登录

    sudo su

    sudo passwd root

    apt-get install vim

    sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

    增加:

    greeter-show-manual-login=true #手工输入登陆系统的用户名和密码
    allow-guest=false #不允许guest登录(可选)

    reboot

    apt-get install openssh-server

    apt-get upgrade


    防火墙:
    ufw disable          //关闭防火墙
    ufw status
    ufw enable  //开启防火墙
    ufw default deny        //拒接所有外来访问,本机能正常访问外部
    ufw allow 80  //开放21端口
    ufw reload  //重启
    ufw delete allow 22 //删除普通端口
    ufw allow 8001/tcp  //指定开放8001的tcp协议
    ufw delete allow 8001/tcp
    ufw allow from 192.168.121.1 // 指定ip为192.168.121.1的计算机操作所有端口
    ufw delete allow from 192.168.121.1
    ufw allow from 192.168.121.2 to any port 3306 // 开放指定ip为192.168.121.2的计算机访问本机的3306端口
    ufw delete allow from 192.168.121.2 to any port 3306

    nginx:
    apt install nginx fcgiwrap nginx-doc
    nginx -v
    vim /etc/nginx/nginx.conf
    service nginx start
    service nginx status

    apache2(httpd):
    apt install apache2
    service apache2 status
    service apache2 start
    vim /etc/apache2/apache2.conf

    PHP:
    apt install php
    apt install php-fpm
    service php-fpm status //安装时要注意看版本号
    service php-fpm start
    apt install php-mbstring
    apt install php-gd
    service apache2 restart //gd模块不用改php.ini载入,而要用hhtpd载入
    thinkphp:
    curl -sS https://getcomposer.org/installer | php
    mv composer.phar /usr/local/bin/composer
    composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
    composer create-project topthink/think tp
    composer update topthink/framework
    php think run -p 80
    MySQL:
    apt install mysql-server
    service mysql status
    mysql_secure_installation
    vim /etc/mysql/mysql.conf.d/mysqld.cnf //把地址邦定注释
    mysql -uroot -p
    select host,user,authentication_string,plugin from user;
    update user set host='%' where user='root';
    alter user 'root'@'%' identified by '123456' password expire never;
    alter user 'root'@'%' identified with mysql_native_password by '123456';
    flush privileges;
    service mysql resart

    Redis:
    apt install redis
    service redis status
    service redis restart
    ufw allow 6379 //开放6379端口
    ufw reload  //重启
    whereis  redis.config
    vim /etc/redis/redis.conf
    #bind 127.0.0.1
    port 8888
    requirepass FA86D
    protected-mode no
    service redis restart














    
    
  • 相关阅读:
    linq to entity之字符串比较
    linq to entity 分页方法不支持LastOrDefault等操作的处理办法
    easyui蛋疼之二 tabs与accordion
    根据下拉框生成控件列表
    第一个flash AS代码
    250多个Jquery各式各样的插件
    对用户控件的访问方式重写
    WP7之Slider绑定textblock设置字体大小
    辉南三角龙湾
    回到正轨
  • 原文地址:https://www.cnblogs.com/xwhgr/p/15241341.html
Copyright © 2011-2022 走看看