Wordpress installation steps on Centos 6.3


1. ftp
 yum install vsftpd ftp
 chkconfig vsftpd on
 service vsftpd start
 
 配置防火墙端口
 vi /etc/sysconfig/iptables
 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
 service iptables start
 
 修改配置
 vi /etc/vsftpd/vsftpd.conf
 anonymous_enable=no
 chroot_list_enable=YES
 chroot_list_file=/etc/vsftpd/chroot_list
 
 增加用户ftpuser,指向目录(例如/home/wwwroot/ftpuser或者/usr/share/wordpress),禁止登录SSH权限
 useradd -d /home/wwwroot/ftpuser -g ftp -s /sbin/nologin ftpuser
 passwd ftpuser
 
 vi /etc/vsftpd/chroot_list
 ftpuser(一个用户一行)
 
2. apache httpd
 yum install httpd
 vi /etc/httpd/conf/httpd.conf
 ServerName localhost(OR IP地址):80
3. mysqld
 yum install mysqld
 mysqld_safe --skip-grant-table
 OR
 mysql -u root mysql
  mysql> delete from user where USER='';
 或者 mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
 mysql> FLUSH PRIVILEGES;
 service mysqld restart
 
 设置wordpress用户和数据库
 mysql -u root –p
 mysql>  CREATE DATABASE wordpress;
 mysql> GRANT ALL PRIVILEGES ON wordpress.* TO “wordpress”@”localhost” IDENTIFIED BY “wordpress”;
 mysql> FLUSH PRIVILEGES;
 mysql> exit
 
4. Linux setting(SELinux,User,Chown,chmod,iptables)

 SELinux(不设置会引起ftp访问不了)
  Vi /etc/selinux/config
 SELINUX=disabled
 SELINUXTYPE=targeted
 User:
 groupadd  apache
 useradd  apache:apache
 passwd  apache

 Chown/chmod:
   将wordpress根目录(/usr/share/wordpress)设置权限和用户
   Chown –R apache:apache /usr/share/wordpress
   Chmod –R 775 /usr/share/wordpress
  
 Iptables:
 -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 21 -j ACCEPT
 /etc/rc.d/init.d/iptables save (Or Status)
 
 自动配置服务
 # /sbin/chkconfig –-add mysqld
 # /sbin/chkconfig mysqld on
 Chkconfig httpd on
 Chkconfig vsftpd on

5. PhpMyAdmin
 yum install phpmyadmin
 
 vi /etc/httpd/conf.d/phpmyadmin.conf
 # Order Deny,Allow 
 # Deny from all 
 # Allow from 127.0.0.1 
 
 vi /usr/share/phpmyadmin/config.inc.php
 $cfg['Servers'][$i]['auth_type'] = ‘http’;
 
 http://localhost/phpMyAdmin
 
6. EPEL(企业版Linux 附加软件包)
 yum install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
 
7. Wordpress
 yum install wordpress
 
 vi /etc/httpd/conf.d/wordpress.conf
 <Directory /usr/share/wordpress>
   AllowOverride Options
   <IfModule mod_authz_core.c>
  # Apache 2.4
  Require local
   </IfModule>
   <IfModule !mod_authz_core.c>
  # Apache 2.2
  Order Deny,Allow
  Deny from All
 #    Allow from 127.0.0.1
 #    Allow from ::1
  Allow from All
  </IfModule>
 </Directory>
 
 vi /usr/share/wordpress/wp-config.php
 #mysql setting
 /** The name of the database for WordPress */
 define('DB_NAME', 'wordpress');
 /** MySQL database username */
 define('DB_USER', 'wordpress');
 /** MySQL database password */
 define('DB_PASSWORD', 'wordpress');
 /** MySQL hostname */
 define('DB_HOST', 'localhost');

 #ftp setting
 define('FS_METHOD', 'ftpext');
 define('FTP_BASE', '/usr/share/wordpress/');
 define('FTP_CONTENT_DIR', '/usr/share/wordpress/wp-content/');
 define('FTP_PLUGIN_DIR ', '/usr/share/wordpress/wp-content/plugins/');
 define('FTP_USER', 'apache');
 define('FTP_PASS', 'haofan@1');
 define('FTP_HOST', '192.168.34.88');
 http://georgebutler.com/blog/fixing-wordpresss-auto-update-centos-linux/
  
  http://localhost/wordpress/wp-admin.php
  http://localhost/wordpress
8. Wordpress 中文版
 Download 英文版对应的中文版,解压;
 将中文版wp-content/ languages目录放置英文版的wp-content目录下;
 chown/chmod –R languages;
 vi /usr/share/wordpress/wp-config.php
 define (’WPLANG’, ‘zh_CN’)

参考:
http://www.centos.bz/2011/03/centos-install-vsftpd-ftp-server/
http://www.danscourses.com/Linux-Fundamentals/how-to-install-wordpress-in-centos-linux.html
http://www.esecuredata.com/2012/01/08/worpress-installation-and-configuration-on-centos/ (比较全面)
http://jackiechen.org/2012/11/30/install-wordpress-on-centos-6-3/

相关推荐