คำถามน่ารู้
หน้าแรก > คำถามน่ารู้ > Linux server > nginx+php5+MySQL
nginx+php5+MySQL
Debian 5,6 Ubuntu 10.x.x
1. apt-get purge apache2 apache2-utils apache2.2-bin apache2-common apt-get autoremove
2. /etc/apt/sources.list
Debian 7 deb http://mirror.kku.ac.th/debian/ wheezy main deb-src http://mirror.kku.ac.th/debian/ wheezy main deb http://security.debian.org/ wheezy/updates main deb-src http://security.debian.org/ wheezy/updates main # wheezy-updates, previously known as 'volatile' deb http://mirror.kku.ac.th/debian/ wheezy-updates main deb-src http://mirror.kku.ac.th/debian/ wheezy-updates main
3. apt-get update apt-get upgrade
4. apt-get install nginx php5-cli php5-cgi build-essential wget php5-gd psmisc php5-dev php5-curl php5-cli php5-common php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xcache php5-xmlrpc php5-xsl /etc/init.d/nginx start
5. mkdir -p /var/www/radio.sumritradio.com/public_html mkdir /var/www/radio.sumritradio.com/logs chown -R www-data:www-data /var/www/radio.sumritradio.com
6. �������ҧ Vhost nano /etc/nginx/sites-available/radio.sumritradio.com
server { server_name www.radio.sumritradio.com radio.sumritradio.com; access_log /var/www/radio.sumritradio.com/logs/access.log; error_log /var/www/radio.sumritradio.com/logs/error.log; root /var/www/radio.sumritradio.com/public_html; location / { index index.html index.htm index.php; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/radio.sumritradio.com/public_html$fastcgi_script_name; }
location ~ \.php$ { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/radio.sumritradio.com/public_html$fastcgi_script_name; } }
7. enabled site cd /etc/nginx/sites-enabled/ ln -s /etc/nginx/sites-available/radio.sumritradio.com /etc/init.d/nginx restart
8. Install spawn-fcgi
cd /opt wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz tar -xf spawn* cd spawn* ./configure make cp src/spawn-fcgi /usr/bin/spawn-fcgi
9. Move php-fascgi cd /opt wget -O php-fastcgi-deb.sh http://library.linode.com/assets/680-php-fastcgi-deb.sh mv php-fastcgi-deb.sh /usr/bin/php-fastcgi chmod +x /usr/bin/php-fastcgi wget -O php-fastcgi-init-deb.sh http://library.linode.com/assets/681-php-fastcgi-init-deb.sh mv php-fastcgi-init-deb.sh /etc/init.d/php-fastcgi chmod +x /etc/init.d/php-fastcgi update-rc.d php-fastcgi defaults /etc/init.d/php-fastcgi start
10. Test page nano /var/www/radio.sumritradio.com/public_html/info.php
11. Install MySQL
apt-get install mysql-common mysql-client mysql-server
12. Install FTP
apt-get install proftpd ucf Run proftpd: <-- standalone
nano /etc/proftpd/proftpd.conf
DefaultRoot ~ IdentLookups off ServerIdent on "FTP Server ready."
ln -s /etc/proftpd/proftpd.conf /etc/proftpd.conf /etc/init.d/proftpd restart
13. ���� User Adduser xxx
Nano /etc/passwd
xxx:x:1002:1002::/var/www/domain.com:/bin/bash
If Cannot Run sc_serv plobum go to install
For CentOS 6 (6 ONLY) run this:
yum install ld-linux.so.2
For CentOS, RedHat and Similar:
yum install lib32-glib
For Debian and similar:
apt-get install ia32-libs
|
Add to Favourites
Print this Article |
block ip port (คนดู: 1346)