LEMP: Difference between revisions

From ICO wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 97: Line 97:


Kontrolimaks, et nginx töötab suuna oma brauser serveri IP-aadressile (192.168.56.210).
Kontrolimaks, et nginx töötab suuna oma brauser serveri IP-aadressile (192.168.56.210).
===PHP paigaldamine===
<pre>apt-get install php5-fpm</pre>
===PHP seadistamine===
<pre>nano /etc/php5/fpm/php.ini</pre>
:rida
:cgi.fix_pathinfo=1
:muuta reaks
:cgi.fix_pathinfo=0
veel üks mutatus failis
<pre>nano /etc/php5/fpm/pool.d/www.conf</pre>
:rida
:<pre>listen = 127.0.0.1:9000</pre>
:muuta reaks
:<pre>listen = /var/run/php5-fpm.sock</pre>

Revision as of 16:09, 24 May 2014

Linux, nginx (Engine x), MySQL, PHP (LEMP) komplekti paigaltamine Ubuntu 12.04 serverisse

näites kasutame klient masinat Ubuntu Desktop 12.04 (64bit) ja serverit Ubuntu-12.04-server-amd64.

näites kasutatud server

RAM 512MB

HDD dynamicly allocated 8GB

2 Võrgukaarti

NIC1 - NAT (eth0 - Ubuntus)
NIC2 - HostOnly (eth1 – Ubuntus) [192.168.56.210]

OS Ubuntu-12.04-server-amd64


esimene samm

Selleks, et minna juurkasutajaks üle, kasuta käsklust.

sudo -i

Uuentame kohalikud tarkvara repositooriumid.

apt-get update


teine samm paigalda MySQL

MySQLi tarkvara paigaldamiseks kasuta Ubuntu serveri all käsklust

apt-get install mysql-server php5-mysql

MySQL root kasutaja parooli märamine. Antud näites: password


MySQLi aktiverimine

mysql_install_db

lõpetuseks joksuta skript

/usr/bin/mysql_secure_installation

Küsitakse root kasutaja parooli, sissestage see.

Küsitakse kas soovite vahetada root kasutaja parooli, vastake N

Järgmistele küsimustele vastake Y. Pärast seda MySQL taaskäivitub ja rakendab muudatused.

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...


Nginx paigaldamine

Paigaldame nginx

apt-get install nginx


Nginx käivitamine, nginx ei käivitu automatselt.

service nginx start

Kontrolimaks, et nginx töötab suuna oma brauser serveri IP-aadressile (192.168.56.210).


PHP paigaldamine

apt-get install php5-fpm


PHP seadistamine

nano /etc/php5/fpm/php.ini
rida
cgi.fix_pathinfo=1
muuta reaks
cgi.fix_pathinfo=0


veel üks mutatus failis

nano /etc/php5/fpm/pool.d/www.conf
rida
listen = 127.0.0.1:9000
muuta reaks
listen = /var/run/php5-fpm.sock