342132123 发表于 2016-12-5 09:13:02

CentOS7-LAMP架构搭建

yum -y install php php-mysql httpd mariadb-servervim /var/www/html/index.php
<?php
phpinfo(); ?>systelctl restart httpd ;systemctl enabled httpd ;Systelctl restart mariadb-server ;systemctl enabled mariadb-serverFirefox 访问localhostmysqlMariaDB [(none)]> GRANT ALL ON testdb.* TO testuser@'%' IDENTIFIED BY 'testpass';
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> exit
Bye
# mysql -u testuser -h 主机地址 -p                Enter password:testpass
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]>exitBye
vim /var/www/html/index.php<?php$conn = mysql_connect(“主机地址”,”testuser”,”testpass”);if ($conn)echo “OK”;elseecho “NO”;?>

上传wordpress-3.3.1-zh_CN.zip到根目录()
unzip wordpress-3.3.1-zh_CN.zip# lsbin   etc   lib64opt   run   sysvarboothomemediaprocsbintmpwordpressdev   lib   mnt    rootsrv   usrwordpress-3.3.1-zh_CN.zip# mv wordpress /var/www/html/# cd /var/www/html/# cd wordpress/# lsindex.php             wp-config-sample.phpwp-pass.phplicense.txt         wp-content            wp-register.phpreadme.html         wp-cron.php         wp-settings.phpwp-activate.php       wp-includes         wp-signup.phpwp-admin            wp-links-opml.php   wp-trackback.phpwp-app.php            wp-load.php         xmlrpc.phpwp-blog-header.php    wp-login.phpwp-comments-post.phpwp-mail.php# cp wp-config-sample.php wp-config-sample.php.back# mv wp-config-sample.php wp-config.php# lsindex.php             wp-config.php            wp-mail.phplicense.txt         wp-config-sample.php.backwp-pass.phpreadme.html         wp-content               wp-register.phpwp-activate.php       wp-cron.php                wp-settings.phpwp-admin            wp-includes                wp-signup.phpwp-app.php            wp-links-opml.php          wp-trackback.phpwp-blog-header.php    wp-load.php                xmlrpc.phpwp-comments-post.phpwp-login.php# mysqlWelcome to the MariaDB monitor.Commands end with ; or \g.Your MariaDB connection id is 10Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> GRANT ALL ON wpdb.* TO wpuser@'%' IDENTIFIED BY 'wppass';Query OK, 0 rows affected (0.02 sec)MariaDB [(none)]> create database wpdb;Query OK, 1 row affected (0.02 sec)MariaDB [(none)]> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> exitBye# vim wp-config.php // ** MySQL 设置 - 具体信息来自您正在使用的主机 ** ///** WordPress 数据库的名称 */define('DB_NAME', 'pwdb');/** MySQL 数据库用户名 */define('DB_USER', 'pwuser');/** MySQL 数据库密码 */define('DB_PASSWORD', 'pwpass');/** MySQL 主机 */define('DB_HOST', '主机地址');

火狐访问主机:localhost/wordpress,按需求安装wordpress



页: [1]
查看完整版本: CentOS7-LAMP架构搭建