Вы находитесь на странице: 1из 4

install CentOS 6.

6
ifup eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=yes #change from no
vi /etc/selinux/config
SELINUX=disabled #change from enforcing
yum groupinstall "Development Tools"
cd /usr/src/
wget http://ftp.vim.org/security/openssl/openssl-1.0.2d.tar.gz
tar xzf openssl-1.0.2d.tar.gz
cd openssl-1.0.2d
./config --prefix=/usr/local --openssldir=/usr/local/openssl -fPIC no-gost no-sh
ared no-zlib
make
make depend
make install
yum install pcre-devel.x86_64
groupadd apache
useradd apache -g apache
cd /usr/src/
wget http://archive.apache.org/dist/httpd/httpd-2.4.17.tar.gz
tar xzf httpd-2.4.17.tar.gz
./configure --prefix="/usr/local/httpd" --enable-module=so --enable-mods-shared=
"core http_core mod_authn_file mod_authn_core mod_authz_host mod_authz_user mod_
authz_core mod_authnz_ldap mod_access_compat mod_auth_basic mod_socache_shmcb mo
d_filter mod_deflate mod_mime util_ldap mod_log_config mod_logio mod_env mod_exp
ires mod_headers mod_setenvif mod_proxy mod_session event mod_unixd mod_autoinde
x mod_cgid mod_dir mod_alias mod_rewrite mod_ssl" --with-included-apr --with-ss
l=/usr/local/ --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc/httpd
make
make install
cd modules/filters/
vi /usr/bin/apr-1-config
LDFLAGS="-lz" #add -lz
/usr/bin/apxs -c mod_deflate.c
cp .libs/mod_deflate.so /usr/local/httpd/modules/
cd /usr/src/
wget http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz
tar xzf mod_fastcgi-current.tar.gz
cd mod_fastcgi-2.4.6
wget wget https://raw.github.com/ByteInternet/libapache-mod-fastcgi/byte/debian/
patches/byte-compile-against-apache24.diff
patch -p1 < byte-compile-against-apache24.diff
cp Makefile.AP2 Makefile
make top_dir=/usr/local/httpd
mv /usr/local/httpd/cgi-bin/test-cgi /usr/local/httpd/cgi-bin/php-cgi
vi /etc/httpd/httpd.conf
Add
Include /etc/httpd/conf.d/*.conf
LoadModule fastcgi_module modules/mod_fastcgi.so
LoadModule deflate_module modules/mod_deflate.so

Change
Listen 80 -> Listen 8080
Add at the end
<IfModule mod_fastcgi.c>
ScriptAlias /fcgi-bin/ "/usr/local/httpd/cgi-bin/"
FastCGIExternalServer /usr/local/httpd/cgi-bin/php-cgi -host 127.0.0.1:9
000 -pass-header Authorization
AddHandler php-fastcgi .php .phtml
Action php-fastcgi /cgi-bin/php-cgi
</IfModule>
Uncomment
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule actions_module modules/mod_actions.so
<IfModule dir_module>
DirectoryIndex index.html index.php # Add index.php
</IfModule>
cp /usr/sbin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
Add these lines after #!/bin/sh
#
#
#
#
#
#
#
#
#

Startup script for the Apache Web Server


chkconfig: - 85 15
description: Apache is a World Wide Web server. It is used to serve
HTML files and CGI.
processname: httpd
pidfile: /usr/local/apache/logs/httpd.pid
config: /usr/local/apache/conf/httpd.conf

cd ~
wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch
.rpm
rpm -ivh epel-release-6-8.noarch.rpm
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.
x86_64.rpm
rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
yum install perl-devel libxml2-devel bzip2-devel curl-devel libpng-devel libjpeg
-devel db4-devel libXpm-devel gmp-devel libc-client-devel openldap-devel unixODB
C-devel sqlite-devel aspell-devel net-snmp-devel libxslt-devel t1lib-devel.x86_
64 libtidy libtidy-devel freetype-devel libmcrypt-devel.x86_64 memcached varnish
telnet
groupadd www-data
useradd www-data -g www-data
cd /usr/src/
http://ar2.php.net/distributions/php-5.4.37.tar.gz
tar xzf php-5.4.37.tar.gz

./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/et


c/php
--with-pear --with-zlib --with-zlib-dir --with-freetype-dir --enable-mb
string --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with
-mcrypt --with-zlib --with-gd --disable-rpath --enable-inline-optimization --wit
h-bz2 --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable
-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mys
ql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf
--with-openssl=/usr/local/ --with-fpm-user=www-data --with-fpm-group=www-data -with-libdir=/lib64 --enable-ftp --with-kerberos --with-gettext --enable-fpm --w
ith-fpm-user=www-data --with-fpm-group=www-data --includedir=/usr/include --libd
ir=/usr/lib64
make
make install
cp php.ini-production /etc/php/php.ini
cp /etc/php/php-fpm.conf.default /etc/php/php-fpm.conf
cp ./sapi/fpm/init.d.php-fpm.in /etc/init.d/php-fpm
pecl install memcache
pecl install zendopcache-7.0.2
vi /etc/php/php.ini
extension=memcache.so
zend_extension=/usr/lib64/extensions/no-debug-non-zts-20100525/opcache.so
opcache.memory_consumption=256
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
cp /etc/php/php.ini /usr/lib64/
vi /etc/varnish/default.vcl
backend default {
.host = "127.0.0.1";
.port = "8080"; #change from "80"
}
vi /etc/sysconfig/varnish
VARNISH_LISTEN_PORT=80 #change from "6081"

vi /etc/httpd/conf.d/onecall.conf
<VirtualHost *:8080>
ServerName onecall.hostname.loc
DocumentRoot /var/www/onecall/public/hostname
<Directory /var/www/onecall/public/hostname>
AllowOverride All
Require all granted
SetEnv APPLICATION_ENV local
RewriteEngine On
RewriteBase /
RewriteCond
RewriteRule
RewriteCond
RewriteRule

%{HTTP_HOST} ^([a-z]+)\.opendoctors247\.com$ [NC]


^ https://%1.hostname.com%{REQUEST_URI} [R,L]
%{HTTP_HOST} ^opendoctors247\.com$ [NC]
^ https://hostname.com%{REQUEST_URI} [R,L]

RewriteCond
RewriteCond
RewriteCond
RewriteRule
RewriteRule
RewriteRule
</Directory>
</VirtualHost>
chkconfig
chkconfig
chkconfig
chkconfig
service
service
service
service

%{REQUEST_FILENAME} -s [OR]
%{REQUEST_FILENAME} -l [OR]
%{REQUEST_FILENAME} -d
^.*$ - [NC,L]
^.*$ index.php [NC,L]
^(.*js|css)(\?ver=)(.*)$ $1 [L]

httpd on
varnish on
php-fpm on
memcached on

varnish start
memcached start
httpd start
php-fpm start

sss@hostname:~/apache-jmeter-2.13/bin$ ./jmeter.sh -n -t ~/1000users.jmx -l ~/Re


port50users.jtl
Creating summariser <summary>
Created the tree successfully using /home/sss/1000users.jmx
Starting the test @ Sun Jan 10 19:00:45 IST 2016 (1452432645267)
Waiting for possible shutdown message on port 4445
summary = 1200 in 34.5s = 34.8/s Avg: 1382 Min:
1 Max: 13959 Err: 15
0 (12.50%)
Tidying up ...
@ Sun Jan 10 19:01:19 IST 2016 (1452432679998)
... end of run
sss@hostname:~/apache-jmeter-2.13/bin$
sss@hostname:~/apache-jmeter-2.13/bin$ ./jmeter.sh -n -t ~/1000users.jmx -l ~/Re
port100users.jtl
Creating summariser <summary>
Created the tree successfully using /home/sss/1000users.jmx
Starting the test @ Sun Jan 10 19:04:20 IST 2016 (1452432860460)
Waiting for possible shutdown message on port 4445
summary +
422 in 9.3s = 45.3/s Avg: 1936 Min: 293 Max: 5081 Err:
4
4 (10.43%) Active: 100 Started: 100 Finished: 0
summary + 1939 in
30s = 64.6/s Avg: 1528 Min:
1 Max: 4798 Err: 35
3 (18.21%) Active: 40 Started: 100 Finished: 60
summary = 2361 in 39.3s = 60.1/s Avg: 1601 Min:
1 Max: 5081 Err: 39
7 (16.81%)
summary +
39 in
1s = 59.5/s Avg: 1210 Min: 719 Max: 1622 Err:
0 (0.00%) Active: 0 Started: 100 Finished: 100
summary = 2400 in
40s = 60.0/s Avg: 1594 Min:
1 Max: 5081 Err: 39
7 (16.54%)
Tidying up ...
@ Sun Jan 10 19:05:00 IST 2016 (1452432900659)
... end of run
sss@hostname:~/apache-jmeter-2.13/bin$

Вам также может понравиться