一聚教程网:一个值得你收藏的教程网站

热门教程

Wordpress博客搬家阿里云服务器配置

时间:2022-06-25 18:57:41 编辑:袖梨 来源:一聚教程网

搬家后的其他操作:

PHP中我禁用的函数

 代码如下 复制代码

mb_send_mail,php_sapi_name,mysql_get_client_info,get_cfg_var,php_uname,exec,system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,dl,pcntl_exec,disk_total_space,disk_free_space,chown,diskfreespace,getrusage,get_current_user,getmyuid,getmypid,dl,leak,listen,chgrp,link,symlink,dlopen,proc_nice,proc_get_stats,proc_terminate,shell_exec,sh2_exec,posix_getpwuid,posix_getgrgid,posix_kill,ini_restore,mkfifo,dbmopen,dbase_open,filepro,filepro_rowcount,posix_mkfifo,putenv,sleep

Proftpd上传550的错误

目录权限不正确,用户以及用户组修改为所建FTP账户后即可

nginx下不带www域名重定向到带www的域名

 代码如下 复制代码

 if ( $host = '111com.net ') {
      rewrite ^/(.*)$ http://www.111com.net /$1 permanent;
    }

nginx下wordpress后台选项404

wordpress伪静态规则问题,编辑/usr/local/nginx/conf/wordpress.conf,修改为如下:

 代码如下 复制代码


location / {
if (-f $request_filename/index.html){
                rewrite (.*) $1/index.html break;
        }
if (-f $request_filename/index.php){
                rewrite (.*) $1/index.php;
        }
if (!-f $request_filename){
                rewrite (.*) /index.php;
        }
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

vnstat监控流量:

 代码如下 复制代码

wget https://acelnmp.googlecode.com/files/vnstat-1.10.tar.gz
tar xvzf vnstat-1.10.tar.gz
cd vnstat-1.10/
make && make install
/usr/bin/vnstat -u -i eth0
vim /etc/cron.d/vnstat
0-55/5 * * * *   root   vnstat -u -i eth0
0-55/5 * * * *   root   vnstat --dumpdb -i eth0 >/var/lib/vnstat/vnstat_dump_eth0
wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz
tar -zxf vnstat_php_frontend-1.5.1.tar.gz
mv vnstat_php_frontend-1.5.1.tar.gz vnstat

把vnstat放到网站根目录下,然后就可以通过你的域名/vnstat进行访问

编辑vnstat/config.php

 代码如下 复制代码


error_reporting(E_ALL | E_NOTICE);
 
$locale = 'en_US.UTF-8';
$language = 'en';
 
$iface_list = array('venet0');
 
$iface_title['venet0'] = 'Internal';
//$iface_title['sixxs'] = 'SixXS IPv6';
 
$vnstat_bin = '/usr/bin/vnstat';
$data_dir = '/var/lib/vnstat/';
 
$graph_format='png';
 
define('GRAPH_FONT',dirname(__FILE__).'/VeraBd.ttf');
 
define('SVG_FONT', 'Verdana');
 
define('DEFAULT_COLORSCHEME', 'light');

nginx虚拟主机配置字段

 代码如下 复制代码


log_format  111com.net   '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
server
        {
                listen       80;
                listen       443;
                server_name 111com.net www.111com.net ;
                ssl on;
                ssl_certificate /usr/local/nginx/conf/ssl/www_xj123_info.crt;
                ssl_certificate_key /usr/local/nginx/conf/ssl/xj123.KEY;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/111com.net ;
 
                if ( $host = '111com.net ') {
                rewrite ^/(.*)$ http://www.111com.net /$1 permanent;
                        }
 
                include wordpress.conf;
                location ~ .*.(php|php5)?$
                        {
                                try_files $uri =404;
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }
 
                location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }
 
                location ~ .*.(js|css)?$
                        {
                                expires      12h;
                        }
 
                access_log  /home/wwwlogs/111com.net .log  111com.net ;
        }


 

my.cnf配置

 代码如下 复制代码

[client]
port            = 3306
socket          = /tmp/mysql.sock
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log-bin=mysql-bin
binlog_format=mixed
server-id       = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout

lnmp相关信息

/root/vhost.sh //添加虚拟主机
rm /usr/local/nginx/conf/vhost/域名.conf //删除虚拟主机
LNMP相关软件安装目录
Nginx 目录: /usr/local/nginx/
MySQL 目录 : /usr/local/mysql/
MySQL数据库所在目录:/usr/local/mysql/var/
PHP目录 : /usr/local/php/
PHPMyAdmin目录 : 0.9版为/home/wwwroot/phpmyadmin/ 1.0版为 /home/wwwroot/default/phpmyadmin/ 强烈建议将此目录重命名为其不容易猜到的名字。phpmyadmin可自己从官网下载新版替换。
默认网站目录 : 0.9版为 /home/wwwroot/ 1.0版为 /home/wwwroot/default/
Nginx日志目录:/home/wwwlogs/
/root/vhost.sh添加的虚拟主机配置文件所在目录:/usr/local/nginx/conf/vhost/
PureFtpd 目录:/usr/local/pureftpd/
PureFtpd web管理目录: 0.9版为/home/wwwroot/default/ftp/ 1.0版为 /home/wwwroot/default/ftp/
Proftpd 目录:/usr/local/proftpd/
LNMP相关配置文件位置
Nginx主配置文件:/usr/local/nginx/conf/nginx.conf
/root/vhost.sh添加的虚拟主机配置文件:/usr/local/nginx/conf/vhost/域名.conf
MySQL配置文件:/etc/my.cnf
PHP配置文件:/usr/local/php/etc/php.ini
php-fpm配置文件:/usr/local/php/etc/php-fpm.conf
PureFtpd配置文件:/usr/local/pureftpd/pure-ftpd.conf
PureFtpd MySQL配置文件:/usr/local/pureftpd/pureftpd-mysql.conf
Proftpd配置文件:/usr/local/proftpd/etc/proftpd.conf
Proftpd 用户配置文件:/usr/local/proftpd/etc/vhost/用户名.conf
LNMPA相关目录文件位置
Apache目录:/usr/local/apache/
Apache配置文件:/usr/local/apache/conf/httpd.conf
Apache虚拟主机配置文件目录:/usr/local/apache/conf/vhost/
LNMP状态管理命令:
LNMP状态管理: /root/lnmp {start|stop|reload|restart|kill|status}
Nginx状态管理:/etc/init.d/nginx {start|stop|reload|restart}
MySQL状态管理:/etc/init.d/mysql {start|stop|restart|reload|force-reload|status}
Memcached状态管理:/etc/init.d/memcached {start|stop|restart}
PHP-FPM状态管理:/etc/init.d/php-fpm {start|stop|quit|restart|reload|logrotate}
PureFTPd状态管理: /etc/init.d/pureftpd {start|stop|restart|kill|status}
ProFTPd状态管理: /etc/init.d/proftpd {start|stop|restart|reload}
如重启LNMP,输入命令:/root/lnmp restart 即可,单独重启mysql:/etc/init.d/mysql restart
LNMPA状态管理命令:
LNMPA状态管理: /root/lnmpa {start|stop|reload|restart|kill|status}
Nginx状态管理:/etc/init.d/nginx {start|stop|reload|restart}
MySQL状态管理:/etc/init.d/mysql {start|stop|restart|reload|force-reload|status}
Memcached状态管理:/etc/init.d/memcached {start|stop|restart}
PureFTPd状态管理: /etc/init.d/pureftpd {start|stop|restart|kill|status}
ProFTPd状态管理: /etc/init.d/proftpd {start|stop|restart|reload}
Apache状态管理:/etc/init.d/httpd {start|stop|restart|graceful|graceful-stop|configtest|status}

热门栏目