关于伪静态收录后更改域名的两点记录
[
2011/04/03 09:00 | by admin ]
![不指定 不指定](images/weather/blank.gif)
一、更换域名后原收录的地址转到新域名
安装rewrite组件2.x 版本,如isapi_rwf_x86_2.13.1.73
在httpd.ini规则中增加如下语句:
# For ISAPI_Rewrite 2.x
RewriteCond Host: ^www\.bb\.com$
RewriteRule (.*) http\://www\.cc\.com$1 [I,RP]
如是3.x版本的则增加如下语句:
# For ISAPI_Rewrite 3.x
RewriteCond %{HTTP:Host} ^www\.bb\.com$
RewriteRule (.*) http\://www\.cc\.com$1 [NC,R=301]
二、取消伪静态转向动态,使原收录保持能访问
安装rewrite组件2.x 版本,如isapi_rwf_x86_2.13.1.73
在httpd.ini规则中的第一行增加:
[RP,L]
如是3.x版本的则增加:
[R=301,L]
安装rewrite组件2.x 版本,如isapi_rwf_x86_2.13.1.73
在httpd.ini规则中增加如下语句:
# For ISAPI_Rewrite 2.x
RewriteCond Host: ^www\.bb\.com$
RewriteRule (.*) http\://www\.cc\.com$1 [I,RP]
如是3.x版本的则增加如下语句:
# For ISAPI_Rewrite 3.x
RewriteCond %{HTTP:Host} ^www\.bb\.com$
RewriteRule (.*) http\://www\.cc\.com$1 [NC,R=301]
二、取消伪静态转向动态,使原收录保持能访问
安装rewrite组件2.x 版本,如isapi_rwf_x86_2.13.1.73
在httpd.ini规则中的第一行增加:
[RP,L]
如是3.x版本的则增加:
[R=301,L]
mysql5.5.10源码安装教程
[
2011/04/02 09:31 | by admin ]
![不指定 不指定](images/weather/blank.gif)
本内容为原创内容,转载请注明:
本文来自http://blog.gsywx.com
系统为centos5.5 32位,从官方下载mysql-5.5.10.tar.gz源码包
mysql-5.5.10.tar.gz上传到系统中的/soft/目录
cd /soft/
wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
tar zxvf cmake-2.8.4.tar.gz
cd cmake-2.8.4
./configure
make
make install
cd ../
tar zxvf mysql-5.5.10.tar.gz
cd mysql-5.5.10
cmake . -DCMAKE_INSTALL_PREFIX=/web/mysql/ -DMYSQL_DATADIR=/web/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DWITH_DEBUG=0
make && make install
cd /web/mysql/
cp support-files/mysql.server /etc/init.d/mysqld
groupadd mysql
useradd mysql -g mysql -d /dev/null -s /sbin/nologin
chown -R mysql .
chgrp -R mysql .
chmod 755 /etc/init.d/mysqld
cp support-files/my-medium.cnf /etc/my.cnf
sed -i 's/log-bin=mysql-bin/#log-bin=mysql-bin/g' /etc/my.cnf
sed -i 's/binlog_format=mixed/#binlog_format=mixed/g' /etc/my.cnf
sed -i 's/skip-federated/#skip-federated/g' /etc/my.cnf
sed -i 's/skip-locking/skip-locking\nmax_connections = 1000\nwait_timeout = 5/g' /etc/my.cnf
chkconfig --add mysqld
chkconfig mysqld on
./scripts/mysql_install_db --user=mysql
service mysqld start
./bin/mysqladmin -u root password 123654
./bin/mysql -uroot -p
mysql>use mysql;
mysql>show databases;
mysql>quit;
本文来自http://blog.gsywx.com
系统为centos5.5 32位,从官方下载mysql-5.5.10.tar.gz源码包
mysql-5.5.10.tar.gz上传到系统中的/soft/目录
cd /soft/
wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
tar zxvf cmake-2.8.4.tar.gz
cd cmake-2.8.4
./configure
make
make install
cd ../
tar zxvf mysql-5.5.10.tar.gz
cd mysql-5.5.10
cmake . -DCMAKE_INSTALL_PREFIX=/web/mysql/ -DMYSQL_DATADIR=/web/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DWITH_DEBUG=0
make && make install
cd /web/mysql/
cp support-files/mysql.server /etc/init.d/mysqld
groupadd mysql
useradd mysql -g mysql -d /dev/null -s /sbin/nologin
chown -R mysql .
chgrp -R mysql .
chmod 755 /etc/init.d/mysqld
cp support-files/my-medium.cnf /etc/my.cnf
sed -i 's/log-bin=mysql-bin/#log-bin=mysql-bin/g' /etc/my.cnf
sed -i 's/binlog_format=mixed/#binlog_format=mixed/g' /etc/my.cnf
sed -i 's/skip-federated/#skip-federated/g' /etc/my.cnf
sed -i 's/skip-locking/skip-locking\nmax_connections = 1000\nwait_timeout = 5/g' /etc/my.cnf
chkconfig --add mysqld
chkconfig mysqld on
./scripts/mysql_install_db --user=mysql
service mysqld start
./bin/mysqladmin -u root password 123654
./bin/mysql -uroot -p
mysql>use mysql;
mysql>show databases;
mysql>quit;
vsftpd2.3.4 源码安装脚本
[
2011/04/01 21:06 | by admin ]
![不指定 不指定](images/weather/blank.gif)
本内容为原创内容,转载请注明:
本文来自http://blog.gsywx.com
下载文件 (已下载 178 次)
本安装为vsftpd2.3.4源码包安装,安装环境为centos5.5 32位,安装过程中创建ftp用户为:www,密码为:123654,并打开日志,日志为:/var/log/vsftpd.log 和 :/var/log/xferlog
下面为安装脚本,也可以直接下载附件包上传后进行安装。
#!/bin/bash
clear
echo "----------------源码安装vsftpd安装程序,按任意键继续----------------"
get_char()
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}
echo ""
echo "本安装为本地用户登录FTP,并开启日志,请按任意键继续......"
char=`get_char`
mkdir -p /usr/local/man/man8/
mkdir -p /usr/local/man/man5/
tar zxvf vsftpd-2.3.4.tar.gz
cd vsftpd-2.3.4
make
make install
cp vsftpd.conf /etc/
#touch /etc/vsftpd.chroot_list
touch /etc/ftpusers
cat >>/etc/ftpusers<<EOF
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
mysql
EOF
touch /var/log/vsftpd.log
cp RedHat/vsftpd.pam /etc/pam.d/vsftpd
cp ../vsftpd /etc/rc.d/init.d/
chmod 755 /etc/rc.d/init.d/vsftpd
chkconfig --add vsftpd
chkconfig vsftpd on
sed -i 's#anonymous_enable=YES#anonymous_enable=NO#' /etc/vsftpd.conf
sed -i 's\#local_enable=YES\local_enable=YES\g' /etc/vsftpd.conf
sed -i 's\#write_enable=YES\write_enable=YES\g' /etc/vsftpd.conf
sed -i 's\#local_umask=022\local_umask=022\g' /etc/vsftpd.conf
sed -i 's\#ftpd_banner=Welcome to blah FTP service.\ftpd_banner=Welcome to xiaoyuwxzs FTP service.\g' /etc/vsftpd.conf
sed -i 's\dirmessage_enable=YES\#dirmessage_enable=YES\g' /etc/vsftpd.conf
sed -i 's\xferlog_enable=YES\#xferlog_enable=YES\g' /etc/vsftpd.conf
echo "dual_log_enable=YES" >>/etc/vsftpd.conf
echo "vsftpd_log_file=/var/log/vsftpd.log" >>/etc/vsftpd.conf
sed -i 's\connect_from_port_20=YES\#connect_from_port_20=YES\g' /etc/vsftpd.conf
echo "pam_service_name=vsftpd" >>/etc/vsftpd.conf
echo "chroot_local_user=YES" >>/etc/vsftpd.conf
echo "增加www用户组,并增加www用户,www家目录设为/home/wwwroot/"
sleep2
groupadd www
useradd www -g www -d /home/wwwroot/ -s /sbin/nologin
echo "123654" | passwd --stdin www
chown www.www /home/wwwroot/
service vsftpd start
sleep 1
echo "删除安装临时文件.............."
rm -Rf vsftpd-2.3.4
echo
echo
echo " ------------------- 如需增加新用户,请使用以下命令 -------------------"
echo "| useradd 用户名 -g 用户组 -d 用户家目录 -s /sbin/nologin |"
echo "| 如需禁用用户,增加用户名到 /etc/ftpusers |"
sleep 1
echo " -------------------------- vsftpd 安装结束! --------------------------"
echo
本文来自http://blog.gsywx.com
![](template/marshalv3m/images/download.gif)
本安装为vsftpd2.3.4源码包安装,安装环境为centos5.5 32位,安装过程中创建ftp用户为:www,密码为:123654,并打开日志,日志为:/var/log/vsftpd.log 和 :/var/log/xferlog
下面为安装脚本,也可以直接下载附件包上传后进行安装。
#!/bin/bash
clear
echo "----------------源码安装vsftpd安装程序,按任意键继续----------------"
get_char()
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}
echo ""
echo "本安装为本地用户登录FTP,并开启日志,请按任意键继续......"
char=`get_char`
mkdir -p /usr/local/man/man8/
mkdir -p /usr/local/man/man5/
tar zxvf vsftpd-2.3.4.tar.gz
cd vsftpd-2.3.4
make
make install
cp vsftpd.conf /etc/
#touch /etc/vsftpd.chroot_list
touch /etc/ftpusers
cat >>/etc/ftpusers<<EOF
root
bin
daemon
adm
lp
sync
shutdown
halt
news
uucp
operator
games
nobody
mysql
EOF
touch /var/log/vsftpd.log
cp RedHat/vsftpd.pam /etc/pam.d/vsftpd
cp ../vsftpd /etc/rc.d/init.d/
chmod 755 /etc/rc.d/init.d/vsftpd
chkconfig --add vsftpd
chkconfig vsftpd on
sed -i 's#anonymous_enable=YES#anonymous_enable=NO#' /etc/vsftpd.conf
sed -i 's\#local_enable=YES\local_enable=YES\g' /etc/vsftpd.conf
sed -i 's\#write_enable=YES\write_enable=YES\g' /etc/vsftpd.conf
sed -i 's\#local_umask=022\local_umask=022\g' /etc/vsftpd.conf
sed -i 's\#ftpd_banner=Welcome to blah FTP service.\ftpd_banner=Welcome to xiaoyuwxzs FTP service.\g' /etc/vsftpd.conf
sed -i 's\dirmessage_enable=YES\#dirmessage_enable=YES\g' /etc/vsftpd.conf
sed -i 's\xferlog_enable=YES\#xferlog_enable=YES\g' /etc/vsftpd.conf
echo "dual_log_enable=YES" >>/etc/vsftpd.conf
echo "vsftpd_log_file=/var/log/vsftpd.log" >>/etc/vsftpd.conf
sed -i 's\connect_from_port_20=YES\#connect_from_port_20=YES\g' /etc/vsftpd.conf
echo "pam_service_name=vsftpd" >>/etc/vsftpd.conf
echo "chroot_local_user=YES" >>/etc/vsftpd.conf
echo "增加www用户组,并增加www用户,www家目录设为/home/wwwroot/"
sleep2
groupadd www
useradd www -g www -d /home/wwwroot/ -s /sbin/nologin
echo "123654" | passwd --stdin www
chown www.www /home/wwwroot/
service vsftpd start
sleep 1
echo "删除安装临时文件.............."
rm -Rf vsftpd-2.3.4
echo
echo
echo " ------------------- 如需增加新用户,请使用以下命令 -------------------"
echo "| useradd 用户名 -g 用户组 -d 用户家目录 -s /sbin/nologin |"
echo "| 如需禁用用户,增加用户名到 /etc/ftpusers |"
sleep 1
echo " -------------------------- vsftpd 安装结束! --------------------------"
echo
centos系统中:nginx前端apache后端 虚拟主机的配置
[
2011/03/16 06:59 | by admin ]
![不指定 不指定](images/weather/blank.gif)
httpd.conf中增加:
Listen 81
Listen 82
Listen 83
并同时开启:
Include conf/extra/httpd-vhosts.conf
httpd-vhosts.conf配置三个站点,分别对应81 82 83 三个端口,配置如下:
#-------------------- default root open with http://ip -------------------------
<VirtualHost *:81>
ServerAdmin root@localhost
DocumentRoot "/home/wwwroot/htdocs"
ServerName 192.168.0.2
# ServerAlias locahost 127.0.0.1
# DirectoryIndex index.html index.html.var index.php
# ErrorLog "logs/error.log"
# CustomLog "logs/access.log" common
</VirtualHost>
#------------------------- virtual web www.aaa.com -----------------------------
<Directory /home/wwwroot/htdocs>
AllowOverride ALL
Allow from all
</Directory>
<VirtualHost *:82>
ServerAdmin admin@gsywx.com
DocumentRoot /home/wwwroot/htdocs/www.aaa.com
ServerName www.aaa.com
# ServerAlias *.aaa.com
# ErrorLog "logs/www.aaa.com-error.log"
# CustomLog "logs/www.aaa.com-access.log" common
</VirtualHost>
#------------------------- virtual web www.bbb.com -----------------------------
<Directory /home/wwwroot/htdocs>
AllowOverride ALL
Allow from all
</Directory>
<VirtualHost *:83>
ServerAdmin admin@gsywx.com
DocumentRoot /home/wwwroot/htdocs/www.bbb.com
ServerName www.bbb.com
# ServerAlias *.bbb.com
# ErrorLog "logs/www.bbb.com-error.log"
# CustomLog "logs/www.bbb.com-access.log" common
</VirtualHost>
nginx中的vhost.conf中配置对应的三个虚拟主机,配置如下:
upstream phppool1 {
server 127.0.0.1:81;
}
upstream phppool2 {
server 127.0.0.1:82;
}
upstream phppool3 {
server 127.0.0.1:83;
}
#------------------------------- default web dir -------------------------------
server
{
listen 80;
server_name 192.168.0.2;
root /home/wwwroot/htdocs;
location / {
proxy_pass http://phppool1;
proxy_set_header Host $host;
}
}
#-------------------------------- www.aaa.com --------------------------------
server
{
listen 80;
server_name www.aaa.com;
root /home/wwwroot/htdocs/www.aaa.com;
location / {
proxy_pass http://phppool2;
proxy_set_header Host $host;
}
}
#-------------------------------- www.bbb.com --------------------------------
server
{
listen 80;
server_name www.bbb.com;
root /home/wwwroot/htdocs/www.bbb.com;
location / {
proxy_pass http://phppool3;
proxy_set_header Host $host;
}
}
Listen 81
Listen 82
Listen 83
并同时开启:
Include conf/extra/httpd-vhosts.conf
httpd-vhosts.conf配置三个站点,分别对应81 82 83 三个端口,配置如下:
#-------------------- default root open with http://ip -------------------------
<VirtualHost *:81>
ServerAdmin root@localhost
DocumentRoot "/home/wwwroot/htdocs"
ServerName 192.168.0.2
# ServerAlias locahost 127.0.0.1
# DirectoryIndex index.html index.html.var index.php
# ErrorLog "logs/error.log"
# CustomLog "logs/access.log" common
</VirtualHost>
#------------------------- virtual web www.aaa.com -----------------------------
<Directory /home/wwwroot/htdocs>
AllowOverride ALL
Allow from all
</Directory>
<VirtualHost *:82>
ServerAdmin admin@gsywx.com
DocumentRoot /home/wwwroot/htdocs/www.aaa.com
ServerName www.aaa.com
# ServerAlias *.aaa.com
# ErrorLog "logs/www.aaa.com-error.log"
# CustomLog "logs/www.aaa.com-access.log" common
</VirtualHost>
#------------------------- virtual web www.bbb.com -----------------------------
<Directory /home/wwwroot/htdocs>
AllowOverride ALL
Allow from all
</Directory>
<VirtualHost *:83>
ServerAdmin admin@gsywx.com
DocumentRoot /home/wwwroot/htdocs/www.bbb.com
ServerName www.bbb.com
# ServerAlias *.bbb.com
# ErrorLog "logs/www.bbb.com-error.log"
# CustomLog "logs/www.bbb.com-access.log" common
</VirtualHost>
nginx中的vhost.conf中配置对应的三个虚拟主机,配置如下:
upstream phppool1 {
server 127.0.0.1:81;
}
upstream phppool2 {
server 127.0.0.1:82;
}
upstream phppool3 {
server 127.0.0.1:83;
}
#------------------------------- default web dir -------------------------------
server
{
listen 80;
server_name 192.168.0.2;
root /home/wwwroot/htdocs;
location / {
proxy_pass http://phppool1;
proxy_set_header Host $host;
}
}
#-------------------------------- www.aaa.com --------------------------------
server
{
listen 80;
server_name www.aaa.com;
root /home/wwwroot/htdocs/www.aaa.com;
location / {
proxy_pass http://phppool2;
proxy_set_header Host $host;
}
}
#-------------------------------- www.bbb.com --------------------------------
server
{
listen 80;
server_name www.bbb.com;
root /home/wwwroot/htdocs/www.bbb.com;
location / {
proxy_pass http://phppool3;
proxy_set_header Host $host;
}
}