instalasi nginx,php,msql di ubuntu 12.04


saya membaca sebuah artikel bagus di internet tentang cara instalasi nginx,php,msql  di ubuntu 12.04, dan sangat membantu sekali bagi saya khususnya.

saya memakai ubuntu 12.04.2 32 bit,sebelumnya saya sudah coba beberapa artikel artikel di internet,namun selalu menemukan error2 yang bikin eneg..

install mysql :

$ sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

initializes the MySQL data directory :

$ sudo mysql_install_db

MySQL set up :

$ sudo /usr/bin/mysql_secure_installation
Enter current password for root (enter for none):
OK, successfully used password, moving on...

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

install nginx:

$ sudo apt-get install nginx

$ sudo service nginx start

configure nginx :

$  sudo nano /etc/nginx/sites-available/default

replace text : 

 [...]
server {
        listen   80;

        root /usr/share/nginx/www;
        index index.php index.html index.htm;

        server_name example.com;

        location / {
                try_files $uri $uri/ /index.html;
        }

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
              root /usr/share/nginx/www;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;

        }

}
[...]

save n restart nginx

$ sudo service nginx start

install php5-fpm :

$ sudo apt-get install php5-fpm

configure php : cari baris “cgi.fix_pathinfo=1”, lalu rubah menjadi  “0” contoh :

cgi.fix_pathinfo=0

edit  file :

$  sudo nano /etc/php5/fpm/pool.d/www.conf

cari baris , “listen = 127.0.0.1:9000′, rubah menjadi,

listen = /var/run/php5-fpm.sock

save…

Restart php-fpm:

$ sudo service php5-fpm restart

sumber : https://www.digitalocean.com/community/articles/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s