tanhasystem
July 22nd, 2012, 12:29
اول از همه از همه مدیران وب هاستینگ تالک تشکر می کنم
یه لینکی گذاشتیم در مورد پلسک نال شده (حتما قوانین رعایت نکرده بودم)متاسفانه پاک گردید امیدواریم که این اموزش انشاءالله پاک نگردد
Part 1 : NginX
1. Visit their website at nginx news (http://www.nginx.net/)
2. On their homepage, download either the stable or developmental version.
*Note: I went for the developmental version, but it doesn't really matter.*
*The command below is valid as of time of posting, but will probably be outdated.
3. Execute :
wget http://sysoev.ru/nginx/nginx-0.6.5.tar.gz
tar -xzf nginx-0.6.5.tar.gz
cd nginx-0.6.5
4. Configure according to your preference. I chose this :
./configure --with-http_stub_status_module --with-openssl=/usr/lib/openssl
make
make install
This ends the nginx install.
Part 2 : PHP
1. Prepare your configuration options. If PHP is already installed, create a phpinfo(); page and extract the configuration line.
2. Download the latest version of PHP, extract and enter that directory.
3. Execute
./configure --enable-fastcgi ... (Insert your configuration) make make install
This ends the PHP install.
Part 3 : Spawn FCGI Script
We need to download LightTPD to get it's spawn-fcgi.
1. To get it, download it from lighttpd fly light (http://www.lighttpd.net).
2. Download, extract, and then run :
./configure make cd src cp ./spawn-fcgi /usr/local/bin/spawn-fcgi
3. Try running /usr/local/bin/spawn-fcgi. Make sure it exists and returns this :
spawn-fcgi-1.4.15 - spawns fastcgi processes
4. You can remove the extracted folder. lighttpd has not been installed as make install was not executed.
Part 4 : Apache Parser
I've written a parser to parse Apache configuration (attached to this post).
1. Download the attachment, rename it nginx.php and place it in /etc/init.d/
2. Execute :
chmod 700 nginx.php
3. Use your favourite editor nano/pico/vi to open nginx.php.
4. At the top of the file, you should see :
#!/usr/local/bin/php -n
Replace /usr/local/bin/php with wherever your PHP binary is.
Be careful NOT to remove the ending -n.
5. The top part of the file (after that first line) should look like :
// Configuration Section $nginx_init = "/etc/init.d/nginx"; $apache_config = "/etc/httpd/conf/httpd.conf"; $da_vhosts = "/etc/httpd/conf/extra/directadmin-vhosts.conf"; $tmp_folder = "/tmp/"; $debug_level = 0; // 0 => FATAL, 1 => WARN, 2 => INFO $killall_bin = "/usr/bin/killall"; $spawn_bin = "/usr/local/bin/spawn-fcgi"; // Nginx Configuration $nginx_config = "/usr/local/nginx/conf/nginx.conf"; $nginx_bin = "/usr/local/nginx/sbin/nginx"; $mod_status = true; // PHP Configuration $php_childs = 3; $php_bin = "/opt/php/bin/php-cgi"; $php_startport = 11000;
Make sure the file paths are correct. For example, my PHP is located in /opt/php.
Yours probably isn't.
Some particularly important variables :
$nginx_init - Where the controllable nginx init script will be. Leaving as-is is probably fine.
$da_vhosts - This file must contain the list of includes of every user's httpd.conf
$tmp_folder - The temporary folder. Must be world writable.
$php_startport - The PHP FastCGI will bind to a port starting from this number.
6. Execute the php script was rewrite-init as the parameter.
/etc/init.d/nginx.php rewrite-init
7. The init file will be written to wherever you specified it previously.
8. You can now run [init_file] start/stop/restart/reload/graceful/status.
Part 5 : DirectAdmin Touchup
1. Open /usr/local/directadmin/data/admin/services.status in a text editor.
2. Replace httpd=ON with nginx=ON.
3. Execute : (remember to replace INIT_FILE below with where your nginx init file is)
mv /etc/init.d/httpd /etc/init.d/httpd.old ln -vs INIT_FILE /etc/init.d/httpd
Part 6 : htscanner (Optional)
This module installs a PHP plugin to emulate Apache's scanning for PHP options.
1. Locate where your PHP Pecl is :
locate pecl
2. Using the full path of pecl found, execute :
/location/to/pecl install htscanner
End
یه لینکی گذاشتیم در مورد پلسک نال شده (حتما قوانین رعایت نکرده بودم)متاسفانه پاک گردید امیدواریم که این اموزش انشاءالله پاک نگردد
Part 1 : NginX
1. Visit their website at nginx news (http://www.nginx.net/)
2. On their homepage, download either the stable or developmental version.
*Note: I went for the developmental version, but it doesn't really matter.*
*The command below is valid as of time of posting, but will probably be outdated.
3. Execute :
wget http://sysoev.ru/nginx/nginx-0.6.5.tar.gz
tar -xzf nginx-0.6.5.tar.gz
cd nginx-0.6.5
4. Configure according to your preference. I chose this :
./configure --with-http_stub_status_module --with-openssl=/usr/lib/openssl
make
make install
This ends the nginx install.
Part 2 : PHP
1. Prepare your configuration options. If PHP is already installed, create a phpinfo(); page and extract the configuration line.
2. Download the latest version of PHP, extract and enter that directory.
3. Execute
./configure --enable-fastcgi ... (Insert your configuration) make make install
This ends the PHP install.
Part 3 : Spawn FCGI Script
We need to download LightTPD to get it's spawn-fcgi.
1. To get it, download it from lighttpd fly light (http://www.lighttpd.net).
2. Download, extract, and then run :
./configure make cd src cp ./spawn-fcgi /usr/local/bin/spawn-fcgi
3. Try running /usr/local/bin/spawn-fcgi. Make sure it exists and returns this :
spawn-fcgi-1.4.15 - spawns fastcgi processes
4. You can remove the extracted folder. lighttpd has not been installed as make install was not executed.
Part 4 : Apache Parser
I've written a parser to parse Apache configuration (attached to this post).
1. Download the attachment, rename it nginx.php and place it in /etc/init.d/
2. Execute :
chmod 700 nginx.php
3. Use your favourite editor nano/pico/vi to open nginx.php.
4. At the top of the file, you should see :
#!/usr/local/bin/php -n
Replace /usr/local/bin/php with wherever your PHP binary is.
Be careful NOT to remove the ending -n.
5. The top part of the file (after that first line) should look like :
// Configuration Section $nginx_init = "/etc/init.d/nginx"; $apache_config = "/etc/httpd/conf/httpd.conf"; $da_vhosts = "/etc/httpd/conf/extra/directadmin-vhosts.conf"; $tmp_folder = "/tmp/"; $debug_level = 0; // 0 => FATAL, 1 => WARN, 2 => INFO $killall_bin = "/usr/bin/killall"; $spawn_bin = "/usr/local/bin/spawn-fcgi"; // Nginx Configuration $nginx_config = "/usr/local/nginx/conf/nginx.conf"; $nginx_bin = "/usr/local/nginx/sbin/nginx"; $mod_status = true; // PHP Configuration $php_childs = 3; $php_bin = "/opt/php/bin/php-cgi"; $php_startport = 11000;
Make sure the file paths are correct. For example, my PHP is located in /opt/php.
Yours probably isn't.
Some particularly important variables :
$nginx_init - Where the controllable nginx init script will be. Leaving as-is is probably fine.
$da_vhosts - This file must contain the list of includes of every user's httpd.conf
$tmp_folder - The temporary folder. Must be world writable.
$php_startport - The PHP FastCGI will bind to a port starting from this number.
6. Execute the php script was rewrite-init as the parameter.
/etc/init.d/nginx.php rewrite-init
7. The init file will be written to wherever you specified it previously.
8. You can now run [init_file] start/stop/restart/reload/graceful/status.
Part 5 : DirectAdmin Touchup
1. Open /usr/local/directadmin/data/admin/services.status in a text editor.
2. Replace httpd=ON with nginx=ON.
3. Execute : (remember to replace INIT_FILE below with where your nginx init file is)
mv /etc/init.d/httpd /etc/init.d/httpd.old ln -vs INIT_FILE /etc/init.d/httpd
Part 6 : htscanner (Optional)
This module installs a PHP plugin to emulate Apache's scanning for PHP options.
1. Locate where your PHP Pecl is :
locate pecl
2. Using the full path of pecl found, execute :
/location/to/pecl install htscanner
End