In the previous article (nginx + mono + FastCGI for deploying the Asp.net website in Windows), I found that many of my predecessors have finally successfully deployed the website in Windows. The only pity is that the style below Asp.net webform is a bit incorrect, but MVC still works.
This article describes the achievements of ubuntu over the past two days. For those who have never been familiar with Linux, they have to start from the basics. next, we will briefly introduce several commonly used commands in the Ubuntu system to improve literacy:
File Management CD .. back to the upper-level directory of the current directory
File Management CD-go to the last directory
File Management Cd ~ Or CD back to the current user's home directory
File Management CD/etc to enter a directory.
File Management # cp CP/path/file./move files under absolute path to the current directory
Sudo apt-Get install software name install software command
Sudo apt-Get update system update
Wget HTTP address .. is a command line download tool, very powerful
Tar xzvf compressed file --- decompress the file, tar czvf this.tar.gz./*. txt -- compress the file
Sudo gedit path/file open editor.
View mono version
View nginx version in nginx-v.
The commands used in this article are basically the above and are not fully described.
Next, let's go to the question: My Ubuntu is installed on vmware6.5, and there are many situations when configuring the NIC, which causes the Ubuntu of the virtual machine to fail to access the network .. cute and hateful version !!!
However, I finally found several services. This is not the focus of this article.
Step 1 install the relevant software:
Install nginx:
Open the terminal:
Input: sudo apt-Get update
Sudo apt-Get install nginx
The installation is successful.
Install mono2.10:
Enter the next command after receiving the prompt.
Sudo apt-Get build-dep mono
Wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.10.tar.bz2
Tar jvxf mono-2.10.tar.bz2
CD mono-2.10
./Configure -- prefix =/usr/local
Make
Sudo make install
It takes a little longer to install and compile mono ..
Install FastCGI-mono-Server:
$ Sudo apt-Get install Subversion
$ SVN Co http://mono-soc-2007.googlecode.com/svn/trunk/brian/FastCgi/ FastCGI-mono-Server
$ CD FastCGI-mono-server/
$./Autogen. Sh
$ Make
$ Sudo make install
Step 2 Configuration:
Configure nginx
First, edit the nginx. conf file gedit/etc/nginx. conf.
Other nodes do not need to be added to the HTTP node.
Server {
Listen 80;
SERVER_NAME localhost;
Location ~ {
Root/home/Xiaogang/projects/nginxsite; # project root directory
# Index index.html index.htm;
Fastcgi_pass 127.0.0.1: 8000; # The port must be the same as the port mapped by FastCGI.
Fastcgi_param script_filename $ document_root/$ fastcgi_script_name;
Include/etc/nginx/fastcgi_params;
}
}
Edit the default file gedit/etc/nginx/sites-available/default in the sites-available Directory.
Copy the location content under the server node to the server node under the default file. This is very important!
Step 3:
Start the nginx service after some are ready
Command Line input:/etc/init. d/nginx start
If no exceptions occur
Then start the mono-FastCGI service sudo FastCGI-mono server2/socket = TCP: 8000/address = 127.0.0.1/applications =/:/home/Xiaogang/projects/nginxsite
A friend who looks at the picture will find that the port number and address are reversed. I don't know if it is a version problem, but it does not affect the running result.
Enter http: // localhost/in the browser to access your website. We recommend that you deploy a simple website for the first time.
If you want to deploy MVC, you need to add it at the end of the/etc/nginx/fastcgi_params file.
Fastcgi_param path_info "";
Fastcgi_param script_filename $ document_root $ fastcgi_script_name;
Ke... after two days, I finally got it. nginx is really powerful. I need to continue researching.
PS: I installed mono2.10, but does not support. netframwork4.0? How can I not run 4.0 of websites!