Nginx
安装 sudo apt-get install nginx
启动:sudo nginx
关闭:sudo nginx -s stop
配置
/etc/nginx/nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80; //监听的端口号,默认80
server_name 192.168.1.1; //你的服务器的ip
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /home/backmanage; //项目的地址
index index.html; //首页名称
}
}
}
主要配置的是http的server
输入192.168.1.1看结果。
到此为止你的页面就可以正常的显示了。