• Notes when using the functions "Add website to VPS"

  • Members help others by posting how to use VPSSIM.

Members help others by posting how to use VPSSIM.
 #1632  by nguyenoanh
 14 Aug 2018 16:33
When using all the functions "Add website to VPS", you should pay attention:

+ VPSSIM support both WWW and Non_WWW domains, so if you want to use the domain form, add that form to VPS. VPSSIM auto config redirect to non_www to www or non_www to www belong to the domain form you added to VPS.

+ VPSSIM does not support sub-domain for domain and also cannot do this. To create sub-domain for domain, you must point sub-domain to the VPS's IP and use the function Add Website to VPS to add domain into VPS.

+ After upload code to /home/domain.com/public_html, you should run the function Fix Error Chmod, chown (VPSSIM Menu ==> Add Website & Code ==> Fix Error Chmod, chown ) to set owner for all the code. If you do not do this, maybe website has error when running.

If you do not want to use the above function, you can use this command to do:
Code: Select all
chown -R nginx:nginx /home/doman.com/public_html
+ Do not like Apache webserver using .htacess, VPSSIM running with Nginx webserver, so belong to the code you use, you should config vhost right for it.
The vhost (virtual host) of the domain in /etc/nginx/conf.d/domain.com.conf

+ You can customize the error 402, 403, 502 .... by following these steps:

- Edit content all files in /home/domain.com/errorpage_html . Do not change the name of all files.

- Edit vhost /etc/nginx/conf.d/domain.com.conf

Change:
Code: Select all
# Error Page
#error_page 403 /errorpage_html/403.html;
#error_page 404 /errorpage_html/404.html;
#error_page 405 /errorpage_html/405.html;
#error_page 502 /errorpage_html/502.html;
#error_page 503 /errorpage_html/503.html;
#error_page 504 /errorpage_html/504.html;
#location ^~ /errorpage_html/ {
#   internal;
#    root /home/domain.com;
#    access_log              off;
#}
To:
Code: Select all
# Error Page
error_page 403 /errorpage_html/403.html;
error_page 404 /errorpage_html/404.html;
error_page 405 /errorpage_html/405.html;
error_page 502 /errorpage_html/502.html;
error_page 503 /errorpage_html/503.html;
error_page 504 /errorpage_html/504.html;
location ^~ /errorpage_html/ {
  internal;
   root /home/domain.com;
   access_log              off;
}
Check Nginx:
Code: Select all
nginx -t
If it okay:
Code: Select all
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Khởi động lại Nginx để thay đổi có hiệu lực:
Code: Select all
service nginx restart
Get 25 USD Free To USE VPSSIM