How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu
2014-11-15 15:17
661 查看
sudoapt-getupdate sudoapt-getinstallnginx
sudomkdir-p/var/www/example.com/html
[/code]
sudochown-R$USER:$USER/var/www/example.com/html
sudochmod-R755/var/www
sudocp/etc/nginx/sites-available/default/etc/nginx/sites-available/example.com
sudonano/etc/nginx/sites-available/example.com
server{ listen80default_server; listen[::]:80default_serveripv6only=on; root/usr/share/nginx/html; indexindex.htmlindex.htm; server_namelocalhost; location/{ try_files$uri$uri/=404; } }
sudoln-s/etc/nginx/sites-available/example.com/etc/nginx/sites-enabled/ sudorm/etc/nginx/sites-enabled/default
sudoservicenginxrestart
'target='_blank'>https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-14-04-lts[/code]
相关文章推荐
- How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 14.04 LTS
- How to Set Up Apache Virtual Hosts on Ubuntu 12.04 LTS
- How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS
- How To Set Up Apache Virtual Hosts on CentOS 6
- How to set up an FTP server on Ubuntu 14.04
- How To Set Up HTTP Authentication With Nginx On Ubuntu 12.10
- How to set up a mail server on a GNU / Linux system
- How To Set Up a Private Git Server on a VPS
- How to Install Laravel with an Nginx Web Server on Ubuntu 14.04(Composer,laravel,nginx)
- How To Set Up a Private Docker Registry on Ubuntu 14.04
- How to set up PHP server on Mac OS X 10.8
- How To Set Up vsftpd on Ubuntu 12.04
- How to set up CA server on server 2012
- How to set up a Subversion (SVN) server on CentOS or Fedora
- How to set up Solr on Ubuntu 10.04 (or whatever)
- How to set up Eclipse with Android SDK on Ubuntu linux 9.04/9.10 (updated)