腾讯云搭建centos6.7环境

以前一直用windowsever2012 终于狠下心来换成linux 。linux我是0基础 笔记本也不是mac的 找了很多资料很视频  尝试自己搭建了下 分享下过程 希望能帮助遇到同样的同学

因为服务器主要是web服务器 环境是lnmpa (linux+nginx+mysql+apache)我是围绕着这个准备搭建的

需要的工具 window电脑 云centos服务器
    putty vnc viewer
    yum源 http://mirrors.aliyun.com/


0 配置yum源
    查看yum

    cd /etc/yum.repos.d/
    vim CentOs-Base.repo
    基础源
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
    扩展源
    yum localinstall --nogpgcheck http://mirrors.aliyun.com/epel/6/x86_64/epel-release-6-8.noarch.rpm

    yum clean all
    yum makecache

    查看源包
    yum grouplist | more
1 安装gnome
    yum groupinstall "Desktop"
    yum groupinstall "X Window System"
    yum groupinstall "Chinese Support"

    修改系统启动级别
    vim /etc/inittab
     将    id:3:initdefault:    改为     id:5:initdefault

    备注
    不管是 Gnome 还是 KDE,"X Window System"、"Desktop" 都是必须的。
    在此安装Gnome桌面,因此执行命令: yum groupinstall "X Window System" "Desktop Platform"  "Desktop"

2 安装vnc
     yum install -y tigervnc-server
     vim /etc/sysconfig/vncservers

     VNCSERVERS="1:root 2:amadeus"
     分别设置密码 记得切换用su
     vncpasswd

     开启vnc服务
     service vncserver start

     关闭vnc服务
     service vncserver stop

     自动开启vnc
     chkconfig vncserver on

     查看配置
     chkconfig --list vncserver

    reboot

     客户端 VNC-5.3.2-Windows

    ip服务器ip 端口可以不写 也可以5901 5902 多个人就多+1 密码你刚才设置的

     使用vnc登陆
3 安装chrome
    cd Downloads
    wget http://chrome.richardlloyd.org.uk/install_chrome.sh

    chmod u+x install_chrome.sh
    ./install_chrome.sh
   
    #可能需要翻墙质量不好
    或者
    然后使用gedit编辑install—chrome.sh,使用find功能查找并将
    其中的http://omahaproxy.appspot.com改为https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm。

    vim /usr/bin/google-chrome

    在fi前一行添加 --user-data-dir

    怕麻烦的也可以安装火狐 yum install firefox

4 分区
    
    挂载硬盘 我买了1块腾讯云硬盘 100G

    fdisk -l 查看硬盘情况

    pvcreate /dev/vdb
    pvs 看盘

    vgcreate vgzone /dev/vdb
    vgs 看空间

    lvcreate -n lnmp -L 99G vgzone

    lvs 看逻辑卷

    mkfs.ext4 /dev/vgzone/lnmp

    e2label /dev/vgzone/lnmp LAMP

    mount /dev/vgzone/lnmp /var/lnmp

    自动挂载
    vim /etc/fstab


5 安装ftp
    vsftpd

    在root权限下,通过如下命令安装Vsftp(以CentOS系统为例):
    yum install -y vsftpd

    建立用户和指定目录
    (建立用户ftpAdmin,并指定其家目录为lnmp/www,禁止登陆)
    useradd -m -d /var/lnmp/www -s /sbin/nologin ftpAdmin
    passwd ftpAdmin
    后续可以在/etc/passwd修改
    修改配置
        修改vsftpd.conf
        vim /etc/vsftpd/vsftpd.conf

        禁用匿名登录
        anonymous_enable=NO
        将chroot_list_enable和chroot_list_file的注释去掉,阻止用户访问上级目录

       
        新建list文件配置
        vim /etc/vsftpd下建立chroot_list文件
        在其中添加用户ftpAdmin,(一行一个)使其只允许访问指定目录。

        修改vsftpd的pam配置,使用户可以通过自己设置的FTP用户帐号和密码连接到云服务器。
        vim /etc/pam.d/vsftpd

        修改为
        #%PAM-1.0
        auth required /lib64/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
        auth required /lib64/security/pam_unix.so shadow nullok
        auth required /lib64/security/pam_shells.so
        account required /lib64/security/pam_unix.so
        session required /lib64/security/pam_unix.so

        修改指定目录的权限
        chmod -R 777 /var/lnmp/www
        chmod -R 755 /var/lnmp/www/phpmyadmin
     从启ftp服务
     service vsftpd restart

     自动从起
     chkconfig vsftpd  on

     查看用户 tail /etc/passwd
     查看自动启动进程 chkconfig --list


6 安装sublime编辑器
   
    在线获取 sublime源 可能版本有错 目前为3126
    wget https://download.sublimetext.com/sublime_text_3_build_3126_x64.tar.bz2

    解压 tar -xvf sublime_text_3_build_3083_x64.tar.bz2

    进入解压后的目录cd sublime_text_3/,
    直接  ./sublime_text
    即可打开Sublime Text

    创建桌面快捷方式
    cp /opt/sublime_text_3/sublime_text.desktop /usr/share/applications

    修改配置
    vim /usr/share/applications/sublime_text.desktop

这样初步的centos准备就完成了 接下来安装lnmpa环境

原文地址:https://www.cnblogs.com/lanbosm/p/5948874.html