hello guys. i wanna shared how to install wordpress in centos.
ok lets go.
follow the step in bellow.
Step One : Requirement
you need have LEMP (Linux, Ngin, Mysql, Php) in your machine.
# yum install nginx mysql mysql-server php php-fpm php-common php-mysql php-gd php-xml php-mbstring php-mcrypt
Step Two : Download and Extracting Wordpress
# cd /opt
# wget https://wordpress.org/latest.tar.gz
next extracting the wordpress.
# tar -xvzf latest.tar.gz -C /usr/share/nginx/html/
next change permission wordpress folder
# chown -R nginx:ngingx /usr/share/nginx/html/wordpress
# chmod -R 775 /usr/share/nginx/html/wordpress/
# chmod -R 775 /usr/share/nginx/html/wordpress/
Step Three : Creat database user
now create database user.
# mysql -u root -p
mysql> CREATE DATABASE wordpress;
mysql> CREATE USER wordpressuser@localhost;
mysql> SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password");
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;
mysql> quit
mysql> CREATE USER wordpressuser@localhost;
mysql> SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password");
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;
mysql> quit
Step Four : Edit default.conf nginx
open nginx configuration and following line.
# vi /etc/nginx/conf.d/default.conf
#
# The default server
#
server {
listen 80;
server_name apsyadira.org;
location / {
root /usr/share/nginx/html/;
index index.php index.html index.htm;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html/;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /usr/share/nginx/html/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
next restart nginx and php-fpm.
# service nginx restart
# service php-fpm restart
# service php-fpm restart
Step Five : Install And Configuration Wordpress
following command to config wordpress.
# cd /usr/share/nginx/html/wordpress
# cp wp-config-sample.php wp-config.php
# chmod 777 wp-config.php
# chown nginx:nginx wp-config.php
# cp wp-config-sample.php wp-config.php
# chmod 777 wp-config.php
# chown nginx:nginx wp-config.php
open wordpress file configuration and change mysql setting
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'aboutlinux_db');
/** MySQL database username */
define('DB_USER', 'aboutlinux_user');
/** MySQL database password */
define('DB_PASSWORD', 'linuxer');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/** The name of the database for WordPress */
define('DB_NAME', 'aboutlinux_db');
/** MySQL database username */
define('DB_USER', 'aboutlinux_user');
/** MySQL database password */
define('DB_PASSWORD', 'linuxer');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
Step Six : Wordpress Install
open your browser and type any of the following address.
http://Server-IP/wordpress/
and done.
enjoy it.
1 komentar:
Write komentarNice tutorial, It's very useful for me who interested to build wordpress
Reply