lamp5-Miscellaneous +discuz3.2

Source: Internet
Author: User

The content of this section is more miscellaneous, the main thing is to integrate the previous knowledge, and then install a discuz for the back of the experiment to do a preparation. (Perhaps these are a bit boring, no way, the environment did not take a good experiment also do not go down, if you do not want to install Discuz, can also be replaced by WordPress, etc.) PS: After the experiment is more, just sorting out the order of waste a lot of time, try to pick only some important or commonly used to speak, Here is also listed in advance of the following will be introduced: (temporarily only Apache, MySQL tuning, slow query, PHP put to later introduction)--3 Virtual host configurations: domain-based ,IP,Port --user authentication--Domain Jump + filter Other malicious domain bindings--Custom Access logs + error logs (for example, many meaningless records do not need to be logged)--Log Cutting--Configure static file caching--Anti-theft chain--access control (very basic is also important, but also compare the difference between 2.2 and 2.4 )--URL redirection (e.g. through rewrite anti-crawler, etc.)--Web Page view Server-info, Server-status (here must do the access control, through the Web page can be more convenient to view the server status and configuration information)--...
Miscellaneous:

1, 1) for Apache, parsing PHP only needs to call the Libphp5.so module, no longer need PHP program (that is, even if you delete/usr/local/php Apache will not have any effect),

Two are actually the same size.

2) In fact, PHP and Web server in conjunction with another common way: through the fastcgi combination, (such as Nginx and PHP in this form) this way PHP must open a service php-fpm, waiting for Nginx request When the user requests the dynamic page, Nginx interacts with PHP-FPM and then returns the result of the interaction to the user;

Therefore, the performance of Apache is superior to nginx when processing a large number of dynamic requests, and when the user requests dynamic content, Apache calls the Libphp5.so module to process the request, and then returns the result, because it is an internal module, so support for PHP is very good, and there is no need to communicate with other processes, so the cost is relatively small;

On the contrary, because Apache is a module combined with PHP (while Apache also loaded a lot of other modules), and Nginx is lightweight, so if only a large number of static page requests, Nginx performance is much better than Apache.

3) In fact, PHP is just a CGI program (Cgi:common Gateway Interface Public Gateway Interface), the program used to process Web server dynamic requests is called CGI programs, such as Perl, Python, C, C + +, etc. can also be called CGI programs;
Although there are many web frameworks like Perl and Python, they are not designed to be used to develop CGI, and it is more cumbersome to handle web dynamic requests than PHP.
Apache, of course, also supports CGI, which is developed using other programs, but is now relatively less used, such as:

# 2, add/path/to the environment variable path (remember to MySQL, Apache, PHP, etc. join path)  # a better method should be to customize the text to/etc/profile.d/and then source into the path, This will also automatically load the  [Root www]# vim/etc/ profile.d/path.sh  export path  = $PATH  :/path/ [Root @csr  www] #./etc/profile.d/path.sh # '. ' <=> ' source '  # 3, view nginx compilation parameters: # nginx-v  view Apache compilation parameters: # cat/usr/ Local/apache2/build/config.nice  View PHP compilation parameters: # php-i |grep--color "Configure Command " view MySQL compilation parameters: # cat/usr/local/mysql/bin/mysqlbug | grep--color "Configure_line=" (This is not compiled, so the result is empty)   
Installing Discuz3.2
1.Download Unzip discuz to/data/www# mkdir/data/www# cd/data/www# wget Http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip# unzip Discuz_x3.2_sc_gbk.zip# mv upload/*.2, configure the virtual host# vim/usr/local/apache2/conf/httpd.conf Uncomment the virtual host configuration file (remove the previous ' # ')Include conf/extra/httpd-vhosts. conf# vim/usr/local/apache2/conf/extra/httpd-vhosts.conf Join:<virtualhost *: the> DocumentRoot"/data/www"ServerName www. CSR. com</VirtualHost> commenting out other virtual host configurations3Www. CSR. comDomain name is not their own, and go to need to use domain name testing how to do? Edit/etc/hosts file Join:127.0. 0. 1Www. CSR. comReason: DNS domain name resolution when the system will first to/etc/hosts inside to see if there is no corresponding IP address, the next will go to the public network DNS resolution;/etc/hosts priority is higher than DNS because/etc/nsswitch. confInside the set:hosts:Files Dnsfiles in front of DNS, so the parsing will be the first to find files. Similarly, windows to think of the browser above the test can also be added, but the Windows path hidden deep:C:\windows\system32\drivers\etc\hosts4, browser input www. CSR. comStart the installation, because the start selection is GBK encoded, so garbled may appear:



这样就显示正常了5、开始安装时提示目录不存在、不可写,那是因为权限还没给全

# 根据提示的错误给daemon相应的权限,httpd默认用户在httpd.conf的这地方定义(不过没必要去改默认用户的):<IfModule unixd_module>    User daemon    Group daemon</IfModule># cd /data/www# chown -R daemon:daemon  data  uc_server/data  uc_client/data config 6、添加discuz数据库和一个用户,并把权限授权与他# mysql -uroot -p123456‘csr‘@‘localhost‘‘xxxxxx‘;mysql> quit# mysql -ucsr -pxxxxxx  验证是否可以登录7、接着就下一步无脑安装了...

lamp5-Miscellaneous +discuz3.2

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.