How to create a WordPress in command line?
How to create a wordpress in command line on centmin with centos6 & nginx & mariadb
This is for wordpress with centmin, if you want to install centmin please follow up this tutorial: http://centminmod.com/download.html
Add Domain host
1 2 |
cd /usr/local/src ./centmin.sh |
Click on 2
yourdomain.com
1 2 3 4 |
vhost for yourdomain.com created successfully vhost conf file for yourdomain.com created: /usr/local/nginx/conf/conf.d/yourdomain.com.conf upload files to /home/nginx/domains/yourdomain.com/public vhost log files directory is /home/nginx/domains/yourdomain.com/log |
Add those lines if you want to use the WordPress Permalink
nano /usr/local/nginx/conf/conf.d/yourdomain.com.conf
Add in locations:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# WordPress single blog rules. # Designed to be included in any server {} block. # This order might seem weird - this is attempted to match last if rules below fail. # http://wiki.nginx.org/HttpCoreModule location / { try_files $uri $uri/ /index.php?$args; } # Add trailing slash to */wp-admin requests. rewrite /wp-admin$ $scheme://$host$uri/ permanent; # Directives to send expires headers and turn off 404 error logging. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 24h; log_not_found off; } |
Download wordpress into public directory
1 2 3 4 5 6 7 |
#navigate to the website directory #for example cd /home/nginx/domains/yourdomain.com/public wget -c http://wordpress.org/latest.zip unzip latest.zip rm -rf latest.zip mv wordpress/* ./ rm -rf wordpress |
Add MYSQL Database and user
1 2 3 4 5 |
CREATE DATABASE yourdatabase; CREATE USER 'youruser'@'localhost' IDENTIFIED BY 'yourpassword'; GRANT USAGE ON yourdatabase.* to youruser@localhost IDENTIFIED BY 'yourpassword'; GRANT ALL ON yourdatabase.* to youruser@localhost; |
Configure wordpress
go to your domain for example:
http://www.yourdomain.com/
Resource: http://centminmod.com/download.html