环境:lamp下搭建一个博客然后实现同步这里:以wordpress为例,进行实施具体操作如下:一、环境配置1.自动获取ip地址,虚拟机设置为桥接2.[root@gjpslave~]#yumi
环境:lamp 下搭建一个博客 然后实现同步
这里:以wordpress为例,进行实施
具体操作如下:
一、环境配置
1.自动获取ip地址,虚拟机设置为桥接
2.[root@gjpslave ~]# yum install wget
#换成163的yum源:
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.save
wget mirrors.163.com/.help/CentOS5-Base-163.repo
#wget mirrors.163.com/.help/CentOS6-Base-163.repo
sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
cat /dev/null > /var/cache/yum/timedhosts.txt
yum clean all
yum makecache
3.yum -y install gcc* gcc-c++ rpm-build mysql* httpd* php* ppp openldap-devel lrzsz pam-devel wget net-snmp* ntp openssl* libgssapi* iptraf libtool-ltdl* libtool crontabs libpcap* flex byacc libpcap ncurses ncurses-devel automake autoconf libtool make traceroute wget scp openssh* setuptool mlocate pam.i686 openssl.i686 libgcrypt.i686 openssl098e.i686 glibc.i686 fping nload iftop iperf chkconfig unrar --skip-broken
yum -y update
4.系统安全
到dnspod.cn上为新的服务器指定域名
hostname xx 命名主机名
#### security ###
arp -a|grep $(/sbin/route -n|awk '$1=="0.0.0.0"{print $2}')|awk '{print $2 " " $4}'|sed 's#(##g'|sed 's#)##g' > /etc/ethers && arp -f
echo "SELINUX=disabled" > /etc/sysconfig/selinux
echo "SELINUXTYPE=targeted" >> /etc/sysconfig/selinux
setenforce 0
echo "HISTSIZE=5" >> /root/.bash_profile
chkconfig --level 2345 hplip off
chkconfig --level 2345 rpcidmapd off
chkconfig --level 2345 cups off
chkconfig --level 2345 portmap off
chkconfig --level 2345 yum-updatesd off
chkconfig --level 2345 iptables off
chkconfig --level 2345 sendmail off
killall cupsd portmap rpc.statd
service iptables stop
service yum-updatesd stop
service sendmail stop
echo "Port 2121" >> /etc/ssh/sshd_config
echo "ClientAliveInterval 9999" >> /etc/ssh/sshd_config
service sshd restart
二、博客搭建 wordpress
wget
tar zxvf
[root@gjpmaster tmp]# ls
hsperfdata_root wordpress wordpress-3.9-zh_CN.tar.gz yum.log yum_save_tx-2013-08
[root@gjpmaster tmp]# cp -a wordpress/* /var/www/html/
[root@gjpmaster ~]# useradd -d /var/www/html/ -s /sbin/nologin gjpmaster
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
[root@gjpmaster ~]# passwd gjpmaster
Changing password for user gjpmaster.
New password: 123456
BAD PASSWORD: it is too simplistic/systematic
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
mysql> create database gjpmaster;
Query OK, 1 row affected (0.04 sec)
mysql> grant all on gjpmaster.* to gjpmaster@localhost identified by "gjpmaster321";
Query OK, 0 rows affected (0.00 sec)
[root@gjpmaster ~]# mysql -u gjpmaster -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> quit
Bye
[root@gjpmaster html]# cp -a wp-config-sample.php wp-config.php
[root@gjpmaster html]# vi wp-config.php
[root@gjpmaster html]# chmod 777 -R wp-content/
[root@gjpmaster html]# vim /etc/httpd/conf/httpd.conf
Options -Indexes
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
[root@gjpmaster html]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for gjpmaster
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]
前台无法进入:
[root@gjpmaster html]# vim wp-includes/template-loader.php
三、ftp用来给博客上传下载东西
#安装
yum -y install vsftpd
#修改配置文件
vi /etc/vsftpd/vsftpd.conf
#system
local_umask=022
pasv_enable=YES
connect_from_port_20=YES
local_enable=YES
write_enable=YES
use_localtime=YES
listen=YES
listen_port=21
#security
guest_enable=NO
pam_service_name=vsftpd
tcp_wrappers=YES
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd/user_list
chroot_local_user=YES
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd.chroot_list
#log
xferlog_enable=YES
xferlog_std_format=YES
xferlog_file=/var/log/vsftpd.log
#anonymous
anonymous_enable=NO
#max_per_ip=13
#max_clients=50
#anon_world_readable_only=YES
#anon_other_write_enable=NO
#anon_mkdir_write_enable=NO
#anon_upload_enable=NO
no_anon_password=YES
#anon_max_rate=200000
#启动ftp
service vsftpd restart
#允许匿名登陆
修改配置文件 要有以下两条
no_anon_password=YES
anonymous_enable=YES
增加anonymous至/etc/vsftpd/user_list
#增加用户
两种情况 一种是有指定的目录分给指定的用户 如 将/var/ftp分给用户 wow 二是直接建立用户 目录就是/home/用户名
1.以将/var/ftp分配给wow为例
useradd -s /sbin/nologin -d /var/ftp wow // /sbin/nologin 是安全配置 意思是这个用户无法使用ssh登陆仅能使用ftp登陆 -d后面跟的是指定给此用户的目录
passwd wow //修改wow的用户名
echo wow >> /etc/vsftpd/user_list 这里一定要用>> 否则会清空里面的原来存放的用户名 只有这个列表user_list内的用户名可以登陆ftp上传文件 所以每添加一个用户名都要写入此文件
2.建立一个test用户 可以自己上传或下载文件
usreadd -s /sbin/nologin test
passwd test
echo test >> /etc/vsftpd/user_list

MySQLスロークエリを最適化するには、slowquerylogとperformance_schemaを使用する必要があります。1。LowerQueryLogを有効にし、しきい値を設定して、スロークエリを記録します。 2。performance_schemaを使用してクエリの実行の詳細を分析し、パフォーマンスのボトルネックを見つけて最適化します。

MySQLとSQLは、開発者にとって不可欠なスキルです。 1.MYSQLはオープンソースのリレーショナルデータベース管理システムであり、SQLはデータベースの管理と操作に使用される標準言語です。 2.MYSQLは、効率的なデータストレージと検索機能を介して複数のストレージエンジンをサポートし、SQLは簡単なステートメントを通じて複雑なデータ操作を完了します。 3.使用の例には、条件によるフィルタリングやソートなどの基本的なクエリと高度なクエリが含まれます。 4.一般的なエラーには、SQLステートメントをチェックして説明コマンドを使用することで最適化できる構文エラーとパフォーマンスの問題が含まれます。 5.パフォーマンス最適化手法には、インデックスの使用、フルテーブルスキャンの回避、参加操作の最適化、コードの読み取り可能性の向上が含まれます。

MySQL非同期マスタースレーブレプリケーションにより、BINLOGを介したデータの同期が可能になり、読み取りパフォーマンスと高可用性が向上します。 1)マスターサーバーレコードはBinlogに変更されます。 2)スレーブサーバーは、I/Oスレッドを介してBINLOGを読み取ります。 3)サーバーSQLスレッドは、BINLOGを適用してデータを同期させます。

MySQLは、オープンソースのリレーショナルデータベース管理システムです。 1)データベースとテーブルの作成:createdatabaseおよびcreateTableコマンドを使用します。 2)基本操作:挿入、更新、削除、選択。 3)高度な操作:参加、サブクエリ、トランザクション処理。 4)デバッグスキル:構文、データ型、およびアクセス許可を確認します。 5)最適化の提案:インデックスを使用し、選択*を避け、トランザクションを使用します。

MySQLのインストールと基本操作には、次のものが含まれます。1。mysqlをダウンロードしてインストールし、ルートユーザーパスワードを設定します。 2。sqlコマンドを使用して、createdatabaseやcreateTableなどのデータベースとテーブルを作成します。 3. CRUD操作を実行し、挿入、選択、更新、コマンドを削除します。 4.パフォーマンスを最適化し、複雑なロジックを実装するためのインデックスとストアドプロシージャを作成します。これらの手順を使用すると、MySQLデータベースをゼロから構築および管理できます。

Innodbbufferpoolは、データとインデックスページをメモリにロードすることにより、MySQLデータベースのパフォーマンスを向上させます。 1)データページは、ディスクI/Oを削減するためにBufferPoolにロードされます。 2)汚れたページは、定期的にディスクにマークされ、リフレッシュされます。 3)LRUアルゴリズム管理データページの排除。 4)読み出しメカニズムは、可能なデータページを事前にロードします。

MySQLは、インストールが簡単で、強力で管理しやすいため、初心者に適しています。 1.さまざまなオペレーティングシステムに適した、単純なインストールと構成。 2。データベースとテーブルの作成、挿入、クエリ、更新、削除などの基本操作をサポートします。 3.参加オペレーションやサブクエリなどの高度な機能を提供します。 4.インデックス、クエリの最適化、テーブルパーティション化により、パフォーマンスを改善できます。 5。データのセキュリティと一貫性を確保するために、バックアップ、リカバリ、セキュリティ対策をサポートします。

完全なテーブルスキャンは、MySQLでインデックスを使用するよりも速い場合があります。特定のケースには以下が含まれます。1)データボリュームは小さい。 2)クエリが大量のデータを返すとき。 3)インデックス列が高度に選択的でない場合。 4)複雑なクエリの場合。クエリプランを分析し、インデックスを最適化し、オーバーインデックスを回避し、テーブルを定期的にメンテナンスすることにより、実際のアプリケーションで最良の選択をすることができます。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

SecLists
SecLists は、セキュリティ テスターの究極の相棒です。これは、セキュリティ評価中に頻繁に使用されるさまざまな種類のリストを 1 か所にまとめたものです。 SecLists は、セキュリティ テスターが必要とする可能性のあるすべてのリストを便利に提供することで、セキュリティ テストをより効率的かつ生産的にするのに役立ちます。リストの種類には、ユーザー名、パスワード、URL、ファジング ペイロード、機密データ パターン、Web シェルなどが含まれます。テスターはこのリポジトリを新しいテスト マシンにプルするだけで、必要なあらゆる種類のリストにアクセスできるようになります。

メモ帳++7.3.1
使いやすく無料のコードエディター

ドリームウィーバー CS6
ビジュアル Web 開発ツール

AtomエディタMac版ダウンロード
最も人気のあるオープンソースエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ホットトピック



