LAMP分离环境的搭建(最新版本的mysql+php+http源码编译安装)

实验者:FrankStar      实验日期:20150628

任务:主要是实现在Linux环境下配置LAMP环境,利用VMware+centos6.4实现,将LAMP分离为多台主机;

附注:由于大家的环境不一样,可能有些人已经安装了这个包或者那个软件,所以调试的环境结果也不一样,为了尽量能模拟到

可能出现的所有问题,在编译会出现问题和错误的地方都做了应对。没有像很多其他文档一样,直接一开头就让读者安装大量的包,

可能遇到的错误不一样,安装过的软件也不一样,所以笔者将提示都一一标注清楚,望读者不厌其烦。

附注:需要大家在宿主机的hosts文件中添加192.168.197.202(http服务器地址) www.frank.com(由于此时并未做好DNS服务器)

文件目录: C:\Windows\System32\drivers\etc\hosts

1.主机规划

配置虚拟机中有至少 3台,操作系统都是centos6.4.网段在192.168.197.0/24 网关192.168.197.2

分配如下:

1台httpd服务器(192.168.197.202)

1台php服务器 (192.168.197.204)

1台mysql服务器(192.168.197.205)

由于这些虚拟主机都是克隆产生的,所以需要先更改相应的IP和网卡设置。

1.首先删除Eth1网卡,点击右上角的网络编辑,delete Eth1网卡。

2.同时编辑eth0为你需要配置的网络地址,同时设置网关等参数,并启用。

3.ifconfig -a 查看Eth1的mac地址,记住之。

4.vim /etc/sysconfig/network-scripts/ifcfg-eth0 编辑其mac地址为HWADDR="步骤2中的mac地址"

5.vim /etc/udev/rules.d/70-persistent-net.rules找到步骤2中那个Mac地址所在行将其name改为eth0,然后删除另一行即可。

6.service network restart即可。

2.工作模式

首先客户端发起请求,请求分为2种,一种是静态请求它可以直接由Apache直接响应返回;另一种是动态的请求,如其中包含中php或者Perl这种脚本解释性语言,则由Apache服务器通过fastcgi协议调用php服务器执行并返回给Apache由Apache返回解释执行后的结果,如果这个过程中涉及到对数据的操作,此时php服务器还会还会通过mysql协议调用mysql服务器。

3.编译安装Apache(192.168.197.202)

首先去官网 http://httpd.apache.org/download.cgi#apache24下载最新稳定版httpd,在这里使用的是 httpd-2.4.12.tar.bz2 

由于Apache的安装需要先安装Apr与Apr-utils,同时本环境中系统并没有自带httpd,所以对于不一样的环境,希望读者可以将自带的httpd

服务关闭,并关闭开启自动启动,同时注意不要编译时不要指定到默认路径即可。我们这里不需要考虑这么多,环境是全新的。所以可以指定安装。

(1)安装Apr与Apr-utils 

官网下载: http://apr.apache.org/download.cgi 版本为apr-1.5.2.tar.bz2与apr-util-1.5.4.tar.bz2 

利用xftp将文件传输到202主机上。

tar xf apr-1.5.2.tar.bz2 

cd apr-1.5.2

./configure –prefix=/usr/local/apr

提示:

一、此步可能提示 no acceptable C compiler found in $PATH 这是因为没有安装GCC组件的原因

解决办法: yum -y install gcc即可。

二、提示“ rm: cannot remove `libtoolT': No such file or directory” 可以将configure这个文件(在该目录下)

中的RM=‘$RM'改为RM='$RM  -f'然后重新编译。

make && make install 即可安装完毕。

(2)安装Apr-utils

tar xf apr-util-1.5.4.tar.bz2 

cd apr-util-1.5.4

./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr

make && make install 安装完毕。

(3)安装Apache

tar xf httpd-2.4.12.tar.bz2 

cd httpd-2.4.12

在执行configure脚本时,使用–enable-mpms-shared选项即可启用动态构建MPM模块。当给出的参数为all时,所有此平台支持的MPM模块都会被安装。

还可以在参数中给出模块列表。默认MPM,可以自动选择或者在执行configure脚本时通过–with-mpm选项来指定,然后出现在生成的服务器配置文件中。

编辑LoadModule指令内容可以选择不同的MPM。

./configure –prefix=/usr/local/apache –sysconfdir=/etc/httpd24 –enable-so –enable-ssl –enable-cgi –enable-rewrite –with-zlib –with-pcre 

–with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util –enable-modules=most –enable-mpms-shared=all 

–with-mpm=event –enable-proxy –enable-proxy-fcgi

提示:

一、可能提示 MPM most does not support dynamic loading. 此时将–enbale-mpm-shared改为all即可 

二、pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/,没有安装pcre-devel,yum -y install pcre-devel即可。

三、 OpenSSL version is too old。openssl版本过旧,yum -y install openssl-devel即可。

make && make install

(4)修改httpd的配置文件 

vim /etc/httpd/httpd.conf 在其中添加一行内容如下:

PidFile "/var/run/httpd.pid"

然后为httpd提供服务脚本

提供SysV服务脚本/etc/rc.d/init.d/httpd,内容如下:

#!/bin/bash

#

# httpd        Startup script for the Apache HTTP Server

#

# chkconfig: – 85 15

# description: Apache is a World Wide Web server.  It is used to serve \

#        HTML files and CGI.

# processname: httpd

# config: /etc/httpd/conf/httpd.conf

# config: /etc/sysconfig/httpd

# pidfile: /var/run/httpd.pid

# Source function library.

. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/httpd ]; then

. /etc/sysconfig/httpd

fi

# Start httpd in the C locale by default.

HTTPD_LANG=${HTTPD_LANG-"C"}

# This will prevent initlog from swallowing up a pass-phrase prompt if

# mod_ssl needs a pass-phrase from the user.

INITLOG_ARGS=""

# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server

# with the thread-based "worker" MPM; BE WARNED that some modules may not

# work correctly with a thread-based MPM; notably PHP will refuse to start.

# Path to the apachectl script, server binary, and short-form for messages.

apachectl=/usr/local/apache/bin/apachectl

httpd=${HTTPD-/usr/local/apache/bin/httpd}

prog=httpd

pidfile=${PIDFILE-/var/run/httpd.pid}

lockfile=${LOCKFILE-/var/lock/subsys/httpd}

RETVAL=0

start() {

echo -n $"Starting $prog: "

LANG=$HTTPD_LANG daemon –pidfile=${pidfile} $httpd $OPTIONS

RETVAL=$?

echo

[ $RETVAL = 0 ] && touch ${lockfile}

return $RETVAL

}

stop() {

echo -n $"Stopping $prog: "

killproc -p ${pidfile} -d 10 $httpd

RETVAL=$?

echo

[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}

}

reload() {

echo -n $"Reloading $prog: "

if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then

RETVAL=$?

echo $"not reloading due to configuration syntax error"

failure $"not reloading $httpd due to configuration syntax error"

else

killproc -p ${pidfile} $httpd -HUP

RETVAL=$?

fi

echo

}

# See how we were called.

case "$1" in

 start)

start

;;

 stop)

stop

;;

 status)

status -p ${pidfile} $httpd

RETVAL=$?

;;

 restart)

stop

start

;;

 condrestart)

if [ -f ${pidfile} ] ; then

stop

start

fi

;;

 reload)

reload

;;

 graceful|help|configtest|fullstatus)

$apachectl $@

RETVAL=$?

;;

 *)

echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"

exit 1

esac

exit $RETVAL

chmod +x /etc/init.d/httpd

chkconfig –add httpd

chkconfig –level 2345 httpd on

chkconfig –list httpd

service httpd start

提示:

一、 AH00557: httpd: apr_sockaddr_info_get() failed for frank,添加主机名到/etc/hosts文件中即可。

vim /etc/hosts 127.0.0.1 一行中添加你的主机名即可。

二、 AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. 

Set the 'ServerName' directive globally to suppress this message 修改配置文件/etc/httpd/httpd.conf

vim /etc/httpd/httpd.conf找到#ServerName www.example.com:80行启用并修改为ServerName localhost:80

三、如果出现service httpd restart stop总是失败,可以查看下日志tail /usr/local/apache/logs/error_log

如出现错误;AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded 即编辑/etc/httpd/httpd.conf

加载该模块即可LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

然后重新启动即可。

在浏览器中输入ip地址即可访问,显示it works代表我们的httpd服务器已搭建完毕。(关闭防火墙和selinux)

4.编译安装php+xcache (192.168.197.204)

php官网下载: http://php.net/get/php-5.6.10.tar.bz2/from/a/mirror 这里使用的是php-5.6-10的稳定版

Xcache官网下载: http://xcache.lighttpd.net/wiki/Release-3.2.0 这里使用xcache-3.2.0支持php-5.6-10的稳定版

这里需要提醒的是,需要注意相应版本之间的支持与兼容问题。详情见版本介绍与发布说明。

(1)编译安装php

tar xf php-5.6.10.tar.bz2 

cd php-5.6.10

./configure –prefix=/usr/local/php –enable-fpm –with-config-file-path=/etc –with-config-file-scan-dir=/etc/php.d 

–with-libxml-dir=/usr –with-openssl –with-zlib –with-bz2 –with-jpeg-dir –with-png-dir –with-freetype-dir –enable-mbstring 

–with-mcrypt –enable-sockets –with-mysql=mysqlnd –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd  –enable-maintainer-zts

提示:

一、安装gcc 由于是独立的主机 需要配置环境 yum -y install gcc

二、 –with-mysql几个选项都要为mysqlnd;因为mysql服务器单独为另一台主机

三、为了支持apache的worker或event这两个MPM,编译时使用了–enable-maintainer-zts选项。

四、error: xml2-config not found. Please check your libxml2 installation.安装libxml2-devel yum -y install libxml2-devel

五、 error: Cannot find OpenSSL's <evp.h> 安装openssl openssl-devel 

六、Please reinstall the BZip2 distribution。 安装bzip2 bzip2-devel .yum install bzip2 bzip2-devel 

七、 error: mcrypt.h not found. Please reinstall libmcrypt.安装 libmcrypt libmcrypt-devel 这个需要注意,因为一般的yum源中是没有

这2个package的,所以需要先对其下载安装。

wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz获取文件

安装libmcrypt

tar -zxvf libmcrypt-2.5.7.tar.gz

cd libmcrypt-2.5.7

./configure –prefix=/usr/local/libmcrypt 

make && make install 

安装完毕。

此时需要将php安装的命令中修改 –with-mcrypt=/usr/lib/libmcrypt即可。

make && make install 即可。

(2)配置php

cp php.ini-production /etc/php.ini

配置fpm 

为php-fpm提供Sysv init脚本,并将其添加至服务列表:

cp sapi/fpm/init.d.php-fpm  /etc/rc.d/init.d/php-fpm

chmod +x /etc/rc.d/init.d/php-fpm

chkconfig –add php-fpm

chkconfig php-fpm on

chkconfig –list php-fpm

为php-fpm提供配置文件:

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 

编辑php-fpm的配置文件:

vim /usr/local/php/etc/php-fpm.conf

配置fpm的相关选项为你所需要的值,并启用pid文件(如下最后一行):

pm.max_children = 50

pm.start_servers = 5

pm.min_spare_servers = 2

pm.max_spare_servers = 8

pid = /usr/local/php/var/run/php-fpm.pid 

接下来就可以启动php-fpm了:

service php-fpm start

可以使用netstat -tunlp 查看 9000端口 

(3)连接Apache

修改配置php-fpm的文件vim /usr/local/php/etc/php-fpm 定位到listen =192.168.197.204:9000

在该主机上新建虚拟主机目录用于存放网页文件

mkdir -pv /var/www/{frank,frankstar,kelly,kellystar}

(4)配置apache虚拟主机使用php

回到httpd主机上,建立一个目录作为虚拟主机的家目录

cd /usr/local/apache

mkdir -pv www/{frank,frankstar,kelly,kellystar}

编辑主配置文件;关闭中心主机,开启虚拟主机

vim /etc/httpd/httpd.conf 

注释 #DocumentRoot "/usr/local/apache/htdocs" 

并打开启用 Include /etc/httpd24/extra/httpd-vhosts.conf

同时定位 AddType;添加下面两行

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

并且定位至DirectoryIndex

<IfModule dir_module>

DirectoryIndex index.php index.html #添加index.php(最好添加在最前面)

</IfModule>

还要启用proxy_module proxy-fcgi_module等

LoadModule proxy_module modules/mod_proxy.so #开启

LoadModule proxy_connect_module modules/mod_proxy_connect.so

LoadModule proxy_ftp_module modules/mod_proxy_ftp.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so #开启

(5)编辑虚拟主机

<VirtualHost *:80>

ServerAdmin admin@frank.com

DocumentRoot "/usr/local/apache/www/frank"

ServerName www.frank.com

ServerAlias frank.com

ErrorLog "/usr/local/apache/logs/frank.error_log"

CustomLog "/usr/local/apache/logs/frank.access_log" combined

ProxyRequests off #关闭正向代理

ProxyPassMatch ^/(.*.php)$ fcgi://192.168.197.204:9000/var/www/frank/$1

<Directory "/usr/local/apache/www/frank">

Options none

AllowOverride None

Require all granted

</Directory>

</VirtualHost>

<VirtualHost *:80>

ServerAdmin admin@frankstar.com

DocumentRoot "/usr/local/apache/www/frankstar"

ServerName www.frankstar.com

ServerAlias frankstar.com

ErrorLog "/usr/local/apache/logs/frankstar.error_log"

CustomLog "/usr/local/apache/logs/frankstar.access_log" combined

ProxyRequests off #关闭正向代理

ProxyPassMatch ^/(.*.php)$ fcgi://192.168.197.204:9000/var/www/frankstar/$1

<Directory "/usr/local/apache/www/frankstar">

Options none

AllowOverride None

Require all granted

</Directory>

 </VirtualHost>

<VirtualHost *:80>

ServerAdmin admin@kelly.com

DocumentRoot "/usr/local/apache/www/kelly"

ServerName www.kelly.com

ServerAlias kelly.com

ErrorLog "/usr/local/apache/logs/kelly.error_log"

CustomLog "/usr/local/apache/logs/kelly.access_log" combined

ProxyRequests off #关闭正向代理

ProxyPassMatch ^/(.*.php)$ fcgi://192.168.197.204:9000/var/www/kelly/$1

<Directory "/usr/local/apache/www/kelly">

Options none

AllowOverride None

Require all granted

</Directory>

 </VirtualHost>

<VirtualHost *:80>

ServerAdmin admin@kellystar.com

DocumentRoot "/usr/local/apache/www/kellystar"

ServerName www.kellystar.com

ServerAlias kellystar.com

ErrorLog "/usr/local/apache/logs/kellystar.error_log"

CustomLog "/usr/local/apache/logs/kellystar.access_log" combined

ProxyRequests off #关闭正向代理

ProxyPassMatch ^/(.*.php)$ fcgi://192.168.197.204:9000/var/www/kellystar/$1

<Directory "/usr/local/apache/www/kellystar">

Options none

AllowOverride None

Require all granted

</Directory>

 </VirtualHost>

 然后在php服务器上的/var/www/目录下分别建立网页文件,重启服务即可。

(6)为了提高php的性能安装Xcache

在php服务器中安装,Xcache官网下载: http://xcache.lighttpd.net/wiki/Release-3.2.0 这里使用xcache-3.2.0支持php-5.6-10的稳定版

tar xf xcache-3.2.0.tar.bz2 

cd xcache-3.2.0

/usr/local/php/bin/phpize 

提示:

如果出现 Cannot find autoconf. Please check your autoconf installation and the

$PHP_AUTOCONF environment variable. Then, rerun this script.

需要安装yum -y install m4 autoconf即可

然后./configure –enable-xcache –with-php-config=/usr/local/php/bin/php-config

make && make install

安装完毕后会出现这么一行 Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-zts-20131226/

编辑php.ini,整合php和xcache:

首先将xcache提供的样例配置导入php.ini

# mkdir /etc/php.d

# cp xcache.ini /etc/php.d

说明:xcache.ini文件在xcache的源码目录中。

接下来编辑/etc/php.d/xcache.ini,找到extension开头的行,修改为如下行:

extension = /usr/local/php/lib/php/extensions/no-debug-zts-20131226/xcache.so

注意:如果php.ini文件中有多条zend_extension指令行,要确保此新增的行排在第一位。

然后重启服务即在phpinfo的页面中就可看见xcache的选项了。

5.编译安装mysql

(1)建立mysql用户及mysql用户组

groupadd -r mysql

useradd -g mysql -r -s /sbin/nologin mysql

(2)建立逻辑卷存放数据

首先建立逻辑卷组 

fdisk /dev/sda

创建一个类型为8e的分区

pvcreate /dev/sda5(该分区为新建的逻辑分区)

vgcreate frank /dev/sda5

lvcreate -n mydata -L 3G frank

mkfs -t ext4 /dev/frank/mydata 

mkdir /mydata

vim /etc/fstab 添加如下一行:

/dev/frank/mydata  /mydata ext4 defaults 0 0保存退出

mount -a

mount查看是否挂在上去了

然后在本机建立一个mysql的数据存放目录

mkdir /mydata/mysql即可

chown -R mysql.mysql /mydata/mysql

chmod o-rx /mydata/mysql

(3)解压安装cmake

mysql5.5以后的版本需要使用到cmake来编译

先安装gcc和c++ yum -y install gcc yum install gcc-c++ 

tar xf cmake-2.8.5.tar.gz 

cd cmake-2.8.5

./configure 

gmake

make install即可。

(4)编译安装mysql

tar xf mysql-5.5.21.tar.gz -C /usr/local/

cd /usr/local/mysql-5.5.21

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mydata/mysql/ -DDEFAULT_CHARSET=utf8 

-DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1

参数说明:

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql        //安装目录

-DINSTALL_DATADIR=/usr/local/mysql/data         //数据库存放目录

-DDEFAULT_CHARSET=utf8                        //使用utf8字符

-DDEFAULT_COLLATION=utf8_general_ci            //校验字符

-DEXTRA_CHARSETS=all                            //安装所有扩展字符集

-DENABLED_LOCAL_INFILE=1                        //允许从本地导入数据

提示:

Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH) 

CMake Error at cmake/readline.cmake:83 (MESSAGE):

Curses library not found.  Please install appropriate package,

remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, 

package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.

错误说的很明显,找不到Curse需要安装ncurses-devel但是需要先清空前面的安装信息。

重新编译时,需要清除旧的对象文件和缓存信息。

# make clean

# rm -f CMakeCache.txt

# rm -rf /etc/my.cnf

make && make install安装完毕.

(5)配置mysql

cd /usr/local/mysql

chown -R root:mysql .

cp support-files/my-medium.cnf /etc/my.cnf

scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/mydata/mysql

设置环境变量

vim /root/.bash_profile

PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib保存退出

source /root/.bash_profile

cp support-files/mysql.server  /etc/init.d/mysql

chmod +x /etc/rc.d/init.d/mysql

添加至服务列表:

chkconfig –add mysql

chkconfig mysql on

chkconfig –list mysql

service mysql start 即可。

netstat -tunlp可以看见3306这个端口 即代表mysql服务启动了。

(6)修改MySQL的root用户的密码以及打开远程连接

mysql -u root mysql

mysql>use mysql;

mysql>desc user;

mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "frank";  //为root添加远程连接的能力。

mysql>update user set Password = password('xxxxxx') where User='root';

mysql>select Host,User,Password  from user where User='root'; 

mysql>flush privileges;

mysql>exit

重新登录:mysql -u root -p

(7)man文档与头文件的导出

vim /etc/man.config添加一行 MANPATH /usr/local/mysql/man

ln -sv /usr/local/mysql/include/ /usr/include/mysql

echo /usr/local/mysql/lib/ > /etc/ld.so.conf.d/mysql.conf

(8)整合php

进入mysql 

use mysql;

grant all privileges on *.* to 'root'@'192.168.197.204' identified by 'frank';

select Host,User,Password from user where User='root';

flush privileges;

(9)进入php主机 编辑index.php 文件内容如下:

<?php

$link=mysql_connect('192.168.197.205','root','frank');

if($link){

echo "success..frank!";

}else{

echo "failed..frank!".mysql_error();

}

mysql_close($link);

phpinfo();

?>

出现success..frank!则成功了,若失败看失败的原因进行相关的操作!

切记,要将防火墙关闭!

(10)配置phpmyadmin

在php 主机和http主机上分别在frank目录或者随意一个虚拟主机目录中建立一个文件夹叫pma

例如在php主机中在目录/var/www/frank/pma

unzip phpMyAdmin-4.4.10-all-languages.zip

mv phpMyAdmin-4.4.10-all-languages/* ./

即可。这两台主机的操作一样。

接下来在php主机上进行对phpmyadmin的配置。

cp config.sample.inc.php config.inc.php

vim config.inc.php

主要找到

$cfg['Servers'][$i]['host']=‘192.168.197.205’ 数据库服务器的IP地址

$cfg['blowfish_secret'] = 'frank';这里的字符随意,这个主要是为了区分cookie。

然后重启三台主机上的服务即可测试。

www.frank.com/pma/index.php 就可以看见phpmyadmin 的界面了。至此lamp环境搭建完毕。

原创文章,作者:frankstar,如若转载,请注明出处:http://www.178linux.com/5848

赞 (3)
frankstarfrankstar
上一篇 2015-06-29 13:37
下一篇 2015-06-30 16:55

相关推荐

  • linux学习心得

    Linux学习心得 之前没怎么了解过linux运维,机缘巧合来到了这里,刚刚开始一脸蒙圈,或者说现在仍然是,不过最大的收获是我在这里真正认真学习了,有了一个端正的态度,一切都是好的开始。 这一周,我学习了linux的发展史,如何安装系统,一些简单的命令等。。。。下面我一一介绍一下,初学者,可能简单粗暴,多多指教! 系统安装: 1:首先用光盘进行linuxIS…

    2017-07-16
  • 马哥教育网络班22期第二周课程练习1-未闻花名

    1、Linux管理文件和目录的命令 命令 功能 命令 功能 pwd 显示当前目录 ls 查看目录下的内容 cd 改变所在目录 cat 显示文件的内容 grep 在文件中查找某字符 cp 复制文件 touch 创建文件 mv 移动文件 rm 删除文件 rmdir 删除目录 1.1 pwd命令 该命令的英文解释为print working directory(打…

    Linux干货 2016-08-22
  • iptables实践-week14

    系统的INPUT和OUTPUT默认策略为DROP; 1、限制本地主机的web服务器在周一不允许访问;新请求的速率不能超过100个每秒;web服务器包含了admin字符串的页面不允许访问;web服务器仅允许响应报文离开本机; 规则: # 周一不能访问web服务 ~]# iptables -R INPUT 1 -d 172.16.0.11 -p tcp –dp…

    Linux干货 2017-05-04
  • 第四周作业

    1、复制/etc/skel目录为/home/tuser1,要求/home/tuser1及其内部文件的属组和其它用户均没有任何访问权限。                 使用到命令chmod &nbsp…

    Linux干货 2017-02-02
  • Shell编程(1)

    Shell编程:     编程语言:机器语言、汇编语言、高级语言         高级语言:             静…

    Linux干货 2016-08-18
  • SELinux介绍

    SELinux介绍 SELinux: Secure Enhanced Linux, 是美国国家安全局(NSA=The National Security Agency)和SCC(Secure Computing Corporation)开发的 Linux的一个强制访问控制的安全模块。 2000年以GNU GPL发布, Linux内核2.6版本后集成在内核中D…

    Linux干货 2016-10-08

评论列表(1条)

  • 追马
    追马 2015-06-30 16:58

    代码高亮+图片 会使得博文可读性更佳