当前位置: 建站>运营/SEO
本页文章导读:
▪sudo: /etc/sudoers is mode 0540, should be 0440解决 环境
RedHat Linux 9 + VWWare 7.1.2 + Putty 0.62
问题
利用非root命令执行root命令出现错误:sudo: /etc/sudoers is mode 0540, should be 0440
解决
#执行以下命令
chmod 440 /etc/sudoers
&.........
▪Windows、android连接Linux VNC 以前用XManager,但是感觉那东西非常搓,虽然不需要在远程的Linux上做额外的配置,但是很难用。他会把gnome桌面分成三个部分:上工具栏、桌面、下工具栏,这不知道为什么要这样设计,有时.........
▪centos 下 编译安装 nginx + mysql + php 服务 1、安装nginx
1.1、安装依赖包
yum install wget make gcc gcc-c++ pcre-devel openssl-devel -y
yum install ncurses-devel libtool zilib-devel -y
1.2、创建www用户
useradd www -s /sbin/nologin -M
1.3、创建目录
mkdir -p /.........
[1]sudo: /etc/sudoers is mode 0540, should be 0440解决
来源: 互联网 发布时间: 2013-10-26
环境
RedHat Linux 9 + VWWare 7.1.2 + Putty 0.62
问题
利用非root命令执行root命令出现错误:sudo: /etc/sudoers is mode 0540, should be 0440
解决
#执行以下命令 chmod 440 /etc/sudoers
由于误操作对sudoers增加了文件拥有者的可执行权限。
参考资料
http://blog.163.com/roadwalker@126/blog/static/113561841201043091711292/
@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [CSDN博客]
作者:Wentasy 发表于2013-3-21 19:28:40 原文链接
阅读:5 评论:0 查看评论
[2]Windows、android连接Linux VNC
来源: 互联网 发布时间: 2013-10-26
以前用XManager,但是感觉那东西非常搓,虽然不需要在远程的Linux上做额外的配置,但是很难用。他会把gnome桌面分成三个部分:上工具栏、桌面、下工具栏,这不知道为什么要这样设计,有时候为了点一个菜单还得从远程桌面切出来,我觉得大部分用户在使用远程桌面的时候不会在远程桌面和本地的系统中做频繁的切换。而且XManager是试用版的,破解版的又指不定有什么后门,putty的某些汉化版中就有后门。
其实在linux上只要装了桌面,并且启用了VNC服务,就可以用其他工具在windows和android上远程连接了。
windows上的VNC viewer就很不错,有免费版的:http://www.realvnc.com
安卓上的pocketclould也很不错
作者:bhq2010 发表于2013-3-21 21:38:40 原文链接
阅读:1 评论:0 查看评论
[3]centos 下 编译安装 nginx + mysql + php 服务
来源: 互联网 发布时间: 2013-10-26
1、安装nginx
1.1、安装依赖包
yum install wget make gcc gcc-c++ pcre-devel openssl-devel -y
yum install ncurses-devel libtool zilib-devel -y
1.2、创建www用户
useradd www -s /sbin/nologin -M
1.3、创建目录
mkdir -p /var/log/nginx
mkdir -p /var/tmp/nginx
1.4、解压nginx
tar xvf nginx-0.8.55.tar.gz
cd nginx-0.8.55
./configure --user=www --group=www \
--prefix=/usr/local/nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--pid-path=/var/run/nginx.pid \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/client_body_temp \
--http-proxy-temp-path=/var/tmp/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/tmp/nginx/scgi_temp
make && make install
1.5、创建目录
mkdir /usr/local/nginx/conf/conf.d
1.6、创建nginx启动脚本
#! /bin/sh
# Author: Ryan Norbauer http://norbauerinc.com
# Modified: Geoffrey Grosenbach http://topfunky.com
# Modified: Clement NEDELCU
# Reproduced with express authorization from its contributors
# chkconfig: - 85 15
# description: nginx is a World Wide Web server. It is used to server
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="nginx daemon"
NAME=nginx
DAEMON=/usr/local/nginx/sbin/$NAME
SCRIPTNAME=/etc/init.d/$NAME
# If the daemon file is not found, terminate the script.
test -x $DAEMON || exit 0
d_start() {
$DAEMON || echo -n " already running"
}
d_stop() {
$DAEMON -s quit || echo -n " not running"
}
d_reload() {
$DAEMON -s reload || echo -n " could not reload"
}
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
d_stop
echo "."
;;
reload)
echo -n "Reloading $DESC configuration..."
d_reload
echo "reloaded."
;;
restart)
echo -n "Restarting $DESC: $NAME"
d_stop
# Sleep for two seconds before starting again, this should give the
# Nginx daemon some time to perform a graceful stop.
sleep 2
d_start
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload}" >&2
exit 3
;;
esac
exit 0
·
chmod 700 /etc/init.d/nginx
chkconfig nginx on
1.7、修改nginx配置文件
cp /conf/nginx.conf /usr/local/nginx/conf
cp /conf/default.conf /usr/local/nginx/conf/conf.d/
2、安装mysql
2.1、安装依赖包
yum -y remove mysql*
yum install wget gcc gcc-c++ make -y
yum install ncurses-devel libtool zilib-devel -y
2.2、创建mysql用户
useradd -s /sbin/nologin -M mysql
2.3、创建所需目录
mkdir -p /var/run/mysql
mkdir -p /data/mysql
2.4、解压安装mysql
tar xvf mysql-5.1.66.tar.gz
cd mysql-5.1.66
#执行三条语句 解决 /bin/rm: cannot remove `libtoolT': No such file or directory
autoreconf --force --install
libtoolize --automake --force
automake --force --add-missing
./configure \
--prefix=/usr/local/mysql/ \
--localstatedir=$mysqldatadir \
--enable-assembler \
--enable-thread-safe-client \
--enable-local-infile \
--with-pthread \
--with-ssl \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
--with-mysqld-user=mysql \
--with-charset=utf8 \
--with-collation=utf8_general_ci \
--with-extra-charsets=complex \
--with-plugins=innobase,myisam,myisammrg \
--with-big-tables \
--with-unix-socket-path=/var/run/mysql/mysql.sock \
--without-docs \
--without-man \
--with-embedded-server \
--with-readline
make && make install
2.5、修改配置文件并启动数据库
cd /usr/local/mysql/
cp share/mysql/my-huge.cnf /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --user=mysql
chown -R root.mysql /usr/local/mysql
chown -R mysql.mysql /data/mysql/
chown -R mysql.mysql /var/run/mysql/
cp share/mysql/mysql.server /etc/init.d/mysql
chmod u+x /etc/init.d/mysql
chkconfig mysql on
cat > /etc/ld.so.conf.d/mysql.conf<<EOF
/usr/local/mysql/lib/mysql
EOF
ldconfig
echo "pid-file = /var/run/mysql/mysqld.pid" >> /etc/my.cnf
sed -i 's/skip-locking/skip-external-locking\nmax_connect_errors = 1844674407370954751\nconnect_timeout = 20\nskip-name-resolve/g' /etc/my.cnf
/etc/init.d/mysql start
2.6、创建mysql用户
bin/mysqladmin -u root password root
/usr/local/mysql/bin/mysql_secure_installation
3、安装php
3.1、yum依赖包安装
yum -y remove php*
yum -y install patch
yum install gd-devel libpng-devel zlib-devel freetype-devel libjpeg-devel libxml2-devel glibc-devel glib2-devel bzip2-devel libidn-devel curl-devel libtool-ltdl-devel -y
#yum install libtidy-devel gettext-devel libxslt-devel -y
#yum install giflib-devel libc-client-devel -y
yum install krb5-devel -y
yum install openldap-devel -y
yum install perl-devel -y
3.2、安装php扩展
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure --prefix=/usr/local
make && make install
tar zxvf libmcrypt-2.5.8.tar.gz
cd /src/libmcrypt-2.5.8/
./configure
make && make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make && make install
/sbin/ldconfig
tar zxvf mhash-0.9.9.9.tar.gz
cd /src/mhash-0.9.9.9/
./configure
make && make install
/sbin/ldconfig
cat > /etc/ld.so.conf.d/locallib.conf<<EOF
/usr/local/lib
EOF
ldconfig
tar zxvf mcrypt-2.6.8.tar.gz
cd /src/mcrypt-2.6.8/
./configure
make && make install
/sbin/ldconfig
3.3、安装php
tar xvf php-5.2.17.tar.gz
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
cd php-5.2.17
./configure --prefix=/usr/local/php \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-iconv-dir=/usr/local \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-discard-path \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-fastcgi \
--enable-fpm \
--enable-force-cgi-redirect \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-ldap \
--with-ldap-sasl \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--with-gettext
make ZEND_EXTRA_LIBS='-liconv'
make install
3.4、修改配置文件并启动php-fpm
cp php.ini-dist /usr/local/php1/etc/php.ini
/usr/local/php/sbin/php-fpm start
注:php-fpm启动失败的时候,可以根据错误提示进行配置文件的用户修改,或者是重新编译php。
3.5、修改nginx 配置文件,使其支持php
server
{
listen 80;
server_name lo
1.1、安装依赖包
yum install wget make gcc gcc-c++ pcre-devel openssl-devel -y
yum install ncurses-devel libtool zilib-devel -y
1.2、创建www用户
useradd www -s /sbin/nologin -M
1.3、创建目录
mkdir -p /var/log/nginx
mkdir -p /var/tmp/nginx
1.4、解压nginx
tar xvf nginx-0.8.55.tar.gz
cd nginx-0.8.55
./configure --user=www --group=www \
--prefix=/usr/local/nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--pid-path=/var/run/nginx.pid \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/client_body_temp \
--http-proxy-temp-path=/var/tmp/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/tmp/nginx/scgi_temp
make && make install
1.5、创建目录
mkdir /usr/local/nginx/conf/conf.d
1.6、创建nginx启动脚本
#! /bin/sh
# Author: Ryan Norbauer http://norbauerinc.com
# Modified: Geoffrey Grosenbach http://topfunky.com
# Modified: Clement NEDELCU
# Reproduced with express authorization from its contributors
# chkconfig: - 85 15
# description: nginx is a World Wide Web server. It is used to server
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="nginx daemon"
NAME=nginx
DAEMON=/usr/local/nginx/sbin/$NAME
SCRIPTNAME=/etc/init.d/$NAME
# If the daemon file is not found, terminate the script.
test -x $DAEMON || exit 0
d_start() {
$DAEMON || echo -n " already running"
}
d_stop() {
$DAEMON -s quit || echo -n " not running"
}
d_reload() {
$DAEMON -s reload || echo -n " could not reload"
}
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
d_stop
echo "."
;;
reload)
echo -n "Reloading $DESC configuration..."
d_reload
echo "reloaded."
;;
restart)
echo -n "Restarting $DESC: $NAME"
d_stop
# Sleep for two seconds before starting again, this should give the
# Nginx daemon some time to perform a graceful stop.
sleep 2
d_start
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload}" >&2
exit 3
;;
esac
exit 0
·
chmod 700 /etc/init.d/nginx
chkconfig nginx on
1.7、修改nginx配置文件
cp /conf/nginx.conf /usr/local/nginx/conf
cp /conf/default.conf /usr/local/nginx/conf/conf.d/
2、安装mysql
2.1、安装依赖包
yum -y remove mysql*
yum install wget gcc gcc-c++ make -y
yum install ncurses-devel libtool zilib-devel -y
2.2、创建mysql用户
useradd -s /sbin/nologin -M mysql
2.3、创建所需目录
mkdir -p /var/run/mysql
mkdir -p /data/mysql
2.4、解压安装mysql
tar xvf mysql-5.1.66.tar.gz
cd mysql-5.1.66
#执行三条语句 解决 /bin/rm: cannot remove `libtoolT': No such file or directory
autoreconf --force --install
libtoolize --automake --force
automake --force --add-missing
./configure \
--prefix=/usr/local/mysql/ \
--localstatedir=$mysqldatadir \
--enable-assembler \
--enable-thread-safe-client \
--enable-local-infile \
--with-pthread \
--with-ssl \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
--with-mysqld-user=mysql \
--with-charset=utf8 \
--with-collation=utf8_general_ci \
--with-extra-charsets=complex \
--with-plugins=innobase,myisam,myisammrg \
--with-big-tables \
--with-unix-socket-path=/var/run/mysql/mysql.sock \
--without-docs \
--without-man \
--with-embedded-server \
--with-readline
make && make install
2.5、修改配置文件并启动数据库
cd /usr/local/mysql/
cp share/mysql/my-huge.cnf /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --user=mysql
chown -R root.mysql /usr/local/mysql
chown -R mysql.mysql /data/mysql/
chown -R mysql.mysql /var/run/mysql/
cp share/mysql/mysql.server /etc/init.d/mysql
chmod u+x /etc/init.d/mysql
chkconfig mysql on
cat > /etc/ld.so.conf.d/mysql.conf<<EOF
/usr/local/mysql/lib/mysql
EOF
ldconfig
echo "pid-file = /var/run/mysql/mysqld.pid" >> /etc/my.cnf
sed -i 's/skip-locking/skip-external-locking\nmax_connect_errors = 1844674407370954751\nconnect_timeout = 20\nskip-name-resolve/g' /etc/my.cnf
/etc/init.d/mysql start
2.6、创建mysql用户
bin/mysqladmin -u root password root
/usr/local/mysql/bin/mysql_secure_installation
3、安装php
3.1、yum依赖包安装
yum -y remove php*
yum -y install patch
yum install gd-devel libpng-devel zlib-devel freetype-devel libjpeg-devel libxml2-devel glibc-devel glib2-devel bzip2-devel libidn-devel curl-devel libtool-ltdl-devel -y
#yum install libtidy-devel gettext-devel libxslt-devel -y
#yum install giflib-devel libc-client-devel -y
yum install krb5-devel -y
yum install openldap-devel -y
yum install perl-devel -y
3.2、安装php扩展
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure --prefix=/usr/local
make && make install
tar zxvf libmcrypt-2.5.8.tar.gz
cd /src/libmcrypt-2.5.8/
./configure
make && make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make && make install
/sbin/ldconfig
tar zxvf mhash-0.9.9.9.tar.gz
cd /src/mhash-0.9.9.9/
./configure
make && make install
/sbin/ldconfig
cat > /etc/ld.so.conf.d/locallib.conf<<EOF
/usr/local/lib
EOF
ldconfig
tar zxvf mcrypt-2.6.8.tar.gz
cd /src/mcrypt-2.6.8/
./configure
make && make install
/sbin/ldconfig
3.3、安装php
tar xvf php-5.2.17.tar.gz
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
cd php-5.2.17
./configure --prefix=/usr/local/php \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-iconv-dir=/usr/local \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-discard-path \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-fastcgi \
--enable-fpm \
--enable-force-cgi-redirect \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-ldap \
--with-ldap-sasl \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--with-gettext
make ZEND_EXTRA_LIBS='-liconv'
make install
3.4、修改配置文件并启动php-fpm
cp php.ini-dist /usr/local/php1/etc/php.ini
/usr/local/php/sbin/php-fpm start
注:php-fpm启动失败的时候,可以根据错误提示进行配置文件的用户修改,或者是重新编译php。
3.5、修改nginx 配置文件,使其支持php
server
{
listen 80;
server_name lo
最新技术文章: