centos7.0安装后,配置LNMP个人

我用的是centos 7.0的,至于安装和联网这里就不说了。centos 安装好了后,我们要对系统进行一些调试常用工具安装。

去掉linux 警告音 嘟嘟声 错误提示音

相信有人和我一样会被机器报错发出的警告音。。搞的很心烦。。

rmmod pcspkr (暂时去掉) modprode pcspkr(重新开启)

彻底关掉beep的方法如下:

如果用的是bash作shell,在~/.bashrc的最后添加
  setterm -blength 0
  xset -b

  在 console 下: setterm -blength 0

  在 X-win 的 terminal 下: xset -b


ssh安装:

yum install openssh-server (安装)

sudo sshd service start (启动)

这样就可以在外面通过putty工具输入ip连接Liunx了 ,

查看ip命令: ifconfig -a 如果这个不行,试试ip addr


配置 YUM 源:
CentOS 7 的 默认 YUM 源里的软件包版本可能不是最新的,如果要安装最新的软件包就得配置下 YUM 源。
配置 YUM 源可以通过直接安装 RPM (Red Hat Package Manager) 包,或者修改 Repository

首先需要安装EPEL(Extra Packages for Enterprise Linux ) YUM 源,用以解决部分依赖包不存在的问题:

yum install -y epel-releas

wget安装:

yum -y install wget

---防火墙 端口
/etc/init.d/iptables stop
/etc/init.d/iptables statu

vim 安装:

yum install vim

配置vim:

vim /etc/vimrc

如何配置可以看之前写过的一个笔记http://blog.csdn.net/qq_27416209/article/details/51026193


LNMP环境搭建(centOs7.0 ×64):


mysql:

CentOS 7的yum源中貌似没有正常安装mysql时的mysql-sever文件,需要去官网上下载

#wgethttp://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
#rpm-ivhmysql-community-release-el7-5.noarch.rpm
#yuminstallmysql-community-server

成功安装之后重启mysql服务

#servicemysqldrestart

初次安装mysql是root账户是没有密码的

设置密码的方法

#mysql-uroot
mysql>setpasswordfor‘root’@‘localhost’=password('mypasswd');
mysql>exit

php:
yum install -y  php php-bcmath php-fpm php-gd php-json php-mbstring php-mcrypt php-mysqlnd php-opcache php-pdo php-pdo_dblib php-pgsql php-recode php-snmp php-soap php-xml php-pecl-zip phpMyAdmin
启动php
sudo php-fpm -D
nginx:
  1. 下载对应当前系统版本的nginx包(package)
    # wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
    2
    建立nginx的yum仓库
    # rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
    3
    下载并安装nginx
    # yum install nginx
    4
    启动nginx服务
    systemctl start nginx



配置:

/etc/nginx/conf.d/default.conf 新手记得先备份一个

server {
listen 80;
server_name self; # 添加服务器:服务器名称
location / {
root /usr/share/nginx/html/self; # 指明本服务器的根目录
index index.html index.htm index.php; # 默认主页设置]
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ { # php 交互说明
# root html;
fastcgi_pass 127.0.0.1:9000; # 通用网关接口
# fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/self$fastcgi_script_name;
# 接口交互文件路径,使用绝对路径,因为配置文件与 localhost 所在位置距离较远。
include fastcgi_params; # 保证能在 url 中传递参数
}
}


安装git

yum install git

在 LINUX 系统中创建项目仓库 步骤: i:创建仓库目录 (比如:mkdir /usr/repos ) ii:在仓库目录中执行指令:git init iii:建好了。 仓库目录下多了一个隐藏文件夹 :.git

相关文章

linux下开机自启: 在/etc/init.d目录下新建文件elasticsear...
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以...
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用...
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一...
设置时区(CentOS 7) 先执行命令timedatectl status|grep &...
vim /etc/sysconfig/network-scripts/ifcfg-eth0 B...