LNMP notes: Domain redirection, read and write permissions, display WP Theme, GMT

Source: Internet
Author: User

Write the side of the note, will be used in the future.

REDIRECT xxx.com to www.xxx.com

1. Open/usr/local/nginx/conf/vhost/The domain name of your website. com.conf 2. See if server_name in the original server{} already contains two domain names

1
server_name www.xxx.com xxx.com;

3. If so, delete the xxx.com first and then add it at the end of the file

1234
server {server_name Xxx.com;rewrite ^ (. *) $ http://www.xxx.com$1 permanent;}

4. Save the exit and then restart Nginx:

1
/etc/init.d/nginx restart

Final effect: All xxx.com pages will be 301 to www.xxx.com and vice versa

Give file and directory writable permissions to the root directory of the Web site

When we configure LNMP, we usually operate on the root account, and all files/folders are owned by root. If you keep this state, then we will not be able to perform many operations on behalf of the FTP account-for example, any form of writing, as well, WordPress and other programs can not upload attachments. If your site is in the same directory as/home/wwwroot, execute the following command

12
Chmod-r 755/home/wwwrootchown-r Www/home/wwwroot

Note: The chown directive assigns all permissions for the following directories to the WWW user. In front of setting up FTP you have set the UID and GID of FTP account to WWW group.

Let LNMP display the installed WordPress theme

Open PHP configuration file php.ini

1
Vim/usr/local/php/etc/php.ini

Enter the Scandir return, you can navigate to Scandir that is disable_functions beginning of the line of code, delete Scandir, save quit restart PHP service

1
/ETC/INIT.D/PHP-FPM restart

Get.

Modify server Time to GMT

The command to set the system time to January 16, 2013 is as follows. Date-s 01/16/2013 the command to set the system time to 2:18 P.M. 9 seconds is as follows. Date-s 14:18:09 After the modification can be performed: Clock-w, forcing the time to write to the CMOS.

Http://www.cmhello.com/lnmp-301.html

LNMP notes: Domain redirection, read and write permissions, display WP Theme, GMT

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.