I heard that Nginx is very strong. The company's O & M team mentioned Nginx. today, I manually reinstalled my server. The server system still uses FreeBSD, and the new version 7.2 is used this time. Required software: nginx0.6.38spawn-fcgi-1.6.0php5-5.2.9MySQL5.0.77proftpd-1.3.2memcached-heard that Nginx is very strong, the company's O & M personnel mentioned Nginx, today I manually reinstall their own server. The server system still uses FreeBSD, and the new version 7.2 is used this time.
Required software:
Nginx 0.6.38
Spawn-fcgi-1.6.0
Php5-5.2.9
MySQL 5.0.77
Proftpd-1.3.2
Memcached-1.2.6_1
1. install the system. it takes less than 15 minutes to install the system. select the minimum number of packages, such as Ports, Perl, and Python. Enable ssh.
2. use Ports to install php5, vim, spawn-fcgi, and memcached. The FreeBSD system automatically installs some basic lib. For example, libxml2, libzip, libgd2, libjpeg, and some common basic software will also be installed.
When mysql is installed on Ports, mysql cannot be downloaded. Php5 chooses ports instead of using it. Instead, it downloads, compiles, and installs it on its own.
3. download a copy of MySQL, compile and install it.
Copy php. ini-dist to/usr/local/php/lib/php. ini, modify the configuration file, and enable the required extension.
5. Nginx is also installed on ports.
Cd/usr/ports/www/nginx/
Make install clean PREFIX =/usr/local/nginx
Note: a pcre package is required before nginx is installed. Install pcre before installing ports. If pcre is automatically installed during nginx installation, the pcre will be installed to/usr/local/nginx, and nginx will not find the pcre of/usr/local and report an error.
6. Configure nginx
Java code
Events {
Worker_connections 1024;
Use kqueue; # enable kqueue in FreeSBD and epoll in Linux
}
Events {worker_connections 1024; use kqueue; # enable kqueue in FreeSBD and epoll in Linux}
The configuration file fastcgi_param that comes with fcgi. conf nginx is missing
Java code
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
$ Document_root is the root directory of the php program. If this field exists in the nginx VM, you can reference the variable. If not, enter the absolute path. /Wwwroot $ fastcgi_script_name;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service