HTTPd The pit of the server
- Configuration information in/etc/httpd/conf/httpd.conf, sometimes the comment is still in effect
- When configuring Auth, allow htpasswd all users in the prescribed files, Require VALID-UESR, allow specific users Require user user1 User2 User3 ...
- Allow group, Require group Group1 group2
Install the httpd2.41 in the CentOS6.Pre-conditions:
- Development tools<br> - Server Platform tools<br> - apr-1.5+<br> - apr-util-1.5+<br> - httpd-2.4<br> - expat-devel<br> - openssl-devel<br> - prec-devel<br> - httpd2.2(需要其httpd2.2的服务配置, 提供httpd2.4服务配置模板)
2.Operation:
1. After extracting APR,. Configure--PREFIX=/USR/LOCAL/APR; make && make install 2. After extracting Apr-util,. Configure --prefix=/usr/local/apr-util--with-apr=/usr/local/apr; Make && make install 3. Unzip httpd2.4,./configure--prefix=/usr/local/httpd24--sysconfdir=/etc/httpd24--enable-so--enable-ssl--enable-c GI--enable-rewrite--with-zlib--with-pcre=/usr/local/pcre--with-apr=/usr/local/apr--with-apr-util=/usr/local/ Apr-util--enable-modules=most--enable-mpms-shared=all--with-mpm=event 4. Copy script, cp/etc/rc.d/init.d/httpd/etc/rc.d/init.d/httpd24<br> * * * *: Simple Copy Service script is not possible, we also need to change according to the specific situation 5. Add service script, Chkconfig--add httpd24 6. Start httpd, service httpd start 7. Export man, library file (. So), header file, System environment variable 8. View the contents of the/var/run/httpd/httpd.pid and start the httpd service to run with the PID defined in the file 9. Load the corresponding module proxy_module and fcgi about 10. Close the forward proxy
Compile and install PHP on CentOS6 (Apr, Apr-util, httpd, Mariab, Zlib2-devel, Libmcrypt-devel, Libxml2-devel, Httpd-devel first installed)
./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-openssl--with-mysqli=/usr/local/mysql/ Bin/mysql_config--enable-mbstring--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir= /usr--enable-xml--enable-sockets--with-apxs2=/usr/local/httpd24/bin/apxs--with-mcrypt--with-config-file-path=/ etc--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D--with-bz2--enable-maintainer-zts
3. Make && make install
4. LoadModule PHP information will be/etc/httpd24/httpd.conf in the same time
5. In order to let httpd parse php files, add in the configuration file
addtype application/x-httpd-php. PHP
AddType application/x-httpd-ph-source. Phps
Directory Index index.php index.html
6. We compile and install the httpd docroot is in/usr/localhttpd24/htdoc, here index.php test can be
7. To add a run, compile and install XCache
Extract
Go to unzip Directory
/usr/local/php/bin/phpize: Used to generate configure files
./configure--enable-xcache--enable-xcache-coverager--enable-xcache-optimizer--with-php-config=/usr/local/php/ Bin/php-config
Make && make install
Create the/ETC/PHP.D folder and copy the Xcache.ini configuration file to this file so that PHP reads load.
8. The PHP installation used here is compiled in httpd (as a module of the httpd, so the configuration needs to indicate the relevant location of the httpd), while the installation using FPM is not required, but because PHP is related to MySQL, it is necessary to configure the location of MySQL information
HTTPd's pit.