Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure a web server

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of how to configure the web server, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to configure the web server. Let's take a look at it.

In order to debug the program, a web server that supports php is still required. Memory is so small that it abandons the old apache and uses nginx instead, and supports php through fast-cgi. Vpslink provides a source image of ubuntu, no matter how fast it is.

(1) install nginx and php in one step

Apt-get install nginx php5-cli php5-cgi php5-mysql

(2) because spawn-fcgi is needed to start fast-cgi, install lighttpd and set it to boot without startup.

Apt-get install lighttpd

(3) configure fast-cgi

Set up the service file of php-cgi under / etc/init.d/. For simplicity, you can modify it directly by copy nginx.

Cp nginx php-cgi

Vi php-cgi, modify the corresponding parameters

Daemon=/usr/bin/spawn-fcgi

Daemon_opts= "- a 127.0.0.1-p 9000-c 10-u www-data-f / usr/bin/php-cgi"

The action when modifying stop is: pkill-9 php-cgi

Save, exit.

(4) configure nginx and turn on php support

Vi / etc/nginx/sites-available/default

Add index.php to index and cancel some comments related to php. Note that you need to modify the path of fastcgi_param.

Location ~\ .php$ {

Fastcgi_pass 127.0.0.1:9000

Fastcgi_index index.php

Fastcgi_param script_filename / var/www/nginx-default$fastcgi_script_name

Include / etc/nginx/fastcgi_params

}

(5) start the service

/ etc/init.d/php-cgi start

/ etc/init.d/nginx start

The web server is configured.

This is the end of the article on "how to configure a web server". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to configure web server". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report