Elizabeth
Engineer
Engineer
  • UID625
  • Fans4
  • Follows1
  • Posts68
Reads:3414Replies:2

[Share]9-minute Course on Wordpress Setting in Alibaba Cloud Server

Created#
More Posted time:Oct 9, 2016 13:15 PM
Download wordpress
The latest download address of wordpress:https://wordpress.org/latest.zip; unzip the downloaded file, and rename the file to the website name.
unzip latest.zip
mv latest idoras.com
This way, you can get an item marked with the domain name.
Configure Nginx
To browse your website, you need to configure and enable the Nginx web service.
The default path of the Nginx configuration file is /etc/nginx/nginx.conf, as shown below.
user test;
worker_processes 4;
pid /var/run/nginx.pid;

events {
  worker_connections 65535;
  multi_accept on;
  use epoll;
}

http {
  sendfile on;
  client_max_body_size 8m;

  tcp_nopush off;
  tcp_nodelay on;

  limit_conn_zone $binary_remote_addr zone=one:100m;
  keepalive_timeout 15;
  types_hash_max_size 2048;

  include /etc/nginx/mime.types;
  default_type application/octet-stream;


  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

  #include /etc/nginx/passenger.conf;

  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log;

  gzip on;
  gzip_disable "msie6";

  gzip_vary on;
  gzip_proxied any;
  gzip_comp_level 6;
  gzip_buffers 16 8k;
  gzip_http_version 1.1;
  gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

  include /etc/nginx/conf.d/*.conf;
}


The first line is user test; it is required to specify the Nginx user and enable Nginx virtual domain name configuration, while the last line can be kept the same (include /etc/nginx/conf.d/*.conf); each configuration file can have an individual domain name, to allow monitoring of several domain names by one server.
The virtual host configuration file of Domino webmaster network is /etc/nginx/conf.d/idoras.com.conf, as shown below.
server {
  listen 80;
  server_name idoras.com;
  rewrite ^/(.*)$ https://idoras.com/$1 permanent;
}

server {
  listen 80;
  server_name www.idoras.com;
  rewrite ^/(.*)$ https://idoras.com/$1 permanent;
}

server {
  listen 443 ssl;
  server_name www.idoras.com;
  ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
  ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
  rewrite ^/(.*)$ https://idoras.com/$1 permanent;
}

server {
  listen 443 ssl;
  server_name idoras.com;

  location /nginx_status {
    allow 127.0.0.1;
    deny all;
    stub_status on;
  }

  root /home/test/sites/idoras.com;

  access_log /var/log/nginx/idoras.com/access.log;
  error_log /var/log/nginx/idoras.com/error.log;

  ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
  ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;

  limit_conn  one  300;

  if (-f $document_root/system/maintenance.html) {
    rewrite ^(.*)$ /system/maintenance.html break;
  }

  location ~ (/assets|/system|/avatar.png|/favicon.ico|/*.txt) {
    access_log        off;
    expires           14d;
    gzip_static on;
    add_header  Cache-Control public;
  }

  location / {
    if ($host != 'idoras.com') {
      rewrite ^/(.*)$ https://idoras.com/$1 permanent;
    }
    try_files $uri $uri/ /index.php?$args;
    index index.php;
    include hhvm.conf;
    proxy_redirect     off;
    proxy_set_header   Host $http_host;
    proxy_set_header   X-Forward-For $remote_addr;
    proxy_set_header   Host $host;
    proxy_set_header   X-Forwarded-Host $host;
    proxy_set_header   X-Forwarded-Server $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_buffering    on;
    proxy_http_version 1.1;
    proxy_set_header   Upgrade $http_upgrade;
    proxy_set_header   Connection "Upgrade";
    proxy_set_header   X-Forwarded-Proto https;
    gzip on;
  }
}


At the test stage, nginx ssl certificate is acceptable, while Nginx local certificate and letsencrypt free certificate are optional. For formal online operation, letsencrypt installation certificate must be used.
After configuration is completed, sudo nginx can be executed to enable Nginx service. At present, website access is not available, because hhvm is not configured.
Configure hhvm
After referring to the Course on Configuration of Alibaba Cloud Server, hhvm is started by default, but configuration and modification are also required to successfully operate the website.
The command to start hhvm is set in "/etc/init.d/hhvm". Open the file based on vi, find the **RUN_AS_USER=** line, and modify the parameter to the correct administrator name. Without the correct user privileges, a 403 prompt will appear after hhvm is enabled, because the user operating hhvm has no right to access the current web directory.
Configure mysql
A root user will be generated after installing MySQL, and the default password is blank if no revision is made to the password. User name and password are required when installing WordPress. Like Linux server, it is also recommended to create a new user and grant proper rights rather than directly use the root user.
Input "mysql -uroot -p" at the shell terminal to log in to MySQL server.
CREATE USER 'test'@'localhost' IDENTIFIED BY 'pass';
GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost';


Thus, a new database can be created by using the user name ("test") and password ("pass") when installing WordPress.

digitalfusion
Intern
Intern
  • UID2503
  • Fans0
  • Follows0
  • Posts1
1st Reply#
Posted time:Apr 15, 2017 4:31 AM
Hi Elizabeth,

Sorry to bother you, but I seem to be in a bit over my head. I bought the Web Starter Package with the Wordpress on LEMP CentOS7.2 64bits image, selected during setup. I guess I assumed this was more of a ready-to-go solution, but I've found two issues I have not been able to get a solution to.

Perhaps you can point me in the right direction, a tutorial perhaps, or can recommend someone who can help?

I'm being tossed between the image supplier (isv) and the Alibaba Cloud hosting support I bought with neither offering solutions, so I'm stuck.

Everything is working with WordPress except I have two issues I need answers/solutions to:


1.)  I am able to FTP into the Instance using the root user and password I set.

However, I am unable to locate the web-root of the site and WordPress install.

Per the database, it is at /data/wwwroot/default/

However, when I FTP in, there is no /data directory to be seen.


2.)  WordPress itself is working, and I am able to install and/or upgrade plugins and themes.

However, WordPress cannot upgrade itself — i.e. it's core files — without FTP login information.

When I use the instance's root account FTP information it errors.


For both for the above, does there need to be a different FTP account set up?

If so, how does one do that?

shhanshan
Forum Moderator
Forum Moderator
  • UID105
  • Fans5
  • Follows0
  • Posts343
2nd Reply#
Posted time:Apr 18, 2017 12:22 PM
You can get support detail from page:
https://intl.aliyun.com/marketplace/product/Wordpress_on_LEMP_CentOS7_2_64bits-cmjj011736.htm

Support Details
Email support: support@infinityglobals.com
Official Support Page: http://www.infinityglobals.com/aliimages/
More information please reference company website: www.infinityglobals.com
AlibabaCloud.com
Guest