[Bitnami]NginxOpenSource环境的常见配置

使用版本

bitnami-nginx-1.14.2-0-linux-debian-9-x86_64.ova

SSH、地址及网卡配置

参考 [Bitnami]LAMP环境的常见配置

关闭https及修改网站根目录

# cd /opt/bitnami/nginx/conf/bitnami
# cp bitnami.conf bitnami.conf.bak
# vi bitnami.conf

仅保留以下内容,其中删除HTTPS server部分为关闭HTTPS,添加两个location中的root字段为修改网站根目录,location中fastcgi的部分字段非必须。

	# HTTP server

	server {
		listen     			 	80;
		server_name   	localhost;
		include "/ope/bitnami/nginx/conf/bitnami/phpfastcgi.conf"
 		
 		location / { 
 			root 				/home/bitnami/myapp;
 			index				index.html;
 		}

		location ~ \.php$ {
			root 				/home/bitnami/myapp;
			fastcgi_read_timeout	300;
			fastcgi_pass	unix:/opt/bitnami/php/var/run/www.sock;
			fastcgi_index 	index.php;
			fastcgi_param	SCRIPT_FILENAME $request_filename;
			include			fastcgi_params;
		}

重启nginx

# /opt/bitnami/ctlscript.sh restart nginx
//查看状态
# /opt/bitnami/ctlscript.sh status
//关闭nginx
# /opt/bitnami/ctlscript.sh stop nginx

你可能感兴趣的:(运行维护)