Install Nginx, PHP5, MySQL-servers on Ubuntu 11.04
Unknown12:51 AM 0 comments


Today ga no activity, then eventually want to end up browsing nyoba nginx apache replacement, n he said nginx much faster than apache. immediately wrote it goes without strings attached ga .. he he ... ga even read it later on. please go to your terminal and make sure terkonek internet to facilitate your move.

1. Install required packages

sudo apt-get install php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl nginx spawn-fcgi mysql-server


2. Run service nginx

sudo / etc / init.d / nginx start


when it'll automatically run the following command

sudo update-rc.d nginx defaults

3. edit file /etc/php5/cgi/php.ini
sudo gedit /etc/php5/cgi/php.ini


Change cgi.fix_pathinfo = 0 to 1 (remove the sign;)
[...]
cgi.fix_pathinfo = 1

4. running php cgi

sudo / usr / bin / spawn-fcgi-a 127.0.0.1-p 9000-u www-data-g www-data-f / usr/bin/php5-cgi-P / var / run / fastcgi-php.pid


I'll go put it at each computer restart rc.local before the exit 0 (the code above it.

5. edit nginx.conf

sudo gedit / etc / nginx / nginx.conf

edit the following
[...]
worker_processes 5;
[...]
keepalive_timeout 2;
[...]

6. Hereinafter change the default file path according to our wishes

We change from / usr / share / nginx / www change it to / home / allinone / public_html (this is assumed allinone your users and create a new folder public_html tu)
sudo gedit / etc / nginx / sites-available / default

server {
# Listen 80; # # listen for ipv4; this line is the default and the implied
# Listen [::]: 80 ipv6only default = on; # # listen for ipv6

# Root / usr / share / nginx / www;
root / home / allinone / public_html;
index index.html index.htm;

# Make site accessible from http://localhost/
server_name localhost;

location / {
# First Attempt to serve the request as file, then
# As directory, then fall back to index.html
try_files $ uri $ uri / / index.html;
}

location / doc {
root / usr / share;
autoindex on;
allow 127.0.0.1;
deny all;
}

location / images {
root / usr / share;
autoindex off;
}

# Error_page 404 / 404.html;

# Redirect server error pages to the static page / 50x.html
#
# Error_page 500 502 503 504 / 50x.html;
# Location = / 50x.html {
# Root / usr / share / nginx / www;
#}

# Proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
# Location ~ \. Php $ {
# Proxy_pass http://127.0.0.1;
#}

# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# Location ~ \. Php $ {
# Fastcgi_pass 127.0.0.1:9000;
# Fastcgi_index index.php;
# Include fastcgi_params;
#}

# Deny access to. Htaccess files, if Apache's document root
# Concurs with nginx's one
#
# Location ~ / \. Ht {
# Deny all;
#}
}

7. Finally we just do a restart nginx

sudo / etc / init.d / nginx restart


8. deh finished, now you try to create a web in / home / allinone / public_html

About The Author Ali Bajwa Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore. Magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Facebook and Twitter

0 comments

Post a Comment